var T7=Object.defineProperty;var F7=(e,t,r)=>t in e?T7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ty=(e,t,r)=>F7(e,typeof t!="symbol"?t+"":t,r);function I7(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(a,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function El(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fy={exports:{}},K0={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var I_;function D7(){if(I_)return K0;I_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:i}}return K0.Fragment=t,K0.jsx=r,K0.jsxs=r,K0}var D_;function U7(){return D_||(D_=1,Fy.exports=D7()),Fy.exports}var n=U7(),Iy={exports:{}},Nt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var U_;function M7(){if(U_)return Nt;U_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),x=Symbol.iterator;function m(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,y={};function k(O,P,q){this.props=O,this.context=P,this.refs=y,this.updater=q||b}k.prototype.isReactComponent={},k.prototype.setState=function(O,P){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,P,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function _(){}_.prototype=k.prototype;function C(O,P,q){this.props=O,this.context=P,this.refs=y,this.updater=q||b}var E=C.prototype=new _;E.constructor=C,v(E,k.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function B(){}var I={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function U(O,P,q){var H=q.ref;return{$$typeof:e,type:O,key:P,ref:H!==void 0?H:null,props:q}}function D(O,P){return U(O.type,P,O.props)}function L(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function R(O){var P={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(q){return P[q]})}var Q=/\/+/g;function G(O,P){return typeof O=="object"&&O!==null&&O.key!=null?R(""+O.key):P.toString(36)}function K(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(B,B):(O.status="pending",O.then(function(P){O.status==="pending"&&(O.status="fulfilled",O.value=P)},function(P){O.status==="pending"&&(O.status="rejected",O.reason=P)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function W(O,P,q,H,J){var ae=typeof O;(ae==="undefined"||ae==="boolean")&&(O=null);var oe=!1;if(O===null)oe=!0;else switch(ae){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(O.$$typeof){case e:case t:oe=!0;break;case f:return oe=O._init,W(oe(O._payload),P,q,H,J)}}if(oe)return J=J(O),oe=H===""?"."+G(O,0):H,T(J)?(q="",oe!=null&&(q=oe.replace(Q,"$&/")+"/"),W(J,P,q,"",function(le){return le})):J!=null&&(L(J)&&(J=D(J,q+(J.key==null||O&&O.key===J.key?"":(""+J.key).replace(Q,"$&/")+"/")+oe)),P.push(J)),1;oe=0;var ce=H===""?".":H+":";if(T(O))for(var ne=0;ne<O.length;ne++)H=O[ne],ae=ce+G(H,ne),oe+=W(H,P,q,ae,J);else if(ne=m(O),typeof ne=="function")for(O=ne.call(O),ne=0;!(H=O.next()).done;)H=H.value,ae=ce+G(H,ne++),oe+=W(H,P,q,ae,J);else if(ae==="object"){if(typeof O.then=="function")return W(K(O),P,q,H,J);throw P=String(O),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return oe}function z(O,P,q){if(O==null)return O;var H=[],J=0;return W(O,H,"","",function(ae){return P.call(q,ae,J++)}),H}function Z(O){if(O._status===-1){var P=O._result;P=P(),P.then(function(q){(O._status===0||O._status===-1)&&(O._status=1,O._result=q)},function(q){(O._status===0||O._status===-1)&&(O._status=2,O._result=q)}),O._status===-1&&(O._status=0,O._result=P)}if(O._status===1)return O._result.default;throw O._result}var Y=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},te={map:z,forEach:function(O,P,q){z(O,function(){P.apply(this,arguments)},q)},count:function(O){var P=0;return z(O,function(){P++}),P},toArray:function(O){return z(O,function(P){return P})||[]},only:function(O){if(!L(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Nt.Activity=p,Nt.Children=te,Nt.Component=k,Nt.Fragment=r,Nt.Profiler=s,Nt.PureComponent=C,Nt.StrictMode=a,Nt.Suspense=d,Nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Nt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return I.H.useMemoCache(O)}},Nt.cache=function(O){return function(){return O.apply(null,arguments)}},Nt.cacheSignal=function(){return null},Nt.cloneElement=function(O,P,q){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var H=v({},O.props),J=O.key;if(P!=null)for(ae in P.key!==void 0&&(J=""+P.key),P)!M.call(P,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&P.ref===void 0||(H[ae]=P[ae]);var ae=arguments.length-2;if(ae===1)H.children=q;else if(1<ae){for(var oe=Array(ae),ce=0;ce<ae;ce++)oe[ce]=arguments[ce+2];H.children=oe}return U(O.type,J,H)},Nt.createContext=function(O){return O={$$typeof:l,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:i,_context:O},O},Nt.createElement=function(O,P,q){var H,J={},ae=null;if(P!=null)for(H in P.key!==void 0&&(ae=""+P.key),P)M.call(P,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&(J[H]=P[H]);var oe=arguments.length-2;if(oe===1)J.children=q;else if(1<oe){for(var ce=Array(oe),ne=0;ne<oe;ne++)ce[ne]=arguments[ne+2];J.children=ce}if(O&&O.defaultProps)for(H in oe=O.defaultProps,oe)J[H]===void 0&&(J[H]=oe[H]);return U(O,ae,J)},Nt.createRef=function(){return{current:null}},Nt.forwardRef=function(O){return{$$typeof:o,render:O}},Nt.isValidElement=L,Nt.lazy=function(O){return{$$typeof:f,_payload:{_status:-1,_result:O},_init:Z}},Nt.memo=function(O,P){return{$$typeof:u,type:O,compare:P===void 0?null:P}},Nt.startTransition=function(O){var P=I.T,q={};I.T=q;try{var H=O(),J=I.S;J!==null&&J(q,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(B,Y)}catch(ae){Y(ae)}finally{P!==null&&q.types!==null&&(P.types=q.types),I.T=P}},Nt.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Nt.use=function(O){return I.H.use(O)},Nt.useActionState=function(O,P,q){return I.H.useActionState(O,P,q)},Nt.useCallback=function(O,P){return I.H.useCallback(O,P)},Nt.useContext=function(O){return I.H.useContext(O)},Nt.useDebugValue=function(){},Nt.useDeferredValue=function(O,P){return I.H.useDeferredValue(O,P)},Nt.useEffect=function(O,P){return I.H.useEffect(O,P)},Nt.useEffectEvent=function(O){return I.H.useEffectEvent(O)},Nt.useId=function(){return I.H.useId()},Nt.useImperativeHandle=function(O,P,q){return I.H.useImperativeHandle(O,P,q)},Nt.useInsertionEffect=function(O,P){return I.H.useInsertionEffect(O,P)},Nt.useLayoutEffect=function(O,P){return I.H.useLayoutEffect(O,P)},Nt.useMemo=function(O,P){return I.H.useMemo(O,P)},Nt.useOptimistic=function(O,P){return I.H.useOptimistic(O,P)},Nt.useReducer=function(O,P,q){return I.H.useReducer(O,P,q)},Nt.useRef=function(O){return I.H.useRef(O)},Nt.useState=function(O){return I.H.useState(O)},Nt.useSyncExternalStore=function(O,P,q){return I.H.useSyncExternalStore(O,P,q)},Nt.useTransition=function(){return I.H.useTransition()},Nt.version="19.2.4",Nt}var M_;function RA(){return M_||(M_=1,Iy.exports=M7()),Iy.exports}var j=RA();const Bp=El(j),R7=I7({__proto__:null,default:Bp},[j]);var Dy={exports:{}},q0={},Uy={exports:{}},My={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var R_;function O7(){return R_||(R_=1,(function(e){function t(W,z){var Z=W.length;W.push(z);e:for(;0<Z;){var Y=Z-1>>>1,te=W[Y];if(0<s(te,z))W[Y]=z,W[Z]=te,Z=Y;else break e}}function r(W){return W.length===0?null:W[0]}function a(W){if(W.length===0)return null;var z=W[0],Z=W.pop();if(Z!==z){W[0]=Z;e:for(var Y=0,te=W.length,O=te>>>1;Y<O;){var P=2*(Y+1)-1,q=W[P],H=P+1,J=W[H];if(0>s(q,Z))H<te&&0>s(J,q)?(W[Y]=J,W[H]=Z,Y=H):(W[Y]=q,W[P]=Z,Y=P);else if(H<te&&0>s(J,Z))W[Y]=J,W[H]=Z,Y=H;else break e}}return z}function s(W,z){var Z=W.sortIndex-z.sortIndex;return Z!==0?Z:W.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var d=[],u=[],f=1,p=null,x=3,m=!1,b=!1,v=!1,y=!1,k=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function E(W){for(var z=r(u);z!==null;){if(z.callback===null)a(u);else if(z.startTime<=W)a(u),z.sortIndex=z.expirationTime,t(d,z);else break;z=r(u)}}function T(W){if(v=!1,E(W),!b)if(r(d)!==null)b=!0,B||(B=!0,R());else{var z=r(u);z!==null&&K(T,z.startTime-W)}}var B=!1,I=-1,M=5,U=-1;function D(){return y?!0:!(e.unstable_now()-U<M)}function L(){if(y=!1,B){var W=e.unstable_now();U=W;var z=!0;try{e:{b=!1,v&&(v=!1,_(I),I=-1),m=!0;var Z=x;try{t:{for(E(W),p=r(d);p!==null&&!(p.expirationTime>W&&D());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,x=p.priorityLevel;var te=Y(p.expirationTime<=W);if(W=e.unstable_now(),typeof te=="function"){p.callback=te,E(W),z=!0;break t}p===r(d)&&a(d),E(W)}else a(d);p=r(d)}if(p!==null)z=!0;else{var O=r(u);O!==null&&K(T,O.startTime-W),z=!1}}break e}finally{p=null,x=Z,m=!1}z=void 0}}finally{z?R():B=!1}}}var R;if(typeof C=="function")R=function(){C(L)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,G=Q.port2;Q.port1.onmessage=L,R=function(){G.postMessage(null)}}else R=function(){k(L,0)};function K(W,z){I=k(function(){W(e.unstable_now())},z)}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(W){W.callback=null},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(W){switch(x){case 1:case 2:case 3:var z=3;break;default:z=x}var Z=x;x=z;try{return W()}finally{x=Z}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(W,z){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Z=x;x=W;try{return z()}finally{x=Z}},e.unstable_scheduleCallback=function(W,z,Z){var Y=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?Y+Z:Y):Z=Y,W){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=Z+te,W={id:f++,callback:z,priorityLevel:W,startTime:Z,expirationTime:te,sortIndex:-1},Z>Y?(W.sortIndex=Z,t(u,W),r(d)===null&&W===r(u)&&(v?(_(I),I=-1):v=!0,K(T,Z-Y))):(W.sortIndex=te,t(d,W),b||m||(b=!0,B||(B=!0,R()))),W},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(W){var z=x;return function(){var Z=x;x=z;try{return W.apply(this,arguments)}finally{x=Z}}}})(My)),My}var O_;function P7(){return O_||(O_=1,Uy.exports=O7()),Uy.exports}var Ry={exports:{}},jn={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var P_;function L7(){if(P_)return jn;P_=1;var e=RA();function t(d){var u="https://react.dev/errors/"+d;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+d+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(d,u,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:d,containerInfo:u,implementation:f}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(d,u){if(d==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,jn.createPortal=function(d,u){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return i(d,u,null,f)},jn.flushSync=function(d){var u=l.T,f=a.p;try{if(l.T=null,a.p=2,d)return d()}finally{l.T=u,a.p=f,a.d.f()}},jn.preconnect=function(d,u){typeof d=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,a.d.C(d,u))},jn.prefetchDNS=function(d){typeof d=="string"&&a.d.D(d)},jn.preinit=function(d,u){if(typeof d=="string"&&u&&typeof u.as=="string"){var f=u.as,p=o(f,u.crossOrigin),x=typeof u.integrity=="string"?u.integrity:void 0,m=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;f==="style"?a.d.S(d,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:x,fetchPriority:m}):f==="script"&&a.d.X(d,{crossOrigin:p,integrity:x,fetchPriority:m,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},jn.preinitModule=function(d,u){if(typeof d=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var f=o(u.as,u.crossOrigin);a.d.M(d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&a.d.M(d)},jn.preload=function(d,u){if(typeof d=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var f=u.as,p=o(f,u.crossOrigin);a.d.L(d,f,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},jn.preloadModule=function(d,u){if(typeof d=="string")if(u){var f=o(u.as,u.crossOrigin);a.d.m(d,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else a.d.m(d)},jn.requestFormReset=function(d){a.d.r(d)},jn.unstable_batchedUpdates=function(d,u){return d(u)},jn.useFormState=function(d,u,f){return l.H.useFormState(d,u,f)},jn.useFormStatus=function(){return l.H.useHostTransitionStatus()},jn.version="19.2.4",jn}var L_;function hM(){if(L_)return Ry.exports;L_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ry.exports=L7(),Ry.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Q_;function Q7(){if(Q_)return q0;Q_=1;var e=P7(),t=RA(),r=hM();function a(c){var A="https://react.dev/errors/"+c;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)A+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+A+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function i(c){var A=c,h=c;if(c.alternate)for(;A.return;)A=A.return;else{c=A;do A=c,(A.flags&4098)!==0&&(h=A.return),c=A.return;while(c)}return A.tag===3?h:null}function l(c){if(c.tag===13){var A=c.memoizedState;if(A===null&&(c=c.alternate,c!==null&&(A=c.memoizedState)),A!==null)return A.dehydrated}return null}function o(c){if(c.tag===31){var A=c.memoizedState;if(A===null&&(c=c.alternate,c!==null&&(A=c.memoizedState)),A!==null)return A.dehydrated}return null}function d(c){if(i(c)!==c)throw Error(a(188))}function u(c){var A=c.alternate;if(!A){if(A=i(c),A===null)throw Error(a(188));return A!==c?null:c}for(var h=c,g=A;;){var S=h.return;if(S===null)break;var F=S.alternate;if(F===null){if(g=S.return,g!==null){h=g;continue}break}if(S.child===F.child){for(F=S.child;F;){if(F===h)return d(S),c;if(F===g)return d(S),A;F=F.sibling}throw Error(a(188))}if(h.return!==g.return)h=S,g=F;else{for(var V=!1,re=S.child;re;){if(re===h){V=!0,h=S,g=F;break}if(re===g){V=!0,g=S,h=F;break}re=re.sibling}if(!V){for(re=F.child;re;){if(re===h){V=!0,h=F,g=S;break}if(re===g){V=!0,g=F,h=S;break}re=re.sibling}if(!V)throw Error(a(189))}}if(h.alternate!==g)throw Error(a(190))}if(h.tag!==3)throw Error(a(188));return h.stateNode.current===h?c:A}function f(c){var A=c.tag;if(A===5||A===26||A===27||A===6)return c;for(c=c.child;c!==null;){if(A=f(c),A!==null)return A;c=c.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),C=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function R(c){return c===null||typeof c!="object"?null:(c=L&&c[L]||c["@@iterator"],typeof c=="function"?c:null)}var Q=Symbol.for("react.client.reference");function G(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===Q?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case v:return"Fragment";case k:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case B:return"SuspenseList";case U:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case b:return"Portal";case C:return c.displayName||"Context";case _:return(c._context.displayName||"Context")+".Consumer";case E:var A=c.render;return c=c.displayName,c||(c=A.displayName||A.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case I:return A=c.displayName||null,A!==null?A:G(c.type)||"Memo";case M:A=c._payload,c=c._init;try{return G(c(A))}catch{}}return null}var K=Array.isArray,W=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},Y=[],te=-1;function O(c){return{current:c}}function P(c){0>te||(c.current=Y[te],Y[te]=null,te--)}function q(c,A){te++,Y[te]=c.current,c.current=A}var H=O(null),J=O(null),ae=O(null),oe=O(null);function ce(c,A){switch(q(ae,A),q(J,c),q(H,null),A.nodeType){case 9:case 11:c=(c=A.documentElement)&&(c=c.namespaceURI)?r_(c):0;break;default:if(c=A.tagName,A=A.namespaceURI)A=r_(A),c=a_(A,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}P(H),q(H,c)}function ne(){P(H),P(J),P(ae)}function le(c){c.memoizedState!==null&&q(oe,c);var A=H.current,h=a_(A,c.type);A!==h&&(q(J,c),q(H,h))}function ge(c){J.current===c&&(P(H),P(J)),oe.current===c&&(P(oe),z0._currentValue=Z)}var X,pe;function be(c){if(X===void 0)try{throw Error()}catch(h){var A=h.stack.trim().match(/\n( *(at )?)/);X=A&&A[1]||"",pe=-1<h.stack.indexOf(`
    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
`+X+c+pe}var me=!1;function _e(c,A){if(!c||me)return"";me=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(A){var Le=function(){throw Error()};if(Object.defineProperty(Le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Le,[])}catch(Fe){var Be=Fe}Reflect.construct(c,[],Le)}else{try{Le.call()}catch(Fe){Be=Fe}c.call(Le.prototype)}}else{try{throw Error()}catch(Fe){Be=Fe}(Le=c())&&typeof Le.catch=="function"&&Le.catch(function(){})}}catch(Fe){if(Fe&&Be&&typeof Fe.stack=="string")return[Fe.stack,Be.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var F=g.DetermineComponentFrameRoot(),V=F[0],re=F[1];if(V&&re){var fe=V.split(`
`),je=re.split(`
`);for(S=g=0;g<fe.length&&!fe[g].includes("DetermineComponentFrameRoot");)g++;for(;S<je.length&&!je[S].includes("DetermineComponentFrameRoot");)S++;if(g===fe.length||S===je.length)for(g=fe.length-1,S=je.length-1;1<=g&&0<=S&&fe[g]!==je[S];)S--;for(;1<=g&&0<=S;g--,S--)if(fe[g]!==je[S]){if(g!==1||S!==1)do if(g--,S--,0>S||fe[g]!==je[S]){var Oe=`
`+fe[g].replace(" at new "," at ");return c.displayName&&Oe.includes("<anonymous>")&&(Oe=Oe.replace("<anonymous>",c.displayName)),Oe}while(1<=g&&0<=S);break}}}finally{me=!1,Error.prepareStackTrace=h}return(h=c?c.displayName||c.name:"")?be(h):""}function Te(c,A){switch(c.tag){case 26:case 27:case 5:return be(c.type);case 16:return be("Lazy");case 13:return c.child!==A&&A!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return _e(c.type,!1);case 11:return _e(c.type.render,!1);case 1:return _e(c.type,!0);case 31:return be("Activity");default:return""}}function Xe(c){try{var A="",h=null;do A+=Te(c,h),h=c,c=c.return;while(c);return A}catch(g){return`
Error generating stack: `+g.message+`
`+g.stack}}var At=Object.prototype.hasOwnProperty,kt=e.unstable_scheduleCallback,Bt=e.unstable_cancelCallback,Kr=e.unstable_shouldYield,qr=e.unstable_requestPaint,_t=e.unstable_now,Ir=e.unstable_getCurrentPriorityLevel,vr=e.unstable_ImmediatePriority,Fa=e.unstable_UserBlockingPriority,xt=e.unstable_NormalPriority,dr=e.unstable_LowPriority,rt=e.unstable_IdlePriority,Ct=e.log,Vt=e.unstable_setDisableYieldValue,jt=null,er=null;function Dr(c){if(typeof Ct=="function"&&Vt(c),er&&typeof er.setStrictMode=="function")try{er.setStrictMode(jt,c)}catch{}}var zr=Math.clz32?Math.clz32:Zi,Jn=Math.log,$s=Math.LN2;function Zi(c){return c>>>=0,c===0?32:31-(Jn(c)/$s|0)|0}var bs=256,ji=262144,Wr=4194304;function sn(c){var A=c&42;if(A!==0)return A;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function el(c,A,h){var g=c.pendingLanes;if(g===0)return 0;var S=0,F=c.suspendedLanes,V=c.pingedLanes;c=c.warmLanes;var re=g&134217727;return re!==0?(g=re&~F,g!==0?S=sn(g):(V&=re,V!==0?S=sn(V):h||(h=re&~c,h!==0&&(S=sn(h))))):(re=g&~F,re!==0?S=sn(re):V!==0?S=sn(V):h||(h=g&~c,h!==0&&(S=sn(h)))),S===0?0:A!==0&&A!==S&&(A&F)===0&&(F=S&-S,h=A&-A,F>=h||F===32&&(h&4194048)!==0)?A:S}function Ei(c,A){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&A)===0}function qc(c,A){switch(c){case 1:case 2:case 4:case 8:case 64:return A+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 A+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 Po(){var c=Wr;return Wr<<=1,(Wr&62914560)===0&&(Wr=4194304),c}function Dl(c){for(var A=[],h=0;31>h;h++)A.push(c);return A}function $e(c,A){c.pendingLanes|=A,A!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function Tt(c,A,h,g,S,F){var V=c.pendingLanes;c.pendingLanes=h,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=h,c.entangledLanes&=h,c.errorRecoveryDisabledLanes&=h,c.shellSuspendCounter=0;var re=c.entanglements,fe=c.expirationTimes,je=c.hiddenUpdates;for(h=V&~h;0<h;){var Oe=31-zr(h),Le=1<<Oe;re[Oe]=0,fe[Oe]=-1;var Be=je[Oe];if(Be!==null)for(je[Oe]=null,Oe=0;Oe<Be.length;Oe++){var Fe=Be[Oe];Fe!==null&&(Fe.lane&=-536870913)}h&=~Le}g!==0&&Yr(c,g,0),F!==0&&S===0&&c.tag!==0&&(c.suspendedLanes|=F&~(V&~A))}function Yr(c,A,h){c.pendingLanes|=A,c.suspendedLanes&=~A;var g=31-zr(A);c.entangledLanes|=A,c.entanglements[g]=c.entanglements[g]|1073741824|h&261930}function Ia(c,A){var h=c.entangledLanes|=A;for(c=c.entanglements;h;){var g=31-zr(h),S=1<<g;S&A|c[g]&A&&(c[g]|=A),h&=~S}}function xe(c,A){var h=A&-A;return h=(h&42)!==0?1:qe(h),(h&(c.suspendedLanes|A))!==0?0:h}function qe(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=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:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function et(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function ee(){var c=z.p;return c!==0?c:(c=window.event,c===void 0?32:j_(c.type))}function de(c,A){var h=z.p;try{return z.p=c,A()}finally{z.p=h}}var se=Math.random().toString(36).slice(2),ie="__reactFiber$"+se,ue="__reactProps$"+se,Ae="__reactContainer$"+se,Ne="__reactEvents$"+se,Me="__reactListeners$"+se,Ce="__reactHandles$"+se,Ee="__reactResources$"+se,Se="__reactMarker$"+se;function He(c){delete c[ie],delete c[ue],delete c[Ne],delete c[Me],delete c[Ce]}function Ge(c){var A=c[ie];if(A)return A;for(var h=c.parentNode;h;){if(A=h[Ae]||h[ie]){if(h=A.alternate,A.child!==null||h!==null&&h.child!==null)for(c=d_(c);c!==null;){if(h=c[ie])return h;c=d_(c)}return A}c=h,h=c.parentNode}return null}function Je(c){if(c=c[ie]||c[Ae]){var A=c.tag;if(A===5||A===6||A===13||A===31||A===26||A===27||A===3)return c}return null}function ze(c){var A=c.tag;if(A===5||A===26||A===27||A===6)return c.stateNode;throw Error(a(33))}function Ye(c){var A=c[Ee];return A||(A=c[Ee]={hoistableStyles:new Map,hoistableScripts:new Map}),A}function it(c){c[Se]=!0}var yr=new Set,wr={};function Ur(c,A){Vs(c,A),Vs(c+"Capture",A)}function Vs(c,A){for(wr[c]=A,c=0;c<A.length;c++)yr.add(A[c])}var Wc=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Lo={},tl={};function s0(c){return At.call(tl,c)?!0:At.call(Lo,c)?!1:Wc.test(c)?tl[c]=!0:(Lo[c]=!0,!1)}function Zn(c,A,h){if(s0(A))if(h===null)c.removeAttribute(A);else{switch(typeof h){case"undefined":case"function":case"symbol":c.removeAttribute(A);return;case"boolean":var g=A.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){c.removeAttribute(A);return}}c.setAttribute(A,""+h)}}function ih(c,A,h){if(h===null)c.removeAttribute(A);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(A);return}c.setAttribute(A,""+h)}}function Ul(c,A,h,g){if(g===null)c.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(h);return}c.setAttributeNS(A,h,""+g)}}function Gs(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function qE(c){var A=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(A==="checkbox"||A==="radio")}function Cz(c,A,h){var g=Object.getOwnPropertyDescriptor(c.constructor.prototype,A);if(!c.hasOwnProperty(A)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,F=g.set;return Object.defineProperty(c,A,{configurable:!0,get:function(){return S.call(this)},set:function(V){h=""+V,F.call(this,V)}}),Object.defineProperty(c,A,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(V){h=""+V},stopTracking:function(){c._valueTracker=null,delete c[A]}}}}function Cv(c){if(!c._valueTracker){var A=qE(c)?"checked":"value";c._valueTracker=Cz(c,A,""+c[A])}}function WE(c){if(!c)return!1;var A=c._valueTracker;if(!A)return!0;var h=A.getValue(),g="";return c&&(g=qE(c)?c.checked?"true":"false":c.value),c=g,c!==h?(A.setValue(c),!0):!1}function lh(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var kz=/[\n"\\]/g;function Ks(c){return c.replace(kz,function(A){return"\\"+A.charCodeAt(0).toString(16)+" "})}function kv(c,A,h,g,S,F,V,re){c.name="",V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?c.type=V:c.removeAttribute("type"),A!=null?V==="number"?(A===0&&c.value===""||c.value!=A)&&(c.value=""+Gs(A)):c.value!==""+Gs(A)&&(c.value=""+Gs(A)):V!=="submit"&&V!=="reset"||c.removeAttribute("value"),A!=null?jv(c,V,Gs(A)):h!=null?jv(c,V,Gs(h)):g!=null&&c.removeAttribute("value"),S==null&&F!=null&&(c.defaultChecked=!!F),S!=null&&(c.checked=S&&typeof S!="function"&&typeof S!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?c.name=""+Gs(re):c.removeAttribute("name")}function YE(c,A,h,g,S,F,V,re){if(F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(c.type=F),A!=null||h!=null){if(!(F!=="submit"&&F!=="reset"||A!=null)){Cv(c);return}h=h!=null?""+Gs(h):"",A=A!=null?""+Gs(A):h,re||A===c.value||(c.value=A),c.defaultValue=A}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,c.checked=re?c.checked:!!g,c.defaultChecked=!!g,V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"&&(c.name=V),Cv(c)}function jv(c,A,h){A==="number"&&lh(c.ownerDocument)===c||c.defaultValue===""+h||(c.defaultValue=""+h)}function du(c,A,h,g){if(c=c.options,A){A={};for(var S=0;S<h.length;S++)A["$"+h[S]]=!0;for(h=0;h<c.length;h++)S=A.hasOwnProperty("$"+c[h].value),c[h].selected!==S&&(c[h].selected=S),S&&g&&(c[h].defaultSelected=!0)}else{for(h=""+Gs(h),A=null,S=0;S<c.length;S++){if(c[S].value===h){c[S].selected=!0,g&&(c[S].defaultSelected=!0);return}A!==null||c[S].disabled||(A=c[S])}A!==null&&(A.selected=!0)}}function XE(c,A,h){if(A!=null&&(A=""+Gs(A),A!==c.value&&(c.value=A),h==null)){c.defaultValue!==A&&(c.defaultValue=A);return}c.defaultValue=h!=null?""+Gs(h):""}function JE(c,A,h,g){if(A==null){if(g!=null){if(h!=null)throw Error(a(92));if(K(g)){if(1<g.length)throw Error(a(93));g=g[0]}h=g}h==null&&(h=""),A=h}h=Gs(A),c.defaultValue=h,g=c.textContent,g===h&&g!==""&&g!==null&&(c.value=g),Cv(c)}function uu(c,A){if(A){var h=c.firstChild;if(h&&h===c.lastChild&&h.nodeType===3){h.nodeValue=A;return}}c.textContent=A}var jz=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 ZE(c,A,h){var g=A.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?c.setProperty(A,""):A==="float"?c.cssFloat="":c[A]="":g?c.setProperty(A,h):typeof h!="number"||h===0||jz.has(A)?A==="float"?c.cssFloat=h:c[A]=(""+h).trim():c[A]=h+"px"}function eS(c,A,h){if(A!=null&&typeof A!="object")throw Error(a(62));if(c=c.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||A!=null&&A.hasOwnProperty(g)||(g.indexOf("--")===0?c.setProperty(g,""):g==="float"?c.cssFloat="":c[g]="");for(var S in A)g=A[S],A.hasOwnProperty(S)&&h[S]!==g&&ZE(c,S,g)}else for(var F in A)A.hasOwnProperty(F)&&ZE(c,F,A[F])}function Ev(c){if(c.indexOf("-")===-1)return!1;switch(c){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 Ez=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"]]),Sz=/^[\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 oh(c){return Sz.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Ml(){}var Sv=null;function Bv(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var Au=null,fu=null;function tS(c){var A=Je(c);if(A&&(c=A.stateNode)){var h=c[ue]||null;e:switch(c=A.stateNode,A.type){case"input":if(kv(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),A=h.name,h.type==="radio"&&A!=null){for(h=c;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Ks(""+A)+'"][type="radio"]'),A=0;A<h.length;A++){var g=h[A];if(g!==c&&g.form===c.form){var S=g[ue]||null;if(!S)throw Error(a(90));kv(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(A=0;A<h.length;A++)g=h[A],g.form===c.form&&WE(g)}break e;case"textarea":XE(c,h.value,h.defaultValue);break e;case"select":A=h.value,A!=null&&du(c,!!h.multiple,A,!1)}}}var _v=!1;function rS(c,A,h){if(_v)return c(A,h);_v=!0;try{var g=c(A);return g}finally{if(_v=!1,(Au!==null||fu!==null)&&(Wh(),Au&&(A=Au,c=fu,fu=Au=null,tS(A),c)))for(A=0;A<c.length;A++)tS(c[A])}}function i0(c,A){var h=c.stateNode;if(h===null)return null;var g=h[ue]||null;if(g===null)return null;h=g[A];e:switch(A){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(c=c.type,g=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!g;break e;default:c=!1}if(c)return null;if(h&&typeof h!="function")throw Error(a(231,A,typeof h));return h}var Rl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tv=!1;if(Rl)try{var l0={};Object.defineProperty(l0,"passive",{get:function(){Tv=!0}}),window.addEventListener("test",l0,l0),window.removeEventListener("test",l0,l0)}catch{Tv=!1}var Qo=null,Fv=null,ch=null;function aS(){if(ch)return ch;var c,A=Fv,h=A.length,g,S="value"in Qo?Qo.value:Qo.textContent,F=S.length;for(c=0;c<h&&A[c]===S[c];c++);var V=h-c;for(g=1;g<=V&&A[h-g]===S[F-g];g++);return ch=S.slice(c,1<g?1-g:void 0)}function dh(c){var A=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&A===13&&(c=13)):c=A,c===10&&(c=13),32<=c||c===13?c:0}function uh(){return!0}function nS(){return!1}function es(c){function A(h,g,S,F,V){this._reactName=h,this._targetInst=S,this.type=g,this.nativeEvent=F,this.target=V,this.currentTarget=null;for(var re in c)c.hasOwnProperty(re)&&(h=c[re],this[re]=h?h(F):F[re]);return this.isDefaultPrevented=(F.defaultPrevented!=null?F.defaultPrevented:F.returnValue===!1)?uh:nS,this.isPropagationStopped=nS,this}return p(A.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=uh)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=uh)},persist:function(){},isPersistent:uh}),A}var Yc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ah=es(Yc),o0=p({},Yc,{view:0,detail:0}),Bz=es(o0),Iv,Dv,c0,fh=p({},o0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mv,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==c0&&(c0&&c.type==="mousemove"?(Iv=c.screenX-c0.screenX,Dv=c.screenY-c0.screenY):Dv=Iv=0,c0=c),Iv)},movementY:function(c){return"movementY"in c?c.movementY:Dv}}),sS=es(fh),_z=p({},fh,{dataTransfer:0}),Tz=es(_z),Fz=p({},o0,{relatedTarget:0}),Uv=es(Fz),Iz=p({},Yc,{animationName:0,elapsedTime:0,pseudoElement:0}),Dz=es(Iz),Uz=p({},Yc,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Mz=es(Uz),Rz=p({},Yc,{data:0}),iS=es(Rz),Oz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pz={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Lz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qz(c){var A=this.nativeEvent;return A.getModifierState?A.getModifierState(c):(c=Lz[c])?!!A[c]:!1}function Mv(){return Qz}var Hz=p({},o0,{key:function(c){if(c.key){var A=Oz[c.key]||c.key;if(A!=="Unidentified")return A}return c.type==="keypress"?(c=dh(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?Pz[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mv,charCode:function(c){return c.type==="keypress"?dh(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?dh(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),zz=es(Hz),$z=p({},fh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lS=es($z),Vz=p({},o0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mv}),Gz=es(Vz),Kz=p({},Yc,{propertyName:0,elapsedTime:0,pseudoElement:0}),qz=es(Kz),Wz=p({},fh,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),Yz=es(Wz),Xz=p({},Yc,{newState:0,oldState:0}),Jz=es(Xz),Zz=[9,13,27,32],Rv=Rl&&"CompositionEvent"in window,d0=null;Rl&&"documentMode"in document&&(d0=document.documentMode);var e$=Rl&&"TextEvent"in window&&!d0,oS=Rl&&(!Rv||d0&&8<d0&&11>=d0),cS=" ",dS=!1;function uS(c,A){switch(c){case"keyup":return Zz.indexOf(A.keyCode)!==-1;case"keydown":return A.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function AS(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var pu=!1;function t$(c,A){switch(c){case"compositionend":return AS(A);case"keypress":return A.which!==32?null:(dS=!0,cS);case"textInput":return c=A.data,c===cS&&dS?null:c;default:return null}}function r$(c,A){if(pu)return c==="compositionend"||!Rv&&uS(c,A)?(c=aS(),ch=Fv=Qo=null,pu=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(A.ctrlKey||A.altKey||A.metaKey)||A.ctrlKey&&A.altKey){if(A.char&&1<A.char.length)return A.char;if(A.which)return String.fromCharCode(A.which)}return null;case"compositionend":return oS&&A.locale!=="ko"?null:A.data;default:return null}}var a$={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 fS(c){var A=c&&c.nodeName&&c.nodeName.toLowerCase();return A==="input"?!!a$[c.type]:A==="textarea"}function pS(c,A,h,g){Au?fu?fu.push(g):fu=[g]:Au=g,A=rx(A,"onChange"),0<A.length&&(h=new Ah("onChange","change",null,h,g),c.push({event:h,listeners:A}))}var u0=null,A0=null;function n$(c){Y4(c,0)}function ph(c){var A=ze(c);if(WE(A))return c}function hS(c,A){if(c==="change")return A}var xS=!1;if(Rl){var Ov;if(Rl){var Pv="oninput"in document;if(!Pv){var mS=document.createElement("div");mS.setAttribute("oninput","return;"),Pv=typeof mS.oninput=="function"}Ov=Pv}else Ov=!1;xS=Ov&&(!document.documentMode||9<document.documentMode)}function gS(){u0&&(u0.detachEvent("onpropertychange",bS),A0=u0=null)}function bS(c){if(c.propertyName==="value"&&ph(A0)){var A=[];pS(A,A0,c,Bv(c)),rS(n$,A)}}function s$(c,A,h){c==="focusin"?(gS(),u0=A,A0=h,u0.attachEvent("onpropertychange",bS)):c==="focusout"&&gS()}function i$(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return ph(A0)}function l$(c,A){if(c==="click")return ph(A)}function o$(c,A){if(c==="input"||c==="change")return ph(A)}function c$(c,A){return c===A&&(c!==0||1/c===1/A)||c!==c&&A!==A}var vs=typeof Object.is=="function"?Object.is:c$;function f0(c,A){if(vs(c,A))return!0;if(typeof c!="object"||c===null||typeof A!="object"||A===null)return!1;var h=Object.keys(c),g=Object.keys(A);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var S=h[g];if(!At.call(A,S)||!vs(c[S],A[S]))return!1}return!0}function vS(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function yS(c,A){var h=vS(c);c=0;for(var g;h;){if(h.nodeType===3){if(g=c+h.textContent.length,c<=A&&g>=A)return{node:h,offset:A-c};c=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=vS(h)}}function wS(c,A){return c&&A?c===A?!0:c&&c.nodeType===3?!1:A&&A.nodeType===3?wS(c,A.parentNode):"contains"in c?c.contains(A):c.compareDocumentPosition?!!(c.compareDocumentPosition(A)&16):!1:!1}function NS(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var A=lh(c.document);A instanceof c.HTMLIFrameElement;){try{var h=typeof A.contentWindow.location.href=="string"}catch{h=!1}if(h)c=A.contentWindow;else break;A=lh(c.document)}return A}function Lv(c){var A=c&&c.nodeName&&c.nodeName.toLowerCase();return A&&(A==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||A==="textarea"||c.contentEditable==="true")}var d$=Rl&&"documentMode"in document&&11>=document.documentMode,hu=null,Qv=null,p0=null,Hv=!1;function CS(c,A,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Hv||hu==null||hu!==lh(g)||(g=hu,"selectionStart"in g&&Lv(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),p0&&f0(p0,g)||(p0=g,g=rx(Qv,"onSelect"),0<g.length&&(A=new Ah("onSelect","select",null,A,h),c.push({event:A,listeners:g}),A.target=hu)))}function Xc(c,A){var h={};return h[c.toLowerCase()]=A.toLowerCase(),h["Webkit"+c]="webkit"+A,h["Moz"+c]="moz"+A,h}var xu={animationend:Xc("Animation","AnimationEnd"),animationiteration:Xc("Animation","AnimationIteration"),animationstart:Xc("Animation","AnimationStart"),transitionrun:Xc("Transition","TransitionRun"),transitionstart:Xc("Transition","TransitionStart"),transitioncancel:Xc("Transition","TransitionCancel"),transitionend:Xc("Transition","TransitionEnd")},zv={},kS={};Rl&&(kS=document.createElement("div").style,"AnimationEvent"in window||(delete xu.animationend.animation,delete xu.animationiteration.animation,delete xu.animationstart.animation),"TransitionEvent"in window||delete xu.transitionend.transition);function Jc(c){if(zv[c])return zv[c];if(!xu[c])return c;var A=xu[c],h;for(h in A)if(A.hasOwnProperty(h)&&h in kS)return zv[c]=A[h];return c}var jS=Jc("animationend"),ES=Jc("animationiteration"),SS=Jc("animationstart"),u$=Jc("transitionrun"),A$=Jc("transitionstart"),f$=Jc("transitioncancel"),BS=Jc("transitionend"),_S=new Map,$v="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(" ");$v.push("scrollEnd");function Si(c,A){_S.set(c,A),Ur(A,[c])}var hh=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},qs=[],mu=0,Vv=0;function xh(){for(var c=mu,A=Vv=mu=0;A<c;){var h=qs[A];qs[A++]=null;var g=qs[A];qs[A++]=null;var S=qs[A];qs[A++]=null;var F=qs[A];if(qs[A++]=null,g!==null&&S!==null){var V=g.pending;V===null?S.next=S:(S.next=V.next,V.next=S),g.pending=S}F!==0&&TS(h,S,F)}}function mh(c,A,h,g){qs[mu++]=c,qs[mu++]=A,qs[mu++]=h,qs[mu++]=g,Vv|=g,c.lanes|=g,c=c.alternate,c!==null&&(c.lanes|=g)}function Gv(c,A,h,g){return mh(c,A,h,g),gh(c)}function Zc(c,A){return mh(c,null,null,A),gh(c)}function TS(c,A,h){c.lanes|=h;var g=c.alternate;g!==null&&(g.lanes|=h);for(var S=!1,F=c.return;F!==null;)F.childLanes|=h,g=F.alternate,g!==null&&(g.childLanes|=h),F.tag===22&&(c=F.stateNode,c===null||c._visibility&1||(S=!0)),c=F,F=F.return;return c.tag===3?(F=c.stateNode,S&&A!==null&&(S=31-zr(h),c=F.hiddenUpdates,g=c[S],g===null?c[S]=[A]:g.push(A),A.lane=h|536870912),F):null}function gh(c){if(50<M0)throw M0=0,ty=null,Error(a(185));for(var A=c.return;A!==null;)c=A,A=c.return;return c.tag===3?c.stateNode:null}var gu={};function p$(c,A,h,g){this.tag=c,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=A,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ys(c,A,h,g){return new p$(c,A,h,g)}function Kv(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Ol(c,A){var h=c.alternate;return h===null?(h=ys(c.tag,A,c.key,c.mode),h.elementType=c.elementType,h.type=c.type,h.stateNode=c.stateNode,h.alternate=c,c.alternate=h):(h.pendingProps=A,h.type=c.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=c.flags&65011712,h.childLanes=c.childLanes,h.lanes=c.lanes,h.child=c.child,h.memoizedProps=c.memoizedProps,h.memoizedState=c.memoizedState,h.updateQueue=c.updateQueue,A=c.dependencies,h.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext},h.sibling=c.sibling,h.index=c.index,h.ref=c.ref,h.refCleanup=c.refCleanup,h}function FS(c,A){c.flags&=65011714;var h=c.alternate;return h===null?(c.childLanes=0,c.lanes=A,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=h.childLanes,c.lanes=h.lanes,c.child=h.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=h.memoizedProps,c.memoizedState=h.memoizedState,c.updateQueue=h.updateQueue,c.type=h.type,A=h.dependencies,c.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),c}function bh(c,A,h,g,S,F){var V=0;if(g=c,typeof c=="function")Kv(c)&&(V=1);else if(typeof c=="string")V=b7(c,h,H.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case U:return c=ys(31,h,A,S),c.elementType=U,c.lanes=F,c;case v:return ed(h.children,S,F,A);case y:V=8,S|=24;break;case k:return c=ys(12,h,A,S|2),c.elementType=k,c.lanes=F,c;case T:return c=ys(13,h,A,S),c.elementType=T,c.lanes=F,c;case B:return c=ys(19,h,A,S),c.elementType=B,c.lanes=F,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case C:V=10;break e;case _:V=9;break e;case E:V=11;break e;case I:V=14;break e;case M:V=16,g=null;break e}V=29,h=Error(a(130,c===null?"null":typeof c,"")),g=null}return A=ys(V,h,A,S),A.elementType=c,A.type=g,A.lanes=F,A}function ed(c,A,h,g){return c=ys(7,c,g,A),c.lanes=h,c}function qv(c,A,h){return c=ys(6,c,null,A),c.lanes=h,c}function IS(c){var A=ys(18,null,null,0);return A.stateNode=c,A}function Wv(c,A,h){return A=ys(4,c.children!==null?c.children:[],c.key,A),A.lanes=h,A.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},A}var DS=new WeakMap;function Ws(c,A){if(typeof c=="object"&&c!==null){var h=DS.get(c);return h!==void 0?h:(A={value:c,source:A,stack:Xe(A)},DS.set(c,A),A)}return{value:c,source:A,stack:Xe(A)}}var bu=[],vu=0,vh=null,h0=0,Ys=[],Xs=0,Ho=null,rl=1,al="";function Pl(c,A){bu[vu++]=h0,bu[vu++]=vh,vh=c,h0=A}function US(c,A,h){Ys[Xs++]=rl,Ys[Xs++]=al,Ys[Xs++]=Ho,Ho=c;var g=rl;c=al;var S=32-zr(g)-1;g&=~(1<<S),h+=1;var F=32-zr(A)+S;if(30<F){var V=S-S%5;F=(g&(1<<V)-1).toString(32),g>>=V,S-=V,rl=1<<32-zr(A)+S|h<<S|g,al=F+c}else rl=1<<F|h<<S|g,al=c}function Yv(c){c.return!==null&&(Pl(c,1),US(c,1,0))}function Xv(c){for(;c===vh;)vh=bu[--vu],bu[vu]=null,h0=bu[--vu],bu[vu]=null;for(;c===Ho;)Ho=Ys[--Xs],Ys[Xs]=null,al=Ys[--Xs],Ys[Xs]=null,rl=Ys[--Xs],Ys[Xs]=null}function MS(c,A){Ys[Xs++]=rl,Ys[Xs++]=al,Ys[Xs++]=Ho,rl=A.id,al=A.overflow,Ho=c}var ln=null,kr=null,$t=!1,zo=null,Js=!1,Jv=Error(a(519));function $o(c){var A=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw x0(Ws(A,c)),Jv}function RS(c){var A=c.stateNode,h=c.type,g=c.memoizedProps;switch(A[ie]=c,A[ue]=g,h){case"dialog":Rt("cancel",A),Rt("close",A);break;case"iframe":case"object":case"embed":Rt("load",A);break;case"video":case"audio":for(h=0;h<O0.length;h++)Rt(O0[h],A);break;case"source":Rt("error",A);break;case"img":case"image":case"link":Rt("error",A),Rt("load",A);break;case"details":Rt("toggle",A);break;case"input":Rt("invalid",A),YE(A,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Rt("invalid",A);break;case"textarea":Rt("invalid",A),JE(A,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||A.textContent===""+h||g.suppressHydrationWarning===!0||e_(A.textContent,h)?(g.popover!=null&&(Rt("beforetoggle",A),Rt("toggle",A)),g.onScroll!=null&&Rt("scroll",A),g.onScrollEnd!=null&&Rt("scrollend",A),g.onClick!=null&&(A.onclick=Ml),A=!0):A=!1,A||$o(c,!0)}function OS(c){for(ln=c.return;ln;)switch(ln.tag){case 5:case 31:case 13:Js=!1;return;case 27:case 3:Js=!0;return;default:ln=ln.return}}function yu(c){if(c!==ln)return!1;if(!$t)return OS(c),$t=!0,!1;var A=c.tag,h;if((h=A!==3&&A!==27)&&((h=A===5)&&(h=c.type,h=!(h!=="form"&&h!=="button")||xy(c.type,c.memoizedProps)),h=!h),h&&kr&&$o(c),OS(c),A===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));kr=c_(c)}else if(A===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));kr=c_(c)}else A===27?(A=kr,nc(c.type)?(c=yy,yy=null,kr=c):kr=A):kr=ln?ei(c.stateNode.nextSibling):null;return!0}function td(){kr=ln=null,$t=!1}function Zv(){var c=zo;return c!==null&&(ns===null?ns=c:ns.push.apply(ns,c),zo=null),c}function x0(c){zo===null?zo=[c]:zo.push(c)}var e1=O(null),rd=null,Ll=null;function Vo(c,A,h){q(e1,A._currentValue),A._currentValue=h}function Ql(c){c._currentValue=e1.current,P(e1)}function t1(c,A,h){for(;c!==null;){var g=c.alternate;if((c.childLanes&A)!==A?(c.childLanes|=A,g!==null&&(g.childLanes|=A)):g!==null&&(g.childLanes&A)!==A&&(g.childLanes|=A),c===h)break;c=c.return}}function r1(c,A,h,g){var S=c.child;for(S!==null&&(S.return=c);S!==null;){var F=S.dependencies;if(F!==null){var V=S.child;F=F.firstContext;e:for(;F!==null;){var re=F;F=S;for(var fe=0;fe<A.length;fe++)if(re.context===A[fe]){F.lanes|=h,re=F.alternate,re!==null&&(re.lanes|=h),t1(F.return,h,c),g||(V=null);break e}F=re.next}}else if(S.tag===18){if(V=S.return,V===null)throw Error(a(341));V.lanes|=h,F=V.alternate,F!==null&&(F.lanes|=h),t1(V,h,c),V=null}else V=S.child;if(V!==null)V.return=S;else for(V=S;V!==null;){if(V===c){V=null;break}if(S=V.sibling,S!==null){S.return=V.return,V=S;break}V=V.return}S=V}}function wu(c,A,h,g){c=null;for(var S=A,F=!1;S!==null;){if(!F){if((S.flags&524288)!==0)F=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var V=S.alternate;if(V===null)throw Error(a(387));if(V=V.memoizedProps,V!==null){var re=S.type;vs(S.pendingProps.value,V.value)||(c!==null?c.push(re):c=[re])}}else if(S===oe.current){if(V=S.alternate,V===null)throw Error(a(387));V.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(c!==null?c.push(z0):c=[z0])}S=S.return}c!==null&&r1(A,c,h,g),A.flags|=262144}function yh(c){for(c=c.firstContext;c!==null;){if(!vs(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function ad(c){rd=c,Ll=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function on(c){return PS(rd,c)}function wh(c,A){return rd===null&&ad(c),PS(c,A)}function PS(c,A){var h=A._currentValue;if(A={context:A,memoizedValue:h,next:null},Ll===null){if(c===null)throw Error(a(308));Ll=A,c.dependencies={lanes:0,firstContext:A},c.flags|=524288}else Ll=Ll.next=A;return h}var h$=typeof AbortController<"u"?AbortController:function(){var c=[],A=this.signal={aborted:!1,addEventListener:function(h,g){c.push(g)}};this.abort=function(){A.aborted=!0,c.forEach(function(h){return h()})}},x$=e.unstable_scheduleCallback,m$=e.unstable_NormalPriority,ma={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function a1(){return{controller:new h$,data:new Map,refCount:0}}function m0(c){c.refCount--,c.refCount===0&&x$(m$,function(){c.controller.abort()})}var g0=null,n1=0,Nu=0,Cu=null;function g$(c,A){if(g0===null){var h=g0=[];n1=0,Nu=ly(),Cu={status:"pending",value:void 0,then:function(g){h.push(g)}}}return n1++,A.then(LS,LS),A}function LS(){if(--n1===0&&g0!==null){Cu!==null&&(Cu.status="fulfilled");var c=g0;g0=null,Nu=0,Cu=null;for(var A=0;A<c.length;A++)(0,c[A])()}}function b$(c,A){var h=[],g={status:"pending",value:null,reason:null,then:function(S){h.push(S)}};return c.then(function(){g.status="fulfilled",g.value=A;for(var S=0;S<h.length;S++)(0,h[S])(A)},function(S){for(g.status="rejected",g.reason=S,S=0;S<h.length;S++)(0,h[S])(void 0)}),g}var QS=W.S;W.S=function(c,A){C4=_t(),typeof A=="object"&&A!==null&&typeof A.then=="function"&&g$(c,A),QS!==null&&QS(c,A)};var nd=O(null);function s1(){var c=nd.current;return c!==null?c:mr.pooledCache}function Nh(c,A){A===null?q(nd,nd.current):q(nd,A.pool)}function HS(){var c=s1();return c===null?null:{parent:ma._currentValue,pool:c}}var ku=Error(a(460)),i1=Error(a(474)),Ch=Error(a(542)),kh={then:function(){}};function zS(c){return c=c.status,c==="fulfilled"||c==="rejected"}function $S(c,A,h){switch(h=c[h],h===void 0?c.push(A):h!==A&&(A.then(Ml,Ml),A=h),A.status){case"fulfilled":return A.value;case"rejected":throw c=A.reason,GS(c),c;default:if(typeof A.status=="string")A.then(Ml,Ml);else{if(c=mr,c!==null&&100<c.shellSuspendCounter)throw Error(a(482));c=A,c.status="pending",c.then(function(g){if(A.status==="pending"){var S=A;S.status="fulfilled",S.value=g}},function(g){if(A.status==="pending"){var S=A;S.status="rejected",S.reason=g}})}switch(A.status){case"fulfilled":return A.value;case"rejected":throw c=A.reason,GS(c),c}throw id=A,ku}}function sd(c){try{var A=c._init;return A(c._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(id=h,ku):h}}var id=null;function VS(){if(id===null)throw Error(a(459));var c=id;return id=null,c}function GS(c){if(c===ku||c===Ch)throw Error(a(483))}var ju=null,b0=0;function jh(c){var A=b0;return b0+=1,ju===null&&(ju=[]),$S(ju,c,A)}function v0(c,A){A=A.props.ref,c.ref=A!==void 0?A:null}function Eh(c,A){throw A.$$typeof===x?Error(a(525)):(c=Object.prototype.toString.call(A),Error(a(31,c==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":c)))}function KS(c){function A(ve,he){if(c){var ke=ve.deletions;ke===null?(ve.deletions=[he],ve.flags|=16):ke.push(he)}}function h(ve,he){if(!c)return null;for(;he!==null;)A(ve,he),he=he.sibling;return null}function g(ve){for(var he=new Map;ve!==null;)ve.key!==null?he.set(ve.key,ve):he.set(ve.index,ve),ve=ve.sibling;return he}function S(ve,he){return ve=Ol(ve,he),ve.index=0,ve.sibling=null,ve}function F(ve,he,ke){return ve.index=ke,c?(ke=ve.alternate,ke!==null?(ke=ke.index,ke<he?(ve.flags|=67108866,he):ke):(ve.flags|=67108866,he)):(ve.flags|=1048576,he)}function V(ve){return c&&ve.alternate===null&&(ve.flags|=67108866),ve}function re(ve,he,ke,Pe){return he===null||he.tag!==6?(he=qv(ke,ve.mode,Pe),he.return=ve,he):(he=S(he,ke),he.return=ve,he)}function fe(ve,he,ke,Pe){var dt=ke.type;return dt===v?Oe(ve,he,ke.props.children,Pe,ke.key):he!==null&&(he.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===M&&sd(dt)===he.type)?(he=S(he,ke.props),v0(he,ke),he.return=ve,he):(he=bh(ke.type,ke.key,ke.props,null,ve.mode,Pe),v0(he,ke),he.return=ve,he)}function je(ve,he,ke,Pe){return he===null||he.tag!==4||he.stateNode.containerInfo!==ke.containerInfo||he.stateNode.implementation!==ke.implementation?(he=Wv(ke,ve.mode,Pe),he.return=ve,he):(he=S(he,ke.children||[]),he.return=ve,he)}function Oe(ve,he,ke,Pe,dt){return he===null||he.tag!==7?(he=ed(ke,ve.mode,Pe,dt),he.return=ve,he):(he=S(he,ke),he.return=ve,he)}function Le(ve,he,ke){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return he=qv(""+he,ve.mode,ke),he.return=ve,he;if(typeof he=="object"&&he!==null){switch(he.$$typeof){case m:return ke=bh(he.type,he.key,he.props,null,ve.mode,ke),v0(ke,he),ke.return=ve,ke;case b:return he=Wv(he,ve.mode,ke),he.return=ve,he;case M:return he=sd(he),Le(ve,he,ke)}if(K(he)||R(he))return he=ed(he,ve.mode,ke,null),he.return=ve,he;if(typeof he.then=="function")return Le(ve,jh(he),ke);if(he.$$typeof===C)return Le(ve,wh(ve,he),ke);Eh(ve,he)}return null}function Be(ve,he,ke,Pe){var dt=he!==null?he.key:null;if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return dt!==null?null:re(ve,he,""+ke,Pe);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:return ke.key===dt?fe(ve,he,ke,Pe):null;case b:return ke.key===dt?je(ve,he,ke,Pe):null;case M:return ke=sd(ke),Be(ve,he,ke,Pe)}if(K(ke)||R(ke))return dt!==null?null:Oe(ve,he,ke,Pe,null);if(typeof ke.then=="function")return Be(ve,he,jh(ke),Pe);if(ke.$$typeof===C)return Be(ve,he,wh(ve,ke),Pe);Eh(ve,ke)}return null}function Fe(ve,he,ke,Pe,dt){if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number"||typeof Pe=="bigint")return ve=ve.get(ke)||null,re(he,ve,""+Pe,dt);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case m:return ve=ve.get(Pe.key===null?ke:Pe.key)||null,fe(he,ve,Pe,dt);case b:return ve=ve.get(Pe.key===null?ke:Pe.key)||null,je(he,ve,Pe,dt);case M:return Pe=sd(Pe),Fe(ve,he,ke,Pe,dt)}if(K(Pe)||R(Pe))return ve=ve.get(ke)||null,Oe(he,ve,Pe,dt,null);if(typeof Pe.then=="function")return Fe(ve,he,ke,jh(Pe),dt);if(Pe.$$typeof===C)return Fe(ve,he,ke,wh(he,Pe),dt);Eh(he,Pe)}return null}function st(ve,he,ke,Pe){for(var dt=null,qt=null,lt=he,Ft=he=0,Pt=null;lt!==null&&Ft<ke.length;Ft++){lt.index>Ft?(Pt=lt,lt=null):Pt=lt.sibling;var Wt=Be(ve,lt,ke[Ft],Pe);if(Wt===null){lt===null&&(lt=Pt);break}c&&lt&&Wt.alternate===null&&A(ve,lt),he=F(Wt,he,Ft),qt===null?dt=Wt:qt.sibling=Wt,qt=Wt,lt=Pt}if(Ft===ke.length)return h(ve,lt),$t&&Pl(ve,Ft),dt;if(lt===null){for(;Ft<ke.length;Ft++)lt=Le(ve,ke[Ft],Pe),lt!==null&&(he=F(lt,he,Ft),qt===null?dt=lt:qt.sibling=lt,qt=lt);return $t&&Pl(ve,Ft),dt}for(lt=g(lt);Ft<ke.length;Ft++)Pt=Fe(lt,ve,Ft,ke[Ft],Pe),Pt!==null&&(c&&Pt.alternate!==null&&lt.delete(Pt.key===null?Ft:Pt.key),he=F(Pt,he,Ft),qt===null?dt=Pt:qt.sibling=Pt,qt=Pt);return c&&lt.forEach(function(cc){return A(ve,cc)}),$t&&Pl(ve,Ft),dt}function mt(ve,he,ke,Pe){if(ke==null)throw Error(a(151));for(var dt=null,qt=null,lt=he,Ft=he=0,Pt=null,Wt=ke.next();lt!==null&&!Wt.done;Ft++,Wt=ke.next()){lt.index>Ft?(Pt=lt,lt=null):Pt=lt.sibling;var cc=Be(ve,lt,Wt.value,Pe);if(cc===null){lt===null&&(lt=Pt);break}c&&lt&&cc.alternate===null&&A(ve,lt),he=F(cc,he,Ft),qt===null?dt=cc:qt.sibling=cc,qt=cc,lt=Pt}if(Wt.done)return h(ve,lt),$t&&Pl(ve,Ft),dt;if(lt===null){for(;!Wt.done;Ft++,Wt=ke.next())Wt=Le(ve,Wt.value,Pe),Wt!==null&&(he=F(Wt,he,Ft),qt===null?dt=Wt:qt.sibling=Wt,qt=Wt);return $t&&Pl(ve,Ft),dt}for(lt=g(lt);!Wt.done;Ft++,Wt=ke.next())Wt=Fe(lt,ve,Ft,Wt.value,Pe),Wt!==null&&(c&&Wt.alternate!==null&&lt.delete(Wt.key===null?Ft:Wt.key),he=F(Wt,he,Ft),qt===null?dt=Wt:qt.sibling=Wt,qt=Wt);return c&&lt.forEach(function(_7){return A(ve,_7)}),$t&&Pl(ve,Ft),dt}function fr(ve,he,ke,Pe){if(typeof ke=="object"&&ke!==null&&ke.type===v&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var dt=ke.key;he!==null;){if(he.key===dt){if(dt=ke.type,dt===v){if(he.tag===7){h(ve,he.sibling),Pe=S(he,ke.props.children),Pe.return=ve,ve=Pe;break e}}else if(he.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===M&&sd(dt)===he.type){h(ve,he.sibling),Pe=S(he,ke.props),v0(Pe,ke),Pe.return=ve,ve=Pe;break e}h(ve,he);break}else A(ve,he);he=he.sibling}ke.type===v?(Pe=ed(ke.props.children,ve.mode,Pe,ke.key),Pe.return=ve,ve=Pe):(Pe=bh(ke.type,ke.key,ke.props,null,ve.mode,Pe),v0(Pe,ke),Pe.return=ve,ve=Pe)}return V(ve);case b:e:{for(dt=ke.key;he!==null;){if(he.key===dt)if(he.tag===4&&he.stateNode.containerInfo===ke.containerInfo&&he.stateNode.implementation===ke.implementation){h(ve,he.sibling),Pe=S(he,ke.children||[]),Pe.return=ve,ve=Pe;break e}else{h(ve,he);break}else A(ve,he);he=he.sibling}Pe=Wv(ke,ve.mode,Pe),Pe.return=ve,ve=Pe}return V(ve);case M:return ke=sd(ke),fr(ve,he,ke,Pe)}if(K(ke))return st(ve,he,ke,Pe);if(R(ke)){if(dt=R(ke),typeof dt!="function")throw Error(a(150));return ke=dt.call(ke),mt(ve,he,ke,Pe)}if(typeof ke.then=="function")return fr(ve,he,jh(ke),Pe);if(ke.$$typeof===C)return fr(ve,he,wh(ve,ke),Pe);Eh(ve,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,he!==null&&he.tag===6?(h(ve,he.sibling),Pe=S(he,ke),Pe.return=ve,ve=Pe):(h(ve,he),Pe=qv(ke,ve.mode,Pe),Pe.return=ve,ve=Pe),V(ve)):h(ve,he)}return function(ve,he,ke,Pe){try{b0=0;var dt=fr(ve,he,ke,Pe);return ju=null,dt}catch(lt){if(lt===ku||lt===Ch)throw lt;var qt=ys(29,lt,null,ve.mode);return qt.lanes=Pe,qt.return=ve,qt}finally{}}}var ld=KS(!0),qS=KS(!1),Go=!1;function l1(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function o1(c,A){c=c.updateQueue,A.updateQueue===c&&(A.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function Ko(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function qo(c,A,h){var g=c.updateQueue;if(g===null)return null;if(g=g.shared,(tr&2)!==0){var S=g.pending;return S===null?A.next=A:(A.next=S.next,S.next=A),g.pending=A,A=gh(c),TS(c,null,h),A}return mh(c,g,A,h),gh(c)}function y0(c,A,h){if(A=A.updateQueue,A!==null&&(A=A.shared,(h&4194048)!==0)){var g=A.lanes;g&=c.pendingLanes,h|=g,A.lanes=h,Ia(c,h)}}function c1(c,A){var h=c.updateQueue,g=c.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var S=null,F=null;if(h=h.firstBaseUpdate,h!==null){do{var V={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};F===null?S=F=V:F=F.next=V,h=h.next}while(h!==null);F===null?S=F=A:F=F.next=A}else S=F=A;h={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:F,shared:g.shared,callbacks:g.callbacks},c.updateQueue=h;return}c=h.lastBaseUpdate,c===null?h.firstBaseUpdate=A:c.next=A,h.lastBaseUpdate=A}var d1=!1;function w0(){if(d1){var c=Cu;if(c!==null)throw c}}function N0(c,A,h,g){d1=!1;var S=c.updateQueue;Go=!1;var F=S.firstBaseUpdate,V=S.lastBaseUpdate,re=S.shared.pending;if(re!==null){S.shared.pending=null;var fe=re,je=fe.next;fe.next=null,V===null?F=je:V.next=je,V=fe;var Oe=c.alternate;Oe!==null&&(Oe=Oe.updateQueue,re=Oe.lastBaseUpdate,re!==V&&(re===null?Oe.firstBaseUpdate=je:re.next=je,Oe.lastBaseUpdate=fe))}if(F!==null){var Le=S.baseState;V=0,Oe=je=fe=null,re=F;do{var Be=re.lane&-536870913,Fe=Be!==re.lane;if(Fe?(Ot&Be)===Be:(g&Be)===Be){Be!==0&&Be===Nu&&(d1=!0),Oe!==null&&(Oe=Oe.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var st=c,mt=re;Be=A;var fr=h;switch(mt.tag){case 1:if(st=mt.payload,typeof st=="function"){Le=st.call(fr,Le,Be);break e}Le=st;break e;case 3:st.flags=st.flags&-65537|128;case 0:if(st=mt.payload,Be=typeof st=="function"?st.call(fr,Le,Be):st,Be==null)break e;Le=p({},Le,Be);break e;case 2:Go=!0}}Be=re.callback,Be!==null&&(c.flags|=64,Fe&&(c.flags|=8192),Fe=S.callbacks,Fe===null?S.callbacks=[Be]:Fe.push(Be))}else Fe={lane:Be,tag:re.tag,payload:re.payload,callback:re.callback,next:null},Oe===null?(je=Oe=Fe,fe=Le):Oe=Oe.next=Fe,V|=Be;if(re=re.next,re===null){if(re=S.shared.pending,re===null)break;Fe=re,re=Fe.next,Fe.next=null,S.lastBaseUpdate=Fe,S.shared.pending=null}}while(!0);Oe===null&&(fe=Le),S.baseState=fe,S.firstBaseUpdate=je,S.lastBaseUpdate=Oe,F===null&&(S.shared.lanes=0),Zo|=V,c.lanes=V,c.memoizedState=Le}}function WS(c,A){if(typeof c!="function")throw Error(a(191,c));c.call(A)}function YS(c,A){var h=c.callbacks;if(h!==null)for(c.callbacks=null,c=0;c<h.length;c++)WS(h[c],A)}var Eu=O(null),Sh=O(0);function XS(c,A){c=Yl,q(Sh,c),q(Eu,A),Yl=c|A.baseLanes}function u1(){q(Sh,Yl),q(Eu,Eu.current)}function A1(){Yl=Sh.current,P(Eu),P(Sh)}var ws=O(null),Zs=null;function Wo(c){var A=c.alternate;q(ca,ca.current&1),q(ws,c),Zs===null&&(A===null||Eu.current!==null||A.memoizedState!==null)&&(Zs=c)}function f1(c){q(ca,ca.current),q(ws,c),Zs===null&&(Zs=c)}function JS(c){c.tag===22?(q(ca,ca.current),q(ws,c),Zs===null&&(Zs=c)):Yo()}function Yo(){q(ca,ca.current),q(ws,ws.current)}function Ns(c){P(ws),Zs===c&&(Zs=null),P(ca)}var ca=O(0);function Bh(c){for(var A=c;A!==null;){if(A.tag===13){var h=A.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||by(h)||vy(h)))return A}else if(A.tag===19&&(A.memoizedProps.revealOrder==="forwards"||A.memoizedProps.revealOrder==="backwards"||A.memoizedProps.revealOrder==="unstable_legacy-backwards"||A.memoizedProps.revealOrder==="together")){if((A.flags&128)!==0)return A}else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return null;A=A.return}A.sibling.return=A.return,A=A.sibling}return null}var Hl=0,Et=null,ur=null,ga=null,_h=!1,Su=!1,od=!1,Th=0,C0=0,Bu=null,v$=0;function Xr(){throw Error(a(321))}function p1(c,A){if(A===null)return!1;for(var h=0;h<A.length&&h<c.length;h++)if(!vs(c[h],A[h]))return!1;return!0}function h1(c,A,h,g,S,F){return Hl=F,Et=A,A.memoizedState=null,A.updateQueue=null,A.lanes=0,W.H=c===null||c.memoizedState===null?UB:_1,od=!1,F=h(g,S),od=!1,Su&&(F=eB(A,h,g,S)),ZS(c),F}function ZS(c){W.H=E0;var A=ur!==null&&ur.next!==null;if(Hl=0,ga=ur=Et=null,_h=!1,C0=0,Bu=null,A)throw Error(a(300));c===null||ba||(c=c.dependencies,c!==null&&yh(c)&&(ba=!0))}function eB(c,A,h,g){Et=c;var S=0;do{if(Su&&(Bu=null),C0=0,Su=!1,25<=S)throw Error(a(301));if(S+=1,ga=ur=null,c.updateQueue!=null){var F=c.updateQueue;F.lastEffect=null,F.events=null,F.stores=null,F.memoCache!=null&&(F.memoCache.index=0)}W.H=MB,F=A(h,g)}while(Su);return F}function y$(){var c=W.H,A=c.useState()[0];return A=typeof A.then=="function"?k0(A):A,c=c.useState()[0],(ur!==null?ur.memoizedState:null)!==c&&(Et.flags|=1024),A}function x1(){var c=Th!==0;return Th=0,c}function m1(c,A,h){A.updateQueue=c.updateQueue,A.flags&=-2053,c.lanes&=~h}function g1(c){if(_h){for(c=c.memoizedState;c!==null;){var A=c.queue;A!==null&&(A.pending=null),c=c.next}_h=!1}Hl=0,ga=ur=Et=null,Su=!1,C0=Th=0,Bu=null}function Ln(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ga===null?Et.memoizedState=ga=c:ga=ga.next=c,ga}function da(){if(ur===null){var c=Et.alternate;c=c!==null?c.memoizedState:null}else c=ur.next;var A=ga===null?Et.memoizedState:ga.next;if(A!==null)ga=A,ur=c;else{if(c===null)throw Et.alternate===null?Error(a(467)):Error(a(310));ur=c,c={memoizedState:ur.memoizedState,baseState:ur.baseState,baseQueue:ur.baseQueue,queue:ur.queue,next:null},ga===null?Et.memoizedState=ga=c:ga=ga.next=c}return ga}function Fh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function k0(c){var A=C0;return C0+=1,Bu===null&&(Bu=[]),c=$S(Bu,c,A),A=Et,(ga===null?A.memoizedState:ga.next)===null&&(A=A.alternate,W.H=A===null||A.memoizedState===null?UB:_1),c}function Ih(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return k0(c);if(c.$$typeof===C)return on(c)}throw Error(a(438,String(c)))}function b1(c){var A=null,h=Et.updateQueue;if(h!==null&&(A=h.memoCache),A==null){var g=Et.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(A={data:g.data.map(function(S){return S.slice()}),index:0})))}if(A==null&&(A={data:[],index:0}),h===null&&(h=Fh(),Et.updateQueue=h),h.memoCache=A,h=A.data[A.index],h===void 0)for(h=A.data[A.index]=Array(c),g=0;g<c;g++)h[g]=D;return A.index++,h}function zl(c,A){return typeof A=="function"?A(c):A}function Dh(c){var A=da();return v1(A,ur,c)}function v1(c,A,h){var g=c.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=h;var S=c.baseQueue,F=g.pending;if(F!==null){if(S!==null){var V=S.next;S.next=F.next,F.next=V}A.baseQueue=S=F,g.pending=null}if(F=c.baseState,S===null)c.memoizedState=F;else{A=S.next;var re=V=null,fe=null,je=A,Oe=!1;do{var Le=je.lane&-536870913;if(Le!==je.lane?(Ot&Le)===Le:(Hl&Le)===Le){var Be=je.revertLane;if(Be===0)fe!==null&&(fe=fe.next={lane:0,revertLane:0,gesture:null,action:je.action,hasEagerState:je.hasEagerState,eagerState:je.eagerState,next:null}),Le===Nu&&(Oe=!0);else if((Hl&Be)===Be){je=je.next,Be===Nu&&(Oe=!0);continue}else Le={lane:0,revertLane:je.revertLane,gesture:null,action:je.action,hasEagerState:je.hasEagerState,eagerState:je.eagerState,next:null},fe===null?(re=fe=Le,V=F):fe=fe.next=Le,Et.lanes|=Be,Zo|=Be;Le=je.action,od&&h(F,Le),F=je.hasEagerState?je.eagerState:h(F,Le)}else Be={lane:Le,revertLane:je.revertLane,gesture:je.gesture,action:je.action,hasEagerState:je.hasEagerState,eagerState:je.eagerState,next:null},fe===null?(re=fe=Be,V=F):fe=fe.next=Be,Et.lanes|=Le,Zo|=Le;je=je.next}while(je!==null&&je!==A);if(fe===null?V=F:fe.next=re,!vs(F,c.memoizedState)&&(ba=!0,Oe&&(h=Cu,h!==null)))throw h;c.memoizedState=F,c.baseState=V,c.baseQueue=fe,g.lastRenderedState=F}return S===null&&(g.lanes=0),[c.memoizedState,g.dispatch]}function y1(c){var A=da(),h=A.queue;if(h===null)throw Error(a(311));h.lastRenderedReducer=c;var g=h.dispatch,S=h.pending,F=A.memoizedState;if(S!==null){h.pending=null;var V=S=S.next;do F=c(F,V.action),V=V.next;while(V!==S);vs(F,A.memoizedState)||(ba=!0),A.memoizedState=F,A.baseQueue===null&&(A.baseState=F),h.lastRenderedState=F}return[F,g]}function tB(c,A,h){var g=Et,S=da(),F=$t;if(F){if(h===void 0)throw Error(a(407));h=h()}else h=A();var V=!vs((ur||S).memoizedState,h);if(V&&(S.memoizedState=h,ba=!0),S=S.queue,C1(nB.bind(null,g,S,c),[c]),S.getSnapshot!==A||V||ga!==null&&ga.memoizedState.tag&1){if(g.flags|=2048,_u(9,{destroy:void 0},aB.bind(null,g,S,h,A),null),mr===null)throw Error(a(349));F||(Hl&127)!==0||rB(g,A,h)}return h}function rB(c,A,h){c.flags|=16384,c={getSnapshot:A,value:h},A=Et.updateQueue,A===null?(A=Fh(),Et.updateQueue=A,A.stores=[c]):(h=A.stores,h===null?A.stores=[c]:h.push(c))}function aB(c,A,h,g){A.value=h,A.getSnapshot=g,sB(A)&&iB(c)}function nB(c,A,h){return h(function(){sB(A)&&iB(c)})}function sB(c){var A=c.getSnapshot;c=c.value;try{var h=A();return!vs(c,h)}catch{return!0}}function iB(c){var A=Zc(c,2);A!==null&&ss(A,c,2)}function w1(c){var A=Ln();if(typeof c=="function"){var h=c;if(c=h(),od){Dr(!0);try{h()}finally{Dr(!1)}}}return A.memoizedState=A.baseState=c,A.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:c},A}function lB(c,A,h,g){return c.baseState=h,v1(c,ur,typeof g=="function"?g:zl)}function w$(c,A,h,g,S){if(Rh(c))throw Error(a(485));if(c=A.action,c!==null){var F={payload:S,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(V){F.listeners.push(V)}};W.T!==null?h(!0):F.isTransition=!1,g(F),h=A.pending,h===null?(F.next=A.pending=F,oB(A,F)):(F.next=h.next,A.pending=h.next=F)}}function oB(c,A){var h=A.action,g=A.payload,S=c.state;if(A.isTransition){var F=W.T,V={};W.T=V;try{var re=h(S,g),fe=W.S;fe!==null&&fe(V,re),cB(c,A,re)}catch(je){N1(c,A,je)}finally{F!==null&&V.types!==null&&(F.types=V.types),W.T=F}}else try{F=h(S,g),cB(c,A,F)}catch(je){N1(c,A,je)}}function cB(c,A,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){dB(c,A,g)},function(g){return N1(c,A,g)}):dB(c,A,h)}function dB(c,A,h){A.status="fulfilled",A.value=h,uB(A),c.state=h,A=c.pending,A!==null&&(h=A.next,h===A?c.pending=null:(h=h.next,A.next=h,oB(c,h)))}function N1(c,A,h){var g=c.pending;if(c.pending=null,g!==null){g=g.next;do A.status="rejected",A.reason=h,uB(A),A=A.next;while(A!==g)}c.action=null}function uB(c){c=c.listeners;for(var A=0;A<c.length;A++)(0,c[A])()}function AB(c,A){return A}function fB(c,A){if($t){var h=mr.formState;if(h!==null){e:{var g=Et;if($t){if(kr){t:{for(var S=kr,F=Js;S.nodeType!==8;){if(!F){S=null;break t}if(S=ei(S.nextSibling),S===null){S=null;break t}}F=S.data,S=F==="F!"||F==="F"?S:null}if(S){kr=ei(S.nextSibling),g=S.data==="F!";break e}}$o(g)}g=!1}g&&(A=h[0])}}return h=Ln(),h.memoizedState=h.baseState=A,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:AB,lastRenderedState:A},h.queue=g,h=FB.bind(null,Et,g),g.dispatch=h,g=w1(!1),F=B1.bind(null,Et,!1,g.queue),g=Ln(),S={state:A,dispatch:null,action:c,pending:null},g.queue=S,h=w$.bind(null,Et,S,F,h),S.dispatch=h,g.memoizedState=c,[A,h,!1]}function pB(c){var A=da();return hB(A,ur,c)}function hB(c,A,h){if(A=v1(c,A,AB)[0],c=Dh(zl)[0],typeof A=="object"&&A!==null&&typeof A.then=="function")try{var g=k0(A)}catch(V){throw V===ku?Ch:V}else g=A;A=da();var S=A.queue,F=S.dispatch;return h!==A.memoizedState&&(Et.flags|=2048,_u(9,{destroy:void 0},N$.bind(null,S,h),null)),[g,F,c]}function N$(c,A){c.action=A}function xB(c){var A=da(),h=ur;if(h!==null)return hB(A,h,c);da(),A=A.memoizedState,h=da();var g=h.queue.dispatch;return h.memoizedState=c,[A,g,!1]}function _u(c,A,h,g){return c={tag:c,create:h,deps:g,inst:A,next:null},A=Et.updateQueue,A===null&&(A=Fh(),Et.updateQueue=A),h=A.lastEffect,h===null?A.lastEffect=c.next=c:(g=h.next,h.next=c,c.next=g,A.lastEffect=c),c}function mB(){return da().memoizedState}function Uh(c,A,h,g){var S=Ln();Et.flags|=c,S.memoizedState=_u(1|A,{destroy:void 0},h,g===void 0?null:g)}function Mh(c,A,h,g){var S=da();g=g===void 0?null:g;var F=S.memoizedState.inst;ur!==null&&g!==null&&p1(g,ur.memoizedState.deps)?S.memoizedState=_u(A,F,h,g):(Et.flags|=c,S.memoizedState=_u(1|A,F,h,g))}function gB(c,A){Uh(8390656,8,c,A)}function C1(c,A){Mh(2048,8,c,A)}function C$(c){Et.flags|=4;var A=Et.updateQueue;if(A===null)A=Fh(),Et.updateQueue=A,A.events=[c];else{var h=A.events;h===null?A.events=[c]:h.push(c)}}function bB(c){var A=da().memoizedState;return C$({ref:A,nextImpl:c}),function(){if((tr&2)!==0)throw Error(a(440));return A.impl.apply(void 0,arguments)}}function vB(c,A){return Mh(4,2,c,A)}function yB(c,A){return Mh(4,4,c,A)}function wB(c,A){if(typeof A=="function"){c=c();var h=A(c);return function(){typeof h=="function"?h():A(null)}}if(A!=null)return c=c(),A.current=c,function(){A.current=null}}function NB(c,A,h){h=h!=null?h.concat([c]):null,Mh(4,4,wB.bind(null,A,c),h)}function k1(){}function CB(c,A){var h=da();A=A===void 0?null:A;var g=h.memoizedState;return A!==null&&p1(A,g[1])?g[0]:(h.memoizedState=[c,A],c)}function kB(c,A){var h=da();A=A===void 0?null:A;var g=h.memoizedState;if(A!==null&&p1(A,g[1]))return g[0];if(g=c(),od){Dr(!0);try{c()}finally{Dr(!1)}}return h.memoizedState=[g,A],g}function j1(c,A,h){return h===void 0||(Hl&1073741824)!==0&&(Ot&261930)===0?c.memoizedState=A:(c.memoizedState=h,c=j4(),Et.lanes|=c,Zo|=c,h)}function jB(c,A,h,g){return vs(h,A)?h:Eu.current!==null?(c=j1(c,h,g),vs(c,A)||(ba=!0),c):(Hl&42)===0||(Hl&1073741824)!==0&&(Ot&261930)===0?(ba=!0,c.memoizedState=h):(c=j4(),Et.lanes|=c,Zo|=c,A)}function EB(c,A,h,g,S){var F=z.p;z.p=F!==0&&8>F?F:8;var V=W.T,re={};W.T=re,B1(c,!1,A,h);try{var fe=S(),je=W.S;if(je!==null&&je(re,fe),fe!==null&&typeof fe=="object"&&typeof fe.then=="function"){var Oe=b$(fe,g);j0(c,A,Oe,js(c))}else j0(c,A,g,js(c))}catch(Le){j0(c,A,{then:function(){},status:"rejected",reason:Le},js())}finally{z.p=F,V!==null&&re.types!==null&&(V.types=re.types),W.T=V}}function k$(){}function E1(c,A,h,g){if(c.tag!==5)throw Error(a(476));var S=SB(c).queue;EB(c,S,A,Z,h===null?k$:function(){return BB(c),h(g)})}function SB(c){var A=c.memoizedState;if(A!==null)return A;A={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:Z},next:null};var h={};return A.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:h},next:null},c.memoizedState=A,c=c.alternate,c!==null&&(c.memoizedState=A),A}function BB(c){var A=SB(c);A.next===null&&(A=c.alternate.memoizedState),j0(c,A.next.queue,{},js())}function S1(){return on(z0)}function _B(){return da().memoizedState}function TB(){return da().memoizedState}function j$(c){for(var A=c.return;A!==null;){switch(A.tag){case 24:case 3:var h=js();c=Ko(h);var g=qo(A,c,h);g!==null&&(ss(g,A,h),y0(g,A,h)),A={cache:a1()},c.payload=A;return}A=A.return}}function E$(c,A,h){var g=js();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Rh(c)?IB(A,h):(h=Gv(c,A,h,g),h!==null&&(ss(h,c,g),DB(h,A,g)))}function FB(c,A,h){var g=js();j0(c,A,h,g)}function j0(c,A,h,g){var S={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Rh(c))IB(A,S);else{var F=c.alternate;if(c.lanes===0&&(F===null||F.lanes===0)&&(F=A.lastRenderedReducer,F!==null))try{var V=A.lastRenderedState,re=F(V,h);if(S.hasEagerState=!0,S.eagerState=re,vs(re,V))return mh(c,A,S,0),mr===null&&xh(),!1}catch{}finally{}if(h=Gv(c,A,S,g),h!==null)return ss(h,c,g),DB(h,A,g),!0}return!1}function B1(c,A,h,g){if(g={lane:2,revertLane:ly(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Rh(c)){if(A)throw Error(a(479))}else A=Gv(c,h,g,2),A!==null&&ss(A,c,2)}function Rh(c){var A=c.alternate;return c===Et||A!==null&&A===Et}function IB(c,A){Su=_h=!0;var h=c.pending;h===null?A.next=A:(A.next=h.next,h.next=A),c.pending=A}function DB(c,A,h){if((h&4194048)!==0){var g=A.lanes;g&=c.pendingLanes,h|=g,A.lanes=h,Ia(c,h)}}var E0={readContext:on,use:Ih,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useLayoutEffect:Xr,useInsertionEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useSyncExternalStore:Xr,useId:Xr,useHostTransitionStatus:Xr,useFormState:Xr,useActionState:Xr,useOptimistic:Xr,useMemoCache:Xr,useCacheRefresh:Xr};E0.useEffectEvent=Xr;var UB={readContext:on,use:Ih,useCallback:function(c,A){return Ln().memoizedState=[c,A===void 0?null:A],c},useContext:on,useEffect:gB,useImperativeHandle:function(c,A,h){h=h!=null?h.concat([c]):null,Uh(4194308,4,wB.bind(null,A,c),h)},useLayoutEffect:function(c,A){return Uh(4194308,4,c,A)},useInsertionEffect:function(c,A){Uh(4,2,c,A)},useMemo:function(c,A){var h=Ln();A=A===void 0?null:A;var g=c();if(od){Dr(!0);try{c()}finally{Dr(!1)}}return h.memoizedState=[g,A],g},useReducer:function(c,A,h){var g=Ln();if(h!==void 0){var S=h(A);if(od){Dr(!0);try{h(A)}finally{Dr(!1)}}}else S=A;return g.memoizedState=g.baseState=S,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:S},g.queue=c,c=c.dispatch=E$.bind(null,Et,c),[g.memoizedState,c]},useRef:function(c){var A=Ln();return c={current:c},A.memoizedState=c},useState:function(c){c=w1(c);var A=c.queue,h=FB.bind(null,Et,A);return A.dispatch=h,[c.memoizedState,h]},useDebugValue:k1,useDeferredValue:function(c,A){var h=Ln();return j1(h,c,A)},useTransition:function(){var c=w1(!1);return c=EB.bind(null,Et,c.queue,!0,!1),Ln().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,A,h){var g=Et,S=Ln();if($t){if(h===void 0)throw Error(a(407));h=h()}else{if(h=A(),mr===null)throw Error(a(349));(Ot&127)!==0||rB(g,A,h)}S.memoizedState=h;var F={value:h,getSnapshot:A};return S.queue=F,gB(nB.bind(null,g,F,c),[c]),g.flags|=2048,_u(9,{destroy:void 0},aB.bind(null,g,F,h,A),null),h},useId:function(){var c=Ln(),A=mr.identifierPrefix;if($t){var h=al,g=rl;h=(g&~(1<<32-zr(g)-1)).toString(32)+h,A="_"+A+"R_"+h,h=Th++,0<h&&(A+="H"+h.toString(32)),A+="_"}else h=v$++,A="_"+A+"r_"+h.toString(32)+"_";return c.memoizedState=A},useHostTransitionStatus:S1,useFormState:fB,useActionState:fB,useOptimistic:function(c){var A=Ln();A.memoizedState=A.baseState=c;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return A.queue=h,A=B1.bind(null,Et,!0,h),h.dispatch=A,[c,A]},useMemoCache:b1,useCacheRefresh:function(){return Ln().memoizedState=j$.bind(null,Et)},useEffectEvent:function(c){var A=Ln(),h={impl:c};return A.memoizedState=h,function(){if((tr&2)!==0)throw Error(a(440));return h.impl.apply(void 0,arguments)}}},_1={readContext:on,use:Ih,useCallback:CB,useContext:on,useEffect:C1,useImperativeHandle:NB,useInsertionEffect:vB,useLayoutEffect:yB,useMemo:kB,useReducer:Dh,useRef:mB,useState:function(){return Dh(zl)},useDebugValue:k1,useDeferredValue:function(c,A){var h=da();return jB(h,ur.memoizedState,c,A)},useTransition:function(){var c=Dh(zl)[0],A=da().memoizedState;return[typeof c=="boolean"?c:k0(c),A]},useSyncExternalStore:tB,useId:_B,useHostTransitionStatus:S1,useFormState:pB,useActionState:pB,useOptimistic:function(c,A){var h=da();return lB(h,ur,c,A)},useMemoCache:b1,useCacheRefresh:TB};_1.useEffectEvent=bB;var MB={readContext:on,use:Ih,useCallback:CB,useContext:on,useEffect:C1,useImperativeHandle:NB,useInsertionEffect:vB,useLayoutEffect:yB,useMemo:kB,useReducer:y1,useRef:mB,useState:function(){return y1(zl)},useDebugValue:k1,useDeferredValue:function(c,A){var h=da();return ur===null?j1(h,c,A):jB(h,ur.memoizedState,c,A)},useTransition:function(){var c=y1(zl)[0],A=da().memoizedState;return[typeof c=="boolean"?c:k0(c),A]},useSyncExternalStore:tB,useId:_B,useHostTransitionStatus:S1,useFormState:xB,useActionState:xB,useOptimistic:function(c,A){var h=da();return ur!==null?lB(h,ur,c,A):(h.baseState=c,[c,h.queue.dispatch])},useMemoCache:b1,useCacheRefresh:TB};MB.useEffectEvent=bB;function T1(c,A,h,g){A=c.memoizedState,h=h(g,A),h=h==null?A:p({},A,h),c.memoizedState=h,c.lanes===0&&(c.updateQueue.baseState=h)}var F1={enqueueSetState:function(c,A,h){c=c._reactInternals;var g=js(),S=Ko(g);S.payload=A,h!=null&&(S.callback=h),A=qo(c,S,g),A!==null&&(ss(A,c,g),y0(A,c,g))},enqueueReplaceState:function(c,A,h){c=c._reactInternals;var g=js(),S=Ko(g);S.tag=1,S.payload=A,h!=null&&(S.callback=h),A=qo(c,S,g),A!==null&&(ss(A,c,g),y0(A,c,g))},enqueueForceUpdate:function(c,A){c=c._reactInternals;var h=js(),g=Ko(h);g.tag=2,A!=null&&(g.callback=A),A=qo(c,g,h),A!==null&&(ss(A,c,h),y0(A,c,h))}};function RB(c,A,h,g,S,F,V){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(g,F,V):A.prototype&&A.prototype.isPureReactComponent?!f0(h,g)||!f0(S,F):!0}function OB(c,A,h,g){c=A.state,typeof A.componentWillReceiveProps=="function"&&A.componentWillReceiveProps(h,g),typeof A.UNSAFE_componentWillReceiveProps=="function"&&A.UNSAFE_componentWillReceiveProps(h,g),A.state!==c&&F1.enqueueReplaceState(A,A.state,null)}function cd(c,A){var h=A;if("ref"in A){h={};for(var g in A)g!=="ref"&&(h[g]=A[g])}if(c=c.defaultProps){h===A&&(h=p({},h));for(var S in c)h[S]===void 0&&(h[S]=c[S])}return h}function PB(c){hh(c)}function LB(c){console.error(c)}function QB(c){hh(c)}function Oh(c,A){try{var h=c.onUncaughtError;h(A.value,{componentStack:A.stack})}catch(g){setTimeout(function(){throw g})}}function HB(c,A,h){try{var g=c.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:A.tag===1?A.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function I1(c,A,h){return h=Ko(h),h.tag=3,h.payload={element:null},h.callback=function(){Oh(c,A)},h}function zB(c){return c=Ko(c),c.tag=3,c}function $B(c,A,h,g){var S=h.type.getDerivedStateFromError;if(typeof S=="function"){var F=g.value;c.payload=function(){return S(F)},c.callback=function(){HB(A,h,g)}}var V=h.stateNode;V!==null&&typeof V.componentDidCatch=="function"&&(c.callback=function(){HB(A,h,g),typeof S!="function"&&(ec===null?ec=new Set([this]):ec.add(this));var re=g.stack;this.componentDidCatch(g.value,{componentStack:re!==null?re:""})})}function S$(c,A,h,g,S){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(A=h.alternate,A!==null&&wu(A,h,S,!0),h=ws.current,h!==null){switch(h.tag){case 31:case 13:return Zs===null?Yh():h.alternate===null&&Jr===0&&(Jr=3),h.flags&=-257,h.flags|=65536,h.lanes=S,g===kh?h.flags|=16384:(A=h.updateQueue,A===null?h.updateQueue=new Set([g]):A.add(g),ny(c,g,S)),!1;case 22:return h.flags|=65536,g===kh?h.flags|=16384:(A=h.updateQueue,A===null?(A={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=A):(h=A.retryQueue,h===null?A.retryQueue=new Set([g]):h.add(g)),ny(c,g,S)),!1}throw Error(a(435,h.tag))}return ny(c,g,S),Yh(),!1}if($t)return A=ws.current,A!==null?((A.flags&65536)===0&&(A.flags|=256),A.flags|=65536,A.lanes=S,g!==Jv&&(c=Error(a(422),{cause:g}),x0(Ws(c,h)))):(g!==Jv&&(A=Error(a(423),{cause:g}),x0(Ws(A,h))),c=c.current.alternate,c.flags|=65536,S&=-S,c.lanes|=S,g=Ws(g,h),S=I1(c.stateNode,g,S),c1(c,S),Jr!==4&&(Jr=2)),!1;var F=Error(a(520),{cause:g});if(F=Ws(F,h),U0===null?U0=[F]:U0.push(F),Jr!==4&&(Jr=2),A===null)return!0;g=Ws(g,h),h=A;do{switch(h.tag){case 3:return h.flags|=65536,c=S&-S,h.lanes|=c,c=I1(h.stateNode,g,c),c1(h,c),!1;case 1:if(A=h.type,F=h.stateNode,(h.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(ec===null||!ec.has(F))))return h.flags|=65536,S&=-S,h.lanes|=S,S=zB(S),$B(S,c,h,g),c1(h,S),!1}h=h.return}while(h!==null);return!1}var D1=Error(a(461)),ba=!1;function cn(c,A,h,g){A.child=c===null?qS(A,null,h,g):ld(A,c.child,h,g)}function VB(c,A,h,g,S){h=h.render;var F=A.ref;if("ref"in g){var V={};for(var re in g)re!=="ref"&&(V[re]=g[re])}else V=g;return ad(A),g=h1(c,A,h,V,F,S),re=x1(),c!==null&&!ba?(m1(c,A,S),$l(c,A,S)):($t&&re&&Yv(A),A.flags|=1,cn(c,A,g,S),A.child)}function GB(c,A,h,g,S){if(c===null){var F=h.type;return typeof F=="function"&&!Kv(F)&&F.defaultProps===void 0&&h.compare===null?(A.tag=15,A.type=F,KB(c,A,F,g,S)):(c=bh(h.type,null,g,A,A.mode,S),c.ref=A.ref,c.return=A,A.child=c)}if(F=c.child,!H1(c,S)){var V=F.memoizedProps;if(h=h.compare,h=h!==null?h:f0,h(V,g)&&c.ref===A.ref)return $l(c,A,S)}return A.flags|=1,c=Ol(F,g),c.ref=A.ref,c.return=A,A.child=c}function KB(c,A,h,g,S){if(c!==null){var F=c.memoizedProps;if(f0(F,g)&&c.ref===A.ref)if(ba=!1,A.pendingProps=g=F,H1(c,S))(c.flags&131072)!==0&&(ba=!0);else return A.lanes=c.lanes,$l(c,A,S)}return U1(c,A,h,g,S)}function qB(c,A,h,g){var S=g.children,F=c!==null?c.memoizedState:null;if(c===null&&A.stateNode===null&&(A.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((A.flags&128)!==0){if(F=F!==null?F.baseLanes|h:h,c!==null){for(g=A.child=c.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~F}else g=0,A.child=null;return WB(c,A,F,h,g)}if((h&536870912)!==0)A.memoizedState={baseLanes:0,cachePool:null},c!==null&&Nh(A,F!==null?F.cachePool:null),F!==null?XS(A,F):u1(),JS(A);else return g=A.lanes=536870912,WB(c,A,F!==null?F.baseLanes|h:h,h,g)}else F!==null?(Nh(A,F.cachePool),XS(A,F),Yo(),A.memoizedState=null):(c!==null&&Nh(A,null),u1(),Yo());return cn(c,A,S,h),A.child}function S0(c,A){return c!==null&&c.tag===22||A.stateNode!==null||(A.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),A.sibling}function WB(c,A,h,g,S){var F=s1();return F=F===null?null:{parent:ma._currentValue,pool:F},A.memoizedState={baseLanes:h,cachePool:F},c!==null&&Nh(A,null),u1(),JS(A),c!==null&&wu(c,A,g,!0),A.childLanes=S,null}function Ph(c,A){return A=Qh({mode:A.mode,children:A.children},c.mode),A.ref=c.ref,c.child=A,A.return=c,A}function YB(c,A,h){return ld(A,c.child,null,h),c=Ph(A,A.pendingProps),c.flags|=2,Ns(A),A.memoizedState=null,c}function B$(c,A,h){var g=A.pendingProps,S=(A.flags&128)!==0;if(A.flags&=-129,c===null){if($t){if(g.mode==="hidden")return c=Ph(A,g),A.lanes=536870912,S0(null,c);if(f1(A),(c=kr)?(c=o_(c,Js),c=c!==null&&c.data==="&"?c:null,c!==null&&(A.memoizedState={dehydrated:c,treeContext:Ho!==null?{id:rl,overflow:al}:null,retryLane:536870912,hydrationErrors:null},h=IS(c),h.return=A,A.child=h,ln=A,kr=null)):c=null,c===null)throw $o(A);return A.lanes=536870912,null}return Ph(A,g)}var F=c.memoizedState;if(F!==null){var V=F.dehydrated;if(f1(A),S)if(A.flags&256)A.flags&=-257,A=YB(c,A,h);else if(A.memoizedState!==null)A.child=c.child,A.flags|=128,A=null;else throw Error(a(558));else if(ba||wu(c,A,h,!1),S=(h&c.childLanes)!==0,ba||S){if(g=mr,g!==null&&(V=xe(g,h),V!==0&&V!==F.retryLane))throw F.retryLane=V,Zc(c,V),ss(g,c,V),D1;Yh(),A=YB(c,A,h)}else c=F.treeContext,kr=ei(V.nextSibling),ln=A,$t=!0,zo=null,Js=!1,c!==null&&MS(A,c),A=Ph(A,g),A.flags|=4096;return A}return c=Ol(c.child,{mode:g.mode,children:g.children}),c.ref=A.ref,A.child=c,c.return=A,c}function Lh(c,A){var h=A.ref;if(h===null)c!==null&&c.ref!==null&&(A.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(a(284));(c===null||c.ref!==h)&&(A.flags|=4194816)}}function U1(c,A,h,g,S){return ad(A),h=h1(c,A,h,g,void 0,S),g=x1(),c!==null&&!ba?(m1(c,A,S),$l(c,A,S)):($t&&g&&Yv(A),A.flags|=1,cn(c,A,h,S),A.child)}function XB(c,A,h,g,S,F){return ad(A),A.updateQueue=null,h=eB(A,g,h,S),ZS(c),g=x1(),c!==null&&!ba?(m1(c,A,F),$l(c,A,F)):($t&&g&&Yv(A),A.flags|=1,cn(c,A,h,F),A.child)}function JB(c,A,h,g,S){if(ad(A),A.stateNode===null){var F=gu,V=h.contextType;typeof V=="object"&&V!==null&&(F=on(V)),F=new h(g,F),A.memoizedState=F.state!==null&&F.state!==void 0?F.state:null,F.updater=F1,A.stateNode=F,F._reactInternals=A,F=A.stateNode,F.props=g,F.state=A.memoizedState,F.refs={},l1(A),V=h.contextType,F.context=typeof V=="object"&&V!==null?on(V):gu,F.state=A.memoizedState,V=h.getDerivedStateFromProps,typeof V=="function"&&(T1(A,h,V,g),F.state=A.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof F.getSnapshotBeforeUpdate=="function"||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(V=F.state,typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount(),V!==F.state&&F1.enqueueReplaceState(F,F.state,null),N0(A,g,F,S),w0(),F.state=A.memoizedState),typeof F.componentDidMount=="function"&&(A.flags|=4194308),g=!0}else if(c===null){F=A.stateNode;var re=A.memoizedProps,fe=cd(h,re);F.props=fe;var je=F.context,Oe=h.contextType;V=gu,typeof Oe=="object"&&Oe!==null&&(V=on(Oe));var Le=h.getDerivedStateFromProps;Oe=typeof Le=="function"||typeof F.getSnapshotBeforeUpdate=="function",re=A.pendingProps!==re,Oe||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(re||je!==V)&&OB(A,F,g,V),Go=!1;var Be=A.memoizedState;F.state=Be,N0(A,g,F,S),w0(),je=A.memoizedState,re||Be!==je||Go?(typeof Le=="function"&&(T1(A,h,Le,g),je=A.memoizedState),(fe=Go||RB(A,h,fe,g,Be,je,V))?(Oe||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(A.flags|=4194308)):(typeof F.componentDidMount=="function"&&(A.flags|=4194308),A.memoizedProps=g,A.memoizedState=je),F.props=g,F.state=je,F.context=V,g=fe):(typeof F.componentDidMount=="function"&&(A.flags|=4194308),g=!1)}else{F=A.stateNode,o1(c,A),V=A.memoizedProps,Oe=cd(h,V),F.props=Oe,Le=A.pendingProps,Be=F.context,je=h.contextType,fe=gu,typeof je=="object"&&je!==null&&(fe=on(je)),re=h.getDerivedStateFromProps,(je=typeof re=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(V!==Le||Be!==fe)&&OB(A,F,g,fe),Go=!1,Be=A.memoizedState,F.state=Be,N0(A,g,F,S),w0();var Fe=A.memoizedState;V!==Le||Be!==Fe||Go||c!==null&&c.dependencies!==null&&yh(c.dependencies)?(typeof re=="function"&&(T1(A,h,re,g),Fe=A.memoizedState),(Oe=Go||RB(A,h,Oe,g,Be,Fe,fe)||c!==null&&c.dependencies!==null&&yh(c.dependencies))?(je||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(g,Fe,fe),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(g,Fe,fe)),typeof F.componentDidUpdate=="function"&&(A.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(A.flags|=1024)):(typeof F.componentDidUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=1024),A.memoizedProps=g,A.memoizedState=Fe),F.props=g,F.state=Fe,F.context=fe,g=Oe):(typeof F.componentDidUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=1024),g=!1)}return F=g,Lh(c,A),g=(A.flags&128)!==0,F||g?(F=A.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:F.render(),A.flags|=1,c!==null&&g?(A.child=ld(A,c.child,null,S),A.child=ld(A,null,h,S)):cn(c,A,h,S),A.memoizedState=F.state,c=A.child):c=$l(c,A,S),c}function ZB(c,A,h,g){return td(),A.flags|=256,cn(c,A,h,g),A.child}var M1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function R1(c){return{baseLanes:c,cachePool:HS()}}function O1(c,A,h){return c=c!==null?c.childLanes&~h:0,A&&(c|=ks),c}function e4(c,A,h){var g=A.pendingProps,S=!1,F=(A.flags&128)!==0,V;if((V=F)||(V=c!==null&&c.memoizedState===null?!1:(ca.current&2)!==0),V&&(S=!0,A.flags&=-129),V=(A.flags&32)!==0,A.flags&=-33,c===null){if($t){if(S?Wo(A):Yo(),(c=kr)?(c=o_(c,Js),c=c!==null&&c.data!=="&"?c:null,c!==null&&(A.memoizedState={dehydrated:c,treeContext:Ho!==null?{id:rl,overflow:al}:null,retryLane:536870912,hydrationErrors:null},h=IS(c),h.return=A,A.child=h,ln=A,kr=null)):c=null,c===null)throw $o(A);return vy(c)?A.lanes=32:A.lanes=536870912,null}var re=g.children;return g=g.fallback,S?(Yo(),S=A.mode,re=Qh({mode:"hidden",children:re},S),g=ed(g,S,h,null),re.return=A,g.return=A,re.sibling=g,A.child=re,g=A.child,g.memoizedState=R1(h),g.childLanes=O1(c,V,h),A.memoizedState=M1,S0(null,g)):(Wo(A),P1(A,re))}var fe=c.memoizedState;if(fe!==null&&(re=fe.dehydrated,re!==null)){if(F)A.flags&256?(Wo(A),A.flags&=-257,A=L1(c,A,h)):A.memoizedState!==null?(Yo(),A.child=c.child,A.flags|=128,A=null):(Yo(),re=g.fallback,S=A.mode,g=Qh({mode:"visible",children:g.children},S),re=ed(re,S,h,null),re.flags|=2,g.return=A,re.return=A,g.sibling=re,A.child=g,ld(A,c.child,null,h),g=A.child,g.memoizedState=R1(h),g.childLanes=O1(c,V,h),A.memoizedState=M1,A=S0(null,g));else if(Wo(A),vy(re)){if(V=re.nextSibling&&re.nextSibling.dataset,V)var je=V.dgst;V=je,g=Error(a(419)),g.stack="",g.digest=V,x0({value:g,source:null,stack:null}),A=L1(c,A,h)}else if(ba||wu(c,A,h,!1),V=(h&c.childLanes)!==0,ba||V){if(V=mr,V!==null&&(g=xe(V,h),g!==0&&g!==fe.retryLane))throw fe.retryLane=g,Zc(c,g),ss(V,c,g),D1;by(re)||Yh(),A=L1(c,A,h)}else by(re)?(A.flags|=192,A.child=c.child,A=null):(c=fe.treeContext,kr=ei(re.nextSibling),ln=A,$t=!0,zo=null,Js=!1,c!==null&&MS(A,c),A=P1(A,g.children),A.flags|=4096);return A}return S?(Yo(),re=g.fallback,S=A.mode,fe=c.child,je=fe.sibling,g=Ol(fe,{mode:"hidden",children:g.children}),g.subtreeFlags=fe.subtreeFlags&65011712,je!==null?re=Ol(je,re):(re=ed(re,S,h,null),re.flags|=2),re.return=A,g.return=A,g.sibling=re,A.child=g,S0(null,g),g=A.child,re=c.child.memoizedState,re===null?re=R1(h):(S=re.cachePool,S!==null?(fe=ma._currentValue,S=S.parent!==fe?{parent:fe,pool:fe}:S):S=HS(),re={baseLanes:re.baseLanes|h,cachePool:S}),g.memoizedState=re,g.childLanes=O1(c,V,h),A.memoizedState=M1,S0(c.child,g)):(Wo(A),h=c.child,c=h.sibling,h=Ol(h,{mode:"visible",children:g.children}),h.return=A,h.sibling=null,c!==null&&(V=A.deletions,V===null?(A.deletions=[c],A.flags|=16):V.push(c)),A.child=h,A.memoizedState=null,h)}function P1(c,A){return A=Qh({mode:"visible",children:A},c.mode),A.return=c,c.child=A}function Qh(c,A){return c=ys(22,c,null,A),c.lanes=0,c}function L1(c,A,h){return ld(A,c.child,null,h),c=P1(A,A.pendingProps.children),c.flags|=2,A.memoizedState=null,c}function t4(c,A,h){c.lanes|=A;var g=c.alternate;g!==null&&(g.lanes|=A),t1(c.return,A,h)}function Q1(c,A,h,g,S,F){var V=c.memoizedState;V===null?c.memoizedState={isBackwards:A,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:S,treeForkCount:F}:(V.isBackwards=A,V.rendering=null,V.renderingStartTime=0,V.last=g,V.tail=h,V.tailMode=S,V.treeForkCount=F)}function r4(c,A,h){var g=A.pendingProps,S=g.revealOrder,F=g.tail;g=g.children;var V=ca.current,re=(V&2)!==0;if(re?(V=V&1|2,A.flags|=128):V&=1,q(ca,V),cn(c,A,g,h),g=$t?h0:0,!re&&c!==null&&(c.flags&128)!==0)e:for(c=A.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&t4(c,h,A);else if(c.tag===19)t4(c,h,A);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===A)break e;for(;c.sibling===null;){if(c.return===null||c.return===A)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(S){case"forwards":for(h=A.child,S=null;h!==null;)c=h.alternate,c!==null&&Bh(c)===null&&(S=h),h=h.sibling;h=S,h===null?(S=A.child,A.child=null):(S=h.sibling,h.sibling=null),Q1(A,!1,S,h,F,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,S=A.child,A.child=null;S!==null;){if(c=S.alternate,c!==null&&Bh(c)===null){A.child=S;break}c=S.sibling,S.sibling=h,h=S,S=c}Q1(A,!0,h,null,F,g);break;case"together":Q1(A,!1,null,null,void 0,g);break;default:A.memoizedState=null}return A.child}function $l(c,A,h){if(c!==null&&(A.dependencies=c.dependencies),Zo|=A.lanes,(h&A.childLanes)===0)if(c!==null){if(wu(c,A,h,!1),(h&A.childLanes)===0)return null}else return null;if(c!==null&&A.child!==c.child)throw Error(a(153));if(A.child!==null){for(c=A.child,h=Ol(c,c.pendingProps),A.child=h,h.return=A;c.sibling!==null;)c=c.sibling,h=h.sibling=Ol(c,c.pendingProps),h.return=A;h.sibling=null}return A.child}function H1(c,A){return(c.lanes&A)!==0?!0:(c=c.dependencies,!!(c!==null&&yh(c)))}function _$(c,A,h){switch(A.tag){case 3:ce(A,A.stateNode.containerInfo),Vo(A,ma,c.memoizedState.cache),td();break;case 27:case 5:le(A);break;case 4:ce(A,A.stateNode.containerInfo);break;case 10:Vo(A,A.type,A.memoizedProps.value);break;case 31:if(A.memoizedState!==null)return A.flags|=128,f1(A),null;break;case 13:var g=A.memoizedState;if(g!==null)return g.dehydrated!==null?(Wo(A),A.flags|=128,null):(h&A.child.childLanes)!==0?e4(c,A,h):(Wo(A),c=$l(c,A,h),c!==null?c.sibling:null);Wo(A);break;case 19:var S=(c.flags&128)!==0;if(g=(h&A.childLanes)!==0,g||(wu(c,A,h,!1),g=(h&A.childLanes)!==0),S){if(g)return r4(c,A,h);A.flags|=128}if(S=A.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),q(ca,ca.current),g)break;return null;case 22:return A.lanes=0,qB(c,A,h,A.pendingProps);case 24:Vo(A,ma,c.memoizedState.cache)}return $l(c,A,h)}function a4(c,A,h){if(c!==null)if(c.memoizedProps!==A.pendingProps)ba=!0;else{if(!H1(c,h)&&(A.flags&128)===0)return ba=!1,_$(c,A,h);ba=(c.flags&131072)!==0}else ba=!1,$t&&(A.flags&1048576)!==0&&US(A,h0,A.index);switch(A.lanes=0,A.tag){case 16:e:{var g=A.pendingProps;if(c=sd(A.elementType),A.type=c,typeof c=="function")Kv(c)?(g=cd(c,g),A.tag=1,A=JB(null,A,c,g,h)):(A.tag=0,A=U1(null,A,c,g,h));else{if(c!=null){var S=c.$$typeof;if(S===E){A.tag=11,A=VB(null,A,c,g,h);break e}else if(S===I){A.tag=14,A=GB(null,A,c,g,h);break e}}throw A=G(c)||c,Error(a(306,A,""))}}return A;case 0:return U1(c,A,A.type,A.pendingProps,h);case 1:return g=A.type,S=cd(g,A.pendingProps),JB(c,A,g,S,h);case 3:e:{if(ce(A,A.stateNode.containerInfo),c===null)throw Error(a(387));g=A.pendingProps;var F=A.memoizedState;S=F.element,o1(c,A),N0(A,g,null,h);var V=A.memoizedState;if(g=V.cache,Vo(A,ma,g),g!==F.cache&&r1(A,[ma],h,!0),w0(),g=V.element,F.isDehydrated)if(F={element:g,isDehydrated:!1,cache:V.cache},A.updateQueue.baseState=F,A.memoizedState=F,A.flags&256){A=ZB(c,A,g,h);break e}else if(g!==S){S=Ws(Error(a(424)),A),x0(S),A=ZB(c,A,g,h);break e}else{switch(c=A.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(kr=ei(c.firstChild),ln=A,$t=!0,zo=null,Js=!0,h=qS(A,null,g,h),A.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(td(),g===S){A=$l(c,A,h);break e}cn(c,A,g,h)}A=A.child}return A;case 26:return Lh(c,A),c===null?(h=p_(A.type,null,A.pendingProps,null))?A.memoizedState=h:$t||(h=A.type,c=A.pendingProps,g=ax(ae.current).createElement(h),g[ie]=A,g[ue]=c,dn(g,h,c),it(g),A.stateNode=g):A.memoizedState=p_(A.type,c.memoizedProps,A.pendingProps,c.memoizedState),null;case 27:return le(A),c===null&&$t&&(g=A.stateNode=u_(A.type,A.pendingProps,ae.current),ln=A,Js=!0,S=kr,nc(A.type)?(yy=S,kr=ei(g.firstChild)):kr=S),cn(c,A,A.pendingProps.children,h),Lh(c,A),c===null&&(A.flags|=4194304),A.child;case 5:return c===null&&$t&&((S=g=kr)&&(g=i7(g,A.type,A.pendingProps,Js),g!==null?(A.stateNode=g,ln=A,kr=ei(g.firstChild),Js=!1,S=!0):S=!1),S||$o(A)),le(A),S=A.type,F=A.pendingProps,V=c!==null?c.memoizedProps:null,g=F.children,xy(S,F)?g=null:V!==null&&xy(S,V)&&(A.flags|=32),A.memoizedState!==null&&(S=h1(c,A,y$,null,null,h),z0._currentValue=S),Lh(c,A),cn(c,A,g,h),A.child;case 6:return c===null&&$t&&((c=h=kr)&&(h=l7(h,A.pendingProps,Js),h!==null?(A.stateNode=h,ln=A,kr=null,c=!0):c=!1),c||$o(A)),null;case 13:return e4(c,A,h);case 4:return ce(A,A.stateNode.containerInfo),g=A.pendingProps,c===null?A.child=ld(A,null,g,h):cn(c,A,g,h),A.child;case 11:return VB(c,A,A.type,A.pendingProps,h);case 7:return cn(c,A,A.pendingProps,h),A.child;case 8:return cn(c,A,A.pendingProps.children,h),A.child;case 12:return cn(c,A,A.pendingProps.children,h),A.child;case 10:return g=A.pendingProps,Vo(A,A.type,g.value),cn(c,A,g.children,h),A.child;case 9:return S=A.type._context,g=A.pendingProps.children,ad(A),S=on(S),g=g(S),A.flags|=1,cn(c,A,g,h),A.child;case 14:return GB(c,A,A.type,A.pendingProps,h);case 15:return KB(c,A,A.type,A.pendingProps,h);case 19:return r4(c,A,h);case 31:return B$(c,A,h);case 22:return qB(c,A,h,A.pendingProps);case 24:return ad(A),g=on(ma),c===null?(S=s1(),S===null&&(S=mr,F=a1(),S.pooledCache=F,F.refCount++,F!==null&&(S.pooledCacheLanes|=h),S=F),A.memoizedState={parent:g,cache:S},l1(A),Vo(A,ma,S)):((c.lanes&h)!==0&&(o1(c,A),N0(A,null,null,h),w0()),S=c.memoizedState,F=A.memoizedState,S.parent!==g?(S={parent:g,cache:g},A.memoizedState=S,A.lanes===0&&(A.memoizedState=A.updateQueue.baseState=S),Vo(A,ma,g)):(g=F.cache,Vo(A,ma,g),g!==S.cache&&r1(A,[ma],h,!0))),cn(c,A,A.pendingProps.children,h),A.child;case 29:throw A.pendingProps}throw Error(a(156,A.tag))}function Vl(c){c.flags|=4}function z1(c,A,h,g,S){if((A=(c.mode&32)!==0)&&(A=!1),A){if(c.flags|=16777216,(S&335544128)===S)if(c.stateNode.complete)c.flags|=8192;else if(_4())c.flags|=8192;else throw id=kh,i1}else c.flags&=-16777217}function n4(c,A){if(A.type!=="stylesheet"||(A.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!b_(A))if(_4())c.flags|=8192;else throw id=kh,i1}function Hh(c,A){A!==null&&(c.flags|=4),c.flags&16384&&(A=c.tag!==22?Po():536870912,c.lanes|=A,Du|=A)}function B0(c,A){if(!$t)switch(c.tailMode){case"hidden":A=c.tail;for(var h=null;A!==null;)A.alternate!==null&&(h=A),A=A.sibling;h===null?c.tail=null:h.sibling=null;break;case"collapsed":h=c.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?A||c.tail===null?c.tail=null:c.tail.sibling=null:g.sibling=null}}function jr(c){var A=c.alternate!==null&&c.alternate.child===c.child,h=0,g=0;if(A)for(var S=c.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=c,S=S.sibling;else for(S=c.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=c,S=S.sibling;return c.subtreeFlags|=g,c.childLanes=h,A}function T$(c,A,h){var g=A.pendingProps;switch(Xv(A),A.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jr(A),null;case 1:return jr(A),null;case 3:return h=A.stateNode,g=null,c!==null&&(g=c.memoizedState.cache),A.memoizedState.cache!==g&&(A.flags|=2048),Ql(ma),ne(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(c===null||c.child===null)&&(yu(A)?Vl(A):c===null||c.memoizedState.isDehydrated&&(A.flags&256)===0||(A.flags|=1024,Zv())),jr(A),null;case 26:var S=A.type,F=A.memoizedState;return c===null?(Vl(A),F!==null?(jr(A),n4(A,F)):(jr(A),z1(A,S,null,g,h))):F?F!==c.memoizedState?(Vl(A),jr(A),n4(A,F)):(jr(A),A.flags&=-16777217):(c=c.memoizedProps,c!==g&&Vl(A),jr(A),z1(A,S,c,g,h)),null;case 27:if(ge(A),h=ae.current,S=A.type,c!==null&&A.stateNode!=null)c.memoizedProps!==g&&Vl(A);else{if(!g){if(A.stateNode===null)throw Error(a(166));return jr(A),null}c=H.current,yu(A)?RS(A):(c=u_(S,g,h),A.stateNode=c,Vl(A))}return jr(A),null;case 5:if(ge(A),S=A.type,c!==null&&A.stateNode!=null)c.memoizedProps!==g&&Vl(A);else{if(!g){if(A.stateNode===null)throw Error(a(166));return jr(A),null}if(F=H.current,yu(A))RS(A);else{var V=ax(ae.current);switch(F){case 1:F=V.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:F=V.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":F=V.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":F=V.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":F=V.createElement("div"),F.innerHTML="<script><\/script>",F=F.removeChild(F.firstChild);break;case"select":F=typeof g.is=="string"?V.createElement("select",{is:g.is}):V.createElement("select"),g.multiple?F.multiple=!0:g.size&&(F.size=g.size);break;default:F=typeof g.is=="string"?V.createElement(S,{is:g.is}):V.createElement(S)}}F[ie]=A,F[ue]=g;e:for(V=A.child;V!==null;){if(V.tag===5||V.tag===6)F.appendChild(V.stateNode);else if(V.tag!==4&&V.tag!==27&&V.child!==null){V.child.return=V,V=V.child;continue}if(V===A)break e;for(;V.sibling===null;){if(V.return===null||V.return===A)break e;V=V.return}V.sibling.return=V.return,V=V.sibling}A.stateNode=F;e:switch(dn(F,S,g),S){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Vl(A)}}return jr(A),z1(A,A.type,c===null?null:c.memoizedProps,A.pendingProps,h),null;case 6:if(c&&A.stateNode!=null)c.memoizedProps!==g&&Vl(A);else{if(typeof g!="string"&&A.stateNode===null)throw Error(a(166));if(c=ae.current,yu(A)){if(c=A.stateNode,h=A.memoizedProps,g=null,S=ln,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}c[ie]=A,c=!!(c.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||e_(c.nodeValue,h)),c||$o(A,!0)}else c=ax(c).createTextNode(g),c[ie]=A,A.stateNode=c}return jr(A),null;case 31:if(h=A.memoizedState,c===null||c.memoizedState!==null){if(g=yu(A),h!==null){if(c===null){if(!g)throw Error(a(318));if(c=A.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(557));c[ie]=A}else td(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;jr(A),c=!1}else h=Zv(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=h),c=!0;if(!c)return A.flags&256?(Ns(A),A):(Ns(A),null);if((A.flags&128)!==0)throw Error(a(558))}return jr(A),null;case 13:if(g=A.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(S=yu(A),g!==null&&g.dehydrated!==null){if(c===null){if(!S)throw Error(a(318));if(S=A.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(a(317));S[ie]=A}else td(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;jr(A),S=!1}else S=Zv(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=S),S=!0;if(!S)return A.flags&256?(Ns(A),A):(Ns(A),null)}return Ns(A),(A.flags&128)!==0?(A.lanes=h,A):(h=g!==null,c=c!==null&&c.memoizedState!==null,h&&(g=A.child,S=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(S=g.alternate.memoizedState.cachePool.pool),F=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(F=g.memoizedState.cachePool.pool),F!==S&&(g.flags|=2048)),h!==c&&h&&(A.child.flags|=8192),Hh(A,A.updateQueue),jr(A),null);case 4:return ne(),c===null&&uy(A.stateNode.containerInfo),jr(A),null;case 10:return Ql(A.type),jr(A),null;case 19:if(P(ca),g=A.memoizedState,g===null)return jr(A),null;if(S=(A.flags&128)!==0,F=g.rendering,F===null)if(S)B0(g,!1);else{if(Jr!==0||c!==null&&(c.flags&128)!==0)for(c=A.child;c!==null;){if(F=Bh(c),F!==null){for(A.flags|=128,B0(g,!1),c=F.updateQueue,A.updateQueue=c,Hh(A,c),A.subtreeFlags=0,c=h,h=A.child;h!==null;)FS(h,c),h=h.sibling;return q(ca,ca.current&1|2),$t&&Pl(A,g.treeForkCount),A.child}c=c.sibling}g.tail!==null&&_t()>Kh&&(A.flags|=128,S=!0,B0(g,!1),A.lanes=4194304)}else{if(!S)if(c=Bh(F),c!==null){if(A.flags|=128,S=!0,c=c.updateQueue,A.updateQueue=c,Hh(A,c),B0(g,!0),g.tail===null&&g.tailMode==="hidden"&&!F.alternate&&!$t)return jr(A),null}else 2*_t()-g.renderingStartTime>Kh&&h!==536870912&&(A.flags|=128,S=!0,B0(g,!1),A.lanes=4194304);g.isBackwards?(F.sibling=A.child,A.child=F):(c=g.last,c!==null?c.sibling=F:A.child=F,g.last=F)}return g.tail!==null?(c=g.tail,g.rendering=c,g.tail=c.sibling,g.renderingStartTime=_t(),c.sibling=null,h=ca.current,q(ca,S?h&1|2:h&1),$t&&Pl(A,g.treeForkCount),c):(jr(A),null);case 22:case 23:return Ns(A),A1(),g=A.memoizedState!==null,c!==null?c.memoizedState!==null!==g&&(A.flags|=8192):g&&(A.flags|=8192),g?(h&536870912)!==0&&(A.flags&128)===0&&(jr(A),A.subtreeFlags&6&&(A.flags|=8192)):jr(A),h=A.updateQueue,h!==null&&Hh(A,h.retryQueue),h=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(h=c.memoizedState.cachePool.pool),g=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(g=A.memoizedState.cachePool.pool),g!==h&&(A.flags|=2048),c!==null&&P(nd),null;case 24:return h=null,c!==null&&(h=c.memoizedState.cache),A.memoizedState.cache!==h&&(A.flags|=2048),Ql(ma),jr(A),null;case 25:return null;case 30:return null}throw Error(a(156,A.tag))}function F$(c,A){switch(Xv(A),A.tag){case 1:return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 3:return Ql(ma),ne(),c=A.flags,(c&65536)!==0&&(c&128)===0?(A.flags=c&-65537|128,A):null;case 26:case 27:case 5:return ge(A),null;case 31:if(A.memoizedState!==null){if(Ns(A),A.alternate===null)throw Error(a(340));td()}return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 13:if(Ns(A),c=A.memoizedState,c!==null&&c.dehydrated!==null){if(A.alternate===null)throw Error(a(340));td()}return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 19:return P(ca),null;case 4:return ne(),null;case 10:return Ql(A.type),null;case 22:case 23:return Ns(A),A1(),c!==null&&P(nd),c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 24:return Ql(ma),null;case 25:return null;default:return null}}function s4(c,A){switch(Xv(A),A.tag){case 3:Ql(ma),ne();break;case 26:case 27:case 5:ge(A);break;case 4:ne();break;case 31:A.memoizedState!==null&&Ns(A);break;case 13:Ns(A);break;case 19:P(ca);break;case 10:Ql(A.type);break;case 22:case 23:Ns(A),A1(),c!==null&&P(nd);break;case 24:Ql(ma)}}function _0(c,A){try{var h=A.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var S=g.next;h=S;do{if((h.tag&c)===c){g=void 0;var F=h.create,V=h.inst;g=F(),V.destroy=g}h=h.next}while(h!==S)}}catch(re){sr(A,A.return,re)}}function Xo(c,A,h){try{var g=A.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var F=S.next;g=F;do{if((g.tag&c)===c){var V=g.inst,re=V.destroy;if(re!==void 0){V.destroy=void 0,S=A;var fe=h,je=re;try{je()}catch(Oe){sr(S,fe,Oe)}}}g=g.next}while(g!==F)}}catch(Oe){sr(A,A.return,Oe)}}function i4(c){var A=c.updateQueue;if(A!==null){var h=c.stateNode;try{YS(A,h)}catch(g){sr(c,c.return,g)}}}function l4(c,A,h){h.props=cd(c.type,c.memoizedProps),h.state=c.memoizedState;try{h.componentWillUnmount()}catch(g){sr(c,A,g)}}function T0(c,A){try{var h=c.ref;if(h!==null){switch(c.tag){case 26:case 27:case 5:var g=c.stateNode;break;case 30:g=c.stateNode;break;default:g=c.stateNode}typeof h=="function"?c.refCleanup=h(g):h.current=g}}catch(S){sr(c,A,S)}}function nl(c,A){var h=c.ref,g=c.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(S){sr(c,A,S)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){sr(c,A,S)}else h.current=null}function o4(c){var A=c.type,h=c.memoizedProps,g=c.stateNode;try{e:switch(A){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(S){sr(c,c.return,S)}}function $1(c,A,h){try{var g=c.stateNode;e7(g,c.type,h,A),g[ue]=A}catch(S){sr(c,c.return,S)}}function c4(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&nc(c.type)||c.tag===4}function V1(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||c4(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&nc(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function G1(c,A,h){var g=c.tag;if(g===5||g===6)c=c.stateNode,A?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(c,A):(A=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,A.appendChild(c),h=h._reactRootContainer,h!=null||A.onclick!==null||(A.onclick=Ml));else if(g!==4&&(g===27&&nc(c.type)&&(h=c.stateNode,A=null),c=c.child,c!==null))for(G1(c,A,h),c=c.sibling;c!==null;)G1(c,A,h),c=c.sibling}function zh(c,A,h){var g=c.tag;if(g===5||g===6)c=c.stateNode,A?h.insertBefore(c,A):h.appendChild(c);else if(g!==4&&(g===27&&nc(c.type)&&(h=c.stateNode),c=c.child,c!==null))for(zh(c,A,h),c=c.sibling;c!==null;)zh(c,A,h),c=c.sibling}function d4(c){var A=c.stateNode,h=c.memoizedProps;try{for(var g=c.type,S=A.attributes;S.length;)A.removeAttributeNode(S[0]);dn(A,g,h),A[ie]=c,A[ue]=h}catch(F){sr(c,c.return,F)}}var Gl=!1,va=!1,K1=!1,u4=typeof WeakSet=="function"?WeakSet:Set,$a=null;function I$(c,A){if(c=c.containerInfo,py=dx,c=NS(c),Lv(c)){if("selectionStart"in c)var h={start:c.selectionStart,end:c.selectionEnd};else e:{h=(h=c.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var S=g.anchorOffset,F=g.focusNode;g=g.focusOffset;try{h.nodeType,F.nodeType}catch{h=null;break e}var V=0,re=-1,fe=-1,je=0,Oe=0,Le=c,Be=null;t:for(;;){for(var Fe;Le!==h||S!==0&&Le.nodeType!==3||(re=V+S),Le!==F||g!==0&&Le.nodeType!==3||(fe=V+g),Le.nodeType===3&&(V+=Le.nodeValue.length),(Fe=Le.firstChild)!==null;)Be=Le,Le=Fe;for(;;){if(Le===c)break t;if(Be===h&&++je===S&&(re=V),Be===F&&++Oe===g&&(fe=V),(Fe=Le.nextSibling)!==null)break;Le=Be,Be=Le.parentNode}Le=Fe}h=re===-1||fe===-1?null:{start:re,end:fe}}else h=null}h=h||{start:0,end:0}}else h=null;for(hy={focusedElem:c,selectionRange:h},dx=!1,$a=A;$a!==null;)if(A=$a,c=A.child,(A.subtreeFlags&1028)!==0&&c!==null)c.return=A,$a=c;else for(;$a!==null;){switch(A=$a,F=A.alternate,c=A.flags,A.tag){case 0:if((c&4)!==0&&(c=A.updateQueue,c=c!==null?c.events:null,c!==null))for(h=0;h<c.length;h++)S=c[h],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&F!==null){c=void 0,h=A,S=F.memoizedProps,F=F.memoizedState,g=h.stateNode;try{var st=cd(h.type,S);c=g.getSnapshotBeforeUpdate(st,F),g.__reactInternalSnapshotBeforeUpdate=c}catch(mt){sr(h,h.return,mt)}}break;case 3:if((c&1024)!==0){if(c=A.stateNode.containerInfo,h=c.nodeType,h===9)gy(c);else if(h===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":gy(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(a(163))}if(c=A.sibling,c!==null){c.return=A.return,$a=c;break}$a=A.return}}function A4(c,A,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:ql(c,h),g&4&&_0(5,h);break;case 1:if(ql(c,h),g&4)if(c=h.stateNode,A===null)try{c.componentDidMount()}catch(V){sr(h,h.return,V)}else{var S=cd(h.type,A.memoizedProps);A=A.memoizedState;try{c.componentDidUpdate(S,A,c.__reactInternalSnapshotBeforeUpdate)}catch(V){sr(h,h.return,V)}}g&64&&i4(h),g&512&&T0(h,h.return);break;case 3:if(ql(c,h),g&64&&(c=h.updateQueue,c!==null)){if(A=null,h.child!==null)switch(h.child.tag){case 27:case 5:A=h.child.stateNode;break;case 1:A=h.child.stateNode}try{YS(c,A)}catch(V){sr(h,h.return,V)}}break;case 27:A===null&&g&4&&d4(h);case 26:case 5:ql(c,h),A===null&&g&4&&o4(h),g&512&&T0(h,h.return);break;case 12:ql(c,h);break;case 31:ql(c,h),g&4&&h4(c,h);break;case 13:ql(c,h),g&4&&x4(c,h),g&64&&(c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(h=H$.bind(null,h),o7(c,h))));break;case 22:if(g=h.memoizedState!==null||Gl,!g){A=A!==null&&A.memoizedState!==null||va,S=Gl;var F=va;Gl=g,(va=A)&&!F?Wl(c,h,(h.subtreeFlags&8772)!==0):ql(c,h),Gl=S,va=F}break;case 30:break;default:ql(c,h)}}function f4(c){var A=c.alternate;A!==null&&(c.alternate=null,f4(A)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(A=c.stateNode,A!==null&&He(A)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var Mr=null,ts=!1;function Kl(c,A,h){for(h=h.child;h!==null;)p4(c,A,h),h=h.sibling}function p4(c,A,h){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(jt,h)}catch{}switch(h.tag){case 26:va||nl(h,A),Kl(c,A,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:va||nl(h,A);var g=Mr,S=ts;nc(h.type)&&(Mr=h.stateNode,ts=!1),Kl(c,A,h),L0(h.stateNode),Mr=g,ts=S;break;case 5:va||nl(h,A);case 6:if(g=Mr,S=ts,Mr=null,Kl(c,A,h),Mr=g,ts=S,Mr!==null)if(ts)try{(Mr.nodeType===9?Mr.body:Mr.nodeName==="HTML"?Mr.ownerDocument.body:Mr).removeChild(h.stateNode)}catch(F){sr(h,A,F)}else try{Mr.removeChild(h.stateNode)}catch(F){sr(h,A,F)}break;case 18:Mr!==null&&(ts?(c=Mr,i_(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,h.stateNode),Hu(c)):i_(Mr,h.stateNode));break;case 4:g=Mr,S=ts,Mr=h.stateNode.containerInfo,ts=!0,Kl(c,A,h),Mr=g,ts=S;break;case 0:case 11:case 14:case 15:Xo(2,h,A),va||Xo(4,h,A),Kl(c,A,h);break;case 1:va||(nl(h,A),g=h.stateNode,typeof g.componentWillUnmount=="function"&&l4(h,A,g)),Kl(c,A,h);break;case 21:Kl(c,A,h);break;case 22:va=(g=va)||h.memoizedState!==null,Kl(c,A,h),va=g;break;default:Kl(c,A,h)}}function h4(c,A){if(A.memoizedState===null&&(c=A.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Hu(c)}catch(h){sr(A,A.return,h)}}}function x4(c,A){if(A.memoizedState===null&&(c=A.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Hu(c)}catch(h){sr(A,A.return,h)}}function D$(c){switch(c.tag){case 31:case 13:case 19:var A=c.stateNode;return A===null&&(A=c.stateNode=new u4),A;case 22:return c=c.stateNode,A=c._retryCache,A===null&&(A=c._retryCache=new u4),A;default:throw Error(a(435,c.tag))}}function $h(c,A){var h=D$(c);A.forEach(function(g){if(!h.has(g)){h.add(g);var S=z$.bind(null,c,g);g.then(S,S)}})}function rs(c,A){var h=A.deletions;if(h!==null)for(var g=0;g<h.length;g++){var S=h[g],F=c,V=A,re=V;e:for(;re!==null;){switch(re.tag){case 27:if(nc(re.type)){Mr=re.stateNode,ts=!1;break e}break;case 5:Mr=re.stateNode,ts=!1;break e;case 3:case 4:Mr=re.stateNode.containerInfo,ts=!0;break e}re=re.return}if(Mr===null)throw Error(a(160));p4(F,V,S),Mr=null,ts=!1,F=S.alternate,F!==null&&(F.return=null),S.return=null}if(A.subtreeFlags&13886)for(A=A.child;A!==null;)m4(A,c),A=A.sibling}var Bi=null;function m4(c,A){var h=c.alternate,g=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:rs(A,c),as(c),g&4&&(Xo(3,c,c.return),_0(3,c),Xo(5,c,c.return));break;case 1:rs(A,c),as(c),g&512&&(va||h===null||nl(h,h.return)),g&64&&Gl&&(c=c.updateQueue,c!==null&&(g=c.callbacks,g!==null&&(h=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var S=Bi;if(rs(A,c),as(c),g&512&&(va||h===null||nl(h,h.return)),g&4){var F=h!==null?h.memoizedState:null;if(g=c.memoizedState,h===null)if(g===null)if(c.stateNode===null){e:{g=c.type,h=c.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":F=S.getElementsByTagName("title")[0],(!F||F[Se]||F[ie]||F.namespaceURI==="http://www.w3.org/2000/svg"||F.hasAttribute("itemprop"))&&(F=S.createElement(g),S.head.insertBefore(F,S.querySelector("head > title"))),dn(F,g,h),F[ie]=c,it(F),g=F;break e;case"link":var V=m_("link","href",S).get(g+(h.href||""));if(V){for(var re=0;re<V.length;re++)if(F=V[re],F.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&F.getAttribute("rel")===(h.rel==null?null:h.rel)&&F.getAttribute("title")===(h.title==null?null:h.title)&&F.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){V.splice(re,1);break t}}F=S.createElement(g),dn(F,g,h),S.head.appendChild(F);break;case"meta":if(V=m_("meta","content",S).get(g+(h.content||""))){for(re=0;re<V.length;re++)if(F=V[re],F.getAttribute("content")===(h.content==null?null:""+h.content)&&F.getAttribute("name")===(h.name==null?null:h.name)&&F.getAttribute("property")===(h.property==null?null:h.property)&&F.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&F.getAttribute("charset")===(h.charSet==null?null:h.charSet)){V.splice(re,1);break t}}F=S.createElement(g),dn(F,g,h),S.head.appendChild(F);break;default:throw Error(a(468,g))}F[ie]=c,it(F),g=F}c.stateNode=g}else g_(S,c.type,c.stateNode);else c.stateNode=x_(S,g,c.memoizedProps);else F!==g?(F===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):F.count--,g===null?g_(S,c.type,c.stateNode):x_(S,g,c.memoizedProps)):g===null&&c.stateNode!==null&&$1(c,c.memoizedProps,h.memoizedProps)}break;case 27:rs(A,c),as(c),g&512&&(va||h===null||nl(h,h.return)),h!==null&&g&4&&$1(c,c.memoizedProps,h.memoizedProps);break;case 5:if(rs(A,c),as(c),g&512&&(va||h===null||nl(h,h.return)),c.flags&32){S=c.stateNode;try{uu(S,"")}catch(st){sr(c,c.return,st)}}g&4&&c.stateNode!=null&&(S=c.memoizedProps,$1(c,S,h!==null?h.memoizedProps:S)),g&1024&&(K1=!0);break;case 6:if(rs(A,c),as(c),g&4){if(c.stateNode===null)throw Error(a(162));g=c.memoizedProps,h=c.stateNode;try{h.nodeValue=g}catch(st){sr(c,c.return,st)}}break;case 3:if(ix=null,S=Bi,Bi=nx(A.containerInfo),rs(A,c),Bi=S,as(c),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Hu(A.containerInfo)}catch(st){sr(c,c.return,st)}K1&&(K1=!1,g4(c));break;case 4:g=Bi,Bi=nx(c.stateNode.containerInfo),rs(A,c),as(c),Bi=g;break;case 12:rs(A,c),as(c);break;case 31:rs(A,c),as(c),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,$h(c,g)));break;case 13:rs(A,c),as(c),c.child.flags&8192&&c.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Gh=_t()),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,$h(c,g)));break;case 22:S=c.memoizedState!==null;var fe=h!==null&&h.memoizedState!==null,je=Gl,Oe=va;if(Gl=je||S,va=Oe||fe,rs(A,c),va=Oe,Gl=je,as(c),g&8192)e:for(A=c.stateNode,A._visibility=S?A._visibility&-2:A._visibility|1,S&&(h===null||fe||Gl||va||dd(c)),h=null,A=c;;){if(A.tag===5||A.tag===26){if(h===null){fe=h=A;try{if(F=fe.stateNode,S)V=F.style,typeof V.setProperty=="function"?V.setProperty("display","none","important"):V.display="none";else{re=fe.stateNode;var Le=fe.memoizedProps.style,Be=Le!=null&&Le.hasOwnProperty("display")?Le.display:null;re.style.display=Be==null||typeof Be=="boolean"?"":(""+Be).trim()}}catch(st){sr(fe,fe.return,st)}}}else if(A.tag===6){if(h===null){fe=A;try{fe.stateNode.nodeValue=S?"":fe.memoizedProps}catch(st){sr(fe,fe.return,st)}}}else if(A.tag===18){if(h===null){fe=A;try{var Fe=fe.stateNode;S?l_(Fe,!0):l_(fe.stateNode,!1)}catch(st){sr(fe,fe.return,st)}}}else if((A.tag!==22&&A.tag!==23||A.memoizedState===null||A===c)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break e;for(;A.sibling===null;){if(A.return===null||A.return===c)break e;h===A&&(h=null),A=A.return}h===A&&(h=null),A.sibling.return=A.return,A=A.sibling}g&4&&(g=c.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,$h(c,h))));break;case 19:rs(A,c),as(c),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,$h(c,g)));break;case 30:break;case 21:break;default:rs(A,c),as(c)}}function as(c){var A=c.flags;if(A&2){try{for(var h,g=c.return;g!==null;){if(c4(g)){h=g;break}g=g.return}if(h==null)throw Error(a(160));switch(h.tag){case 27:var S=h.stateNode,F=V1(c);zh(c,F,S);break;case 5:var V=h.stateNode;h.flags&32&&(uu(V,""),h.flags&=-33);var re=V1(c);zh(c,re,V);break;case 3:case 4:var fe=h.stateNode.containerInfo,je=V1(c);G1(c,je,fe);break;default:throw Error(a(161))}}catch(Oe){sr(c,c.return,Oe)}c.flags&=-3}A&4096&&(c.flags&=-4097)}function g4(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var A=c;g4(A),A.tag===5&&A.flags&1024&&A.stateNode.reset(),c=c.sibling}}function ql(c,A){if(A.subtreeFlags&8772)for(A=A.child;A!==null;)A4(c,A.alternate,A),A=A.sibling}function dd(c){for(c=c.child;c!==null;){var A=c;switch(A.tag){case 0:case 11:case 14:case 15:Xo(4,A,A.return),dd(A);break;case 1:nl(A,A.return);var h=A.stateNode;typeof h.componentWillUnmount=="function"&&l4(A,A.return,h),dd(A);break;case 27:L0(A.stateNode);case 26:case 5:nl(A,A.return),dd(A);break;case 22:A.memoizedState===null&&dd(A);break;case 30:dd(A);break;default:dd(A)}c=c.sibling}}function Wl(c,A,h){for(h=h&&(A.subtreeFlags&8772)!==0,A=A.child;A!==null;){var g=A.alternate,S=c,F=A,V=F.flags;switch(F.tag){case 0:case 11:case 15:Wl(S,F,h),_0(4,F);break;case 1:if(Wl(S,F,h),g=F,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(je){sr(g,g.return,je)}if(g=F,S=g.updateQueue,S!==null){var re=g.stateNode;try{var fe=S.shared.hiddenCallbacks;if(fe!==null)for(S.shared.hiddenCallbacks=null,S=0;S<fe.length;S++)WS(fe[S],re)}catch(je){sr(g,g.return,je)}}h&&V&64&&i4(F),T0(F,F.return);break;case 27:d4(F);case 26:case 5:Wl(S,F,h),h&&g===null&&V&4&&o4(F),T0(F,F.return);break;case 12:Wl(S,F,h);break;case 31:Wl(S,F,h),h&&V&4&&h4(S,F);break;case 13:Wl(S,F,h),h&&V&4&&x4(S,F);break;case 22:F.memoizedState===null&&Wl(S,F,h),T0(F,F.return);break;case 30:break;default:Wl(S,F,h)}A=A.sibling}}function q1(c,A){var h=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(h=c.memoizedState.cachePool.pool),c=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(c=A.memoizedState.cachePool.pool),c!==h&&(c!=null&&c.refCount++,h!=null&&m0(h))}function W1(c,A){c=null,A.alternate!==null&&(c=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==c&&(A.refCount++,c!=null&&m0(c))}function _i(c,A,h,g){if(A.subtreeFlags&10256)for(A=A.child;A!==null;)b4(c,A,h,g),A=A.sibling}function b4(c,A,h,g){var S=A.flags;switch(A.tag){case 0:case 11:case 15:_i(c,A,h,g),S&2048&&_0(9,A);break;case 1:_i(c,A,h,g);break;case 3:_i(c,A,h,g),S&2048&&(c=null,A.alternate!==null&&(c=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==c&&(A.refCount++,c!=null&&m0(c)));break;case 12:if(S&2048){_i(c,A,h,g),c=A.stateNode;try{var F=A.memoizedProps,V=F.id,re=F.onPostCommit;typeof re=="function"&&re(V,A.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(fe){sr(A,A.return,fe)}}else _i(c,A,h,g);break;case 31:_i(c,A,h,g);break;case 13:_i(c,A,h,g);break;case 23:break;case 22:F=A.stateNode,V=A.alternate,A.memoizedState!==null?F._visibility&2?_i(c,A,h,g):F0(c,A):F._visibility&2?_i(c,A,h,g):(F._visibility|=2,Tu(c,A,h,g,(A.subtreeFlags&10256)!==0||!1)),S&2048&&q1(V,A);break;case 24:_i(c,A,h,g),S&2048&&W1(A.alternate,A);break;default:_i(c,A,h,g)}}function Tu(c,A,h,g,S){for(S=S&&((A.subtreeFlags&10256)!==0||!1),A=A.child;A!==null;){var F=c,V=A,re=h,fe=g,je=V.flags;switch(V.tag){case 0:case 11:case 15:Tu(F,V,re,fe,S),_0(8,V);break;case 23:break;case 22:var Oe=V.stateNode;V.memoizedState!==null?Oe._visibility&2?Tu(F,V,re,fe,S):F0(F,V):(Oe._visibility|=2,Tu(F,V,re,fe,S)),S&&je&2048&&q1(V.alternate,V);break;case 24:Tu(F,V,re,fe,S),S&&je&2048&&W1(V.alternate,V);break;default:Tu(F,V,re,fe,S)}A=A.sibling}}function F0(c,A){if(A.subtreeFlags&10256)for(A=A.child;A!==null;){var h=c,g=A,S=g.flags;switch(g.tag){case 22:F0(h,g),S&2048&&q1(g.alternate,g);break;case 24:F0(h,g),S&2048&&W1(g.alternate,g);break;default:F0(h,g)}A=A.sibling}}var I0=8192;function Fu(c,A,h){if(c.subtreeFlags&I0)for(c=c.child;c!==null;)v4(c,A,h),c=c.sibling}function v4(c,A,h){switch(c.tag){case 26:Fu(c,A,h),c.flags&I0&&c.memoizedState!==null&&v7(h,Bi,c.memoizedState,c.memoizedProps);break;case 5:Fu(c,A,h);break;case 3:case 4:var g=Bi;Bi=nx(c.stateNode.containerInfo),Fu(c,A,h),Bi=g;break;case 22:c.memoizedState===null&&(g=c.alternate,g!==null&&g.memoizedState!==null?(g=I0,I0=16777216,Fu(c,A,h),I0=g):Fu(c,A,h));break;default:Fu(c,A,h)}}function y4(c){var A=c.alternate;if(A!==null&&(c=A.child,c!==null)){A.child=null;do A=c.sibling,c.sibling=null,c=A;while(c!==null)}}function D0(c){var A=c.deletions;if((c.flags&16)!==0){if(A!==null)for(var h=0;h<A.length;h++){var g=A[h];$a=g,N4(g,c)}y4(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)w4(c),c=c.sibling}function w4(c){switch(c.tag){case 0:case 11:case 15:D0(c),c.flags&2048&&Xo(9,c,c.return);break;case 3:D0(c);break;case 12:D0(c);break;case 22:var A=c.stateNode;c.memoizedState!==null&&A._visibility&2&&(c.return===null||c.return.tag!==13)?(A._visibility&=-3,Vh(c)):D0(c);break;default:D0(c)}}function Vh(c){var A=c.deletions;if((c.flags&16)!==0){if(A!==null)for(var h=0;h<A.length;h++){var g=A[h];$a=g,N4(g,c)}y4(c)}for(c=c.child;c!==null;){switch(A=c,A.tag){case 0:case 11:case 15:Xo(8,A,A.return),Vh(A);break;case 22:h=A.stateNode,h._visibility&2&&(h._visibility&=-3,Vh(A));break;default:Vh(A)}c=c.sibling}}function N4(c,A){for(;$a!==null;){var h=$a;switch(h.tag){case 0:case 11:case 15:Xo(8,h,A);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:m0(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,$a=g;else e:for(h=c;$a!==null;){g=$a;var S=g.sibling,F=g.return;if(f4(g),g===h){$a=null;break e}if(S!==null){S.return=F,$a=S;break e}$a=F}}}var U$={getCacheForType:function(c){var A=on(ma),h=A.data.get(c);return h===void 0&&(h=c(),A.data.set(c,h)),h},cacheSignal:function(){return on(ma).controller.signal}},M$=typeof WeakMap=="function"?WeakMap:Map,tr=0,mr=null,Mt=null,Ot=0,nr=0,Cs=null,Jo=!1,Iu=!1,Y1=!1,Yl=0,Jr=0,Zo=0,ud=0,X1=0,ks=0,Du=0,U0=null,ns=null,J1=!1,Gh=0,C4=0,Kh=1/0,qh=null,ec=null,Da=0,tc=null,Uu=null,Xl=0,Z1=0,ey=null,k4=null,M0=0,ty=null;function js(){return(tr&2)!==0&&Ot!==0?Ot&-Ot:W.T!==null?ly():ee()}function j4(){if(ks===0)if((Ot&536870912)===0||$t){var c=ji;ji<<=1,(ji&3932160)===0&&(ji=262144),ks=c}else ks=536870912;return c=ws.current,c!==null&&(c.flags|=32),ks}function ss(c,A,h){(c===mr&&(nr===2||nr===9)||c.cancelPendingCommit!==null)&&(Mu(c,0),rc(c,Ot,ks,!1)),$e(c,h),((tr&2)===0||c!==mr)&&(c===mr&&((tr&2)===0&&(ud|=h),Jr===4&&rc(c,Ot,ks,!1)),sl(c))}function E4(c,A,h){if((tr&6)!==0)throw Error(a(327));var g=!h&&(A&127)===0&&(A&c.expiredLanes)===0||Ei(c,A),S=g?P$(c,A):ay(c,A,!0),F=g;do{if(S===0){Iu&&!g&&rc(c,A,0,!1);break}else{if(h=c.current.alternate,F&&!R$(h)){S=ay(c,A,!1),F=!1;continue}if(S===2){if(F=A,c.errorRecoveryDisabledLanes&F)var V=0;else V=c.pendingLanes&-536870913,V=V!==0?V:V&536870912?536870912:0;if(V!==0){A=V;e:{var re=c;S=U0;var fe=re.current.memoizedState.isDehydrated;if(fe&&(Mu(re,V).flags|=256),V=ay(re,V,!1),V!==2){if(Y1&&!fe){re.errorRecoveryDisabledLanes|=F,ud|=F,S=4;break e}F=ns,ns=S,F!==null&&(ns===null?ns=F:ns.push.apply(ns,F))}S=V}if(F=!1,S!==2)continue}}if(S===1){Mu(c,0),rc(c,A,0,!0);break}e:{switch(g=c,F=S,F){case 0:case 1:throw Error(a(345));case 4:if((A&4194048)!==A)break;case 6:rc(g,A,ks,!Jo);break e;case 2:ns=null;break;case 3:case 5:break;default:throw Error(a(329))}if((A&62914560)===A&&(S=Gh+300-_t(),10<S)){if(rc(g,A,ks,!Jo),el(g,0,!0)!==0)break e;Xl=A,g.timeoutHandle=n_(S4.bind(null,g,h,ns,qh,J1,A,ks,ud,Du,Jo,F,"Throttled",-0,0),S);break e}S4(g,h,ns,qh,J1,A,ks,ud,Du,Jo,F,null,-0,0)}}break}while(!0);sl(c)}function S4(c,A,h,g,S,F,V,re,fe,je,Oe,Le,Be,Fe){if(c.timeoutHandle=-1,Le=A.subtreeFlags,Le&8192||(Le&16785408)===16785408){Le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ml},v4(A,F,Le);var st=(F&62914560)===F?Gh-_t():(F&4194048)===F?C4-_t():0;if(st=y7(Le,st),st!==null){Xl=F,c.cancelPendingCommit=st(M4.bind(null,c,A,F,h,g,S,V,re,fe,Oe,Le,null,Be,Fe)),rc(c,F,V,!je);return}}M4(c,A,F,h,g,S,V,re,fe)}function R$(c){for(var A=c;;){var h=A.tag;if((h===0||h===11||h===15)&&A.flags&16384&&(h=A.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var S=h[g],F=S.getSnapshot;S=S.value;try{if(!vs(F(),S))return!1}catch{return!1}}if(h=A.child,A.subtreeFlags&16384&&h!==null)h.return=A,A=h;else{if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return!0;A=A.return}A.sibling.return=A.return,A=A.sibling}}return!0}function rc(c,A,h,g){A&=~X1,A&=~ud,c.suspendedLanes|=A,c.pingedLanes&=~A,g&&(c.warmLanes|=A),g=c.expirationTimes;for(var S=A;0<S;){var F=31-zr(S),V=1<<F;g[F]=-1,S&=~V}h!==0&&Yr(c,h,A)}function Wh(){return(tr&6)===0?(R0(0),!1):!0}function ry(){if(Mt!==null){if(nr===0)var c=Mt.return;else c=Mt,Ll=rd=null,g1(c),ju=null,b0=0,c=Mt;for(;c!==null;)s4(c.alternate,c),c=c.return;Mt=null}}function Mu(c,A){var h=c.timeoutHandle;h!==-1&&(c.timeoutHandle=-1,a7(h)),h=c.cancelPendingCommit,h!==null&&(c.cancelPendingCommit=null,h()),Xl=0,ry(),mr=c,Mt=h=Ol(c.current,null),Ot=A,nr=0,Cs=null,Jo=!1,Iu=Ei(c,A),Y1=!1,Du=ks=X1=ud=Zo=Jr=0,ns=U0=null,J1=!1,(A&8)!==0&&(A|=A&32);var g=c.entangledLanes;if(g!==0)for(c=c.entanglements,g&=A;0<g;){var S=31-zr(g),F=1<<S;A|=c[S],g&=~F}return Yl=A,xh(),h}function B4(c,A){Et=null,W.H=E0,A===ku||A===Ch?(A=VS(),nr=3):A===i1?(A=VS(),nr=4):nr=A===D1?8:A!==null&&typeof A=="object"&&typeof A.then=="function"?6:1,Cs=A,Mt===null&&(Jr=1,Oh(c,Ws(A,c.current)))}function _4(){var c=ws.current;return c===null?!0:(Ot&4194048)===Ot?Zs===null:(Ot&62914560)===Ot||(Ot&536870912)!==0?c===Zs:!1}function T4(){var c=W.H;return W.H=E0,c===null?E0:c}function F4(){var c=W.A;return W.A=U$,c}function Yh(){Jr=4,Jo||(Ot&4194048)!==Ot&&ws.current!==null||(Iu=!0),(Zo&134217727)===0&&(ud&134217727)===0||mr===null||rc(mr,Ot,ks,!1)}function ay(c,A,h){var g=tr;tr|=2;var S=T4(),F=F4();(mr!==c||Ot!==A)&&(qh=null,Mu(c,A)),A=!1;var V=Jr;e:do try{if(nr!==0&&Mt!==null){var re=Mt,fe=Cs;switch(nr){case 8:ry(),V=6;break e;case 3:case 2:case 9:case 6:ws.current===null&&(A=!0);var je=nr;if(nr=0,Cs=null,Ru(c,re,fe,je),h&&Iu){V=0;break e}break;default:je=nr,nr=0,Cs=null,Ru(c,re,fe,je)}}O$(),V=Jr;break}catch(Oe){B4(c,Oe)}while(!0);return A&&c.shellSuspendCounter++,Ll=rd=null,tr=g,W.H=S,W.A=F,Mt===null&&(mr=null,Ot=0,xh()),V}function O$(){for(;Mt!==null;)I4(Mt)}function P$(c,A){var h=tr;tr|=2;var g=T4(),S=F4();mr!==c||Ot!==A?(qh=null,Kh=_t()+500,Mu(c,A)):Iu=Ei(c,A);e:do try{if(nr!==0&&Mt!==null){A=Mt;var F=Cs;t:switch(nr){case 1:nr=0,Cs=null,Ru(c,A,F,1);break;case 2:case 9:if(zS(F)){nr=0,Cs=null,D4(A);break}A=function(){nr!==2&&nr!==9||mr!==c||(nr=7),sl(c)},F.then(A,A);break e;case 3:nr=7;break e;case 4:nr=5;break e;case 7:zS(F)?(nr=0,Cs=null,D4(A)):(nr=0,Cs=null,Ru(c,A,F,7));break;case 5:var V=null;switch(Mt.tag){case 26:V=Mt.memoizedState;case 5:case 27:var re=Mt;if(V?b_(V):re.stateNode.complete){nr=0,Cs=null;var fe=re.sibling;if(fe!==null)Mt=fe;else{var je=re.return;je!==null?(Mt=je,Xh(je)):Mt=null}break t}}nr=0,Cs=null,Ru(c,A,F,5);break;case 6:nr=0,Cs=null,Ru(c,A,F,6);break;case 8:ry(),Jr=6;break e;default:throw Error(a(462))}}L$();break}catch(Oe){B4(c,Oe)}while(!0);return Ll=rd=null,W.H=g,W.A=S,tr=h,Mt!==null?0:(mr=null,Ot=0,xh(),Jr)}function L$(){for(;Mt!==null&&!Kr();)I4(Mt)}function I4(c){var A=a4(c.alternate,c,Yl);c.memoizedProps=c.pendingProps,A===null?Xh(c):Mt=A}function D4(c){var A=c,h=A.alternate;switch(A.tag){case 15:case 0:A=XB(h,A,A.pendingProps,A.type,void 0,Ot);break;case 11:A=XB(h,A,A.pendingProps,A.type.render,A.ref,Ot);break;case 5:g1(A);default:s4(h,A),A=Mt=FS(A,Yl),A=a4(h,A,Yl)}c.memoizedProps=c.pendingProps,A===null?Xh(c):Mt=A}function Ru(c,A,h,g){Ll=rd=null,g1(A),ju=null,b0=0;var S=A.return;try{if(S$(c,S,A,h,Ot)){Jr=1,Oh(c,Ws(h,c.current)),Mt=null;return}}catch(F){if(S!==null)throw Mt=S,F;Jr=1,Oh(c,Ws(h,c.current)),Mt=null;return}A.flags&32768?($t||g===1?c=!0:Iu||(Ot&536870912)!==0?c=!1:(Jo=c=!0,(g===2||g===9||g===3||g===6)&&(g=ws.current,g!==null&&g.tag===13&&(g.flags|=16384))),U4(A,c)):Xh(A)}function Xh(c){var A=c;do{if((A.flags&32768)!==0){U4(A,Jo);return}c=A.return;var h=T$(A.alternate,A,Yl);if(h!==null){Mt=h;return}if(A=A.sibling,A!==null){Mt=A;return}Mt=A=c}while(A!==null);Jr===0&&(Jr=5)}function U4(c,A){do{var h=F$(c.alternate,c);if(h!==null){h.flags&=32767,Mt=h;return}if(h=c.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!A&&(c=c.sibling,c!==null)){Mt=c;return}Mt=c=h}while(c!==null);Jr=6,Mt=null}function M4(c,A,h,g,S,F,V,re,fe){c.cancelPendingCommit=null;do Jh();while(Da!==0);if((tr&6)!==0)throw Error(a(327));if(A!==null){if(A===c.current)throw Error(a(177));if(F=A.lanes|A.childLanes,F|=Vv,Tt(c,h,F,V,re,fe),c===mr&&(Mt=mr=null,Ot=0),Uu=A,tc=c,Xl=h,Z1=F,ey=S,k4=g,(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,$$(xt,function(){return Q4(),null})):(c.callbackNode=null,c.callbackPriority=0),g=(A.flags&13878)!==0,(A.subtreeFlags&13878)!==0||g){g=W.T,W.T=null,S=z.p,z.p=2,V=tr,tr|=4;try{I$(c,A,h)}finally{tr=V,z.p=S,W.T=g}}Da=1,R4(),O4(),P4()}}function R4(){if(Da===1){Da=0;var c=tc,A=Uu,h=(A.flags&13878)!==0;if((A.subtreeFlags&13878)!==0||h){h=W.T,W.T=null;var g=z.p;z.p=2;var S=tr;tr|=4;try{m4(A,c);var F=hy,V=NS(c.containerInfo),re=F.focusedElem,fe=F.selectionRange;if(V!==re&&re&&re.ownerDocument&&wS(re.ownerDocument.documentElement,re)){if(fe!==null&&Lv(re)){var je=fe.start,Oe=fe.end;if(Oe===void 0&&(Oe=je),"selectionStart"in re)re.selectionStart=je,re.selectionEnd=Math.min(Oe,re.value.length);else{var Le=re.ownerDocument||document,Be=Le&&Le.defaultView||window;if(Be.getSelection){var Fe=Be.getSelection(),st=re.textContent.length,mt=Math.min(fe.start,st),fr=fe.end===void 0?mt:Math.min(fe.end,st);!Fe.extend&&mt>fr&&(V=fr,fr=mt,mt=V);var ve=yS(re,mt),he=yS(re,fr);if(ve&&he&&(Fe.rangeCount!==1||Fe.anchorNode!==ve.node||Fe.anchorOffset!==ve.offset||Fe.focusNode!==he.node||Fe.focusOffset!==he.offset)){var ke=Le.createRange();ke.setStart(ve.node,ve.offset),Fe.removeAllRanges(),mt>fr?(Fe.addRange(ke),Fe.extend(he.node,he.offset)):(ke.setEnd(he.node,he.offset),Fe.addRange(ke))}}}}for(Le=[],Fe=re;Fe=Fe.parentNode;)Fe.nodeType===1&&Le.push({element:Fe,left:Fe.scrollLeft,top:Fe.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;re<Le.length;re++){var Pe=Le[re];Pe.element.scrollLeft=Pe.left,Pe.element.scrollTop=Pe.top}}dx=!!py,hy=py=null}finally{tr=S,z.p=g,W.T=h}}c.current=A,Da=2}}function O4(){if(Da===2){Da=0;var c=tc,A=Uu,h=(A.flags&8772)!==0;if((A.subtreeFlags&8772)!==0||h){h=W.T,W.T=null;var g=z.p;z.p=2;var S=tr;tr|=4;try{A4(c,A.alternate,A)}finally{tr=S,z.p=g,W.T=h}}Da=3}}function P4(){if(Da===4||Da===3){Da=0,qr();var c=tc,A=Uu,h=Xl,g=k4;(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?Da=5:(Da=0,Uu=tc=null,L4(c,c.pendingLanes));var S=c.pendingLanes;if(S===0&&(ec=null),et(h),A=A.stateNode,er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(jt,A,void 0,(A.current.flags&128)===128)}catch{}if(g!==null){A=W.T,S=z.p,z.p=2,W.T=null;try{for(var F=c.onRecoverableError,V=0;V<g.length;V++){var re=g[V];F(re.value,{componentStack:re.stack})}}finally{W.T=A,z.p=S}}(Xl&3)!==0&&Jh(),sl(c),S=c.pendingLanes,(h&261930)!==0&&(S&42)!==0?c===ty?M0++:(M0=0,ty=c):M0=0,R0(0)}}function L4(c,A){(c.pooledCacheLanes&=A)===0&&(A=c.pooledCache,A!=null&&(c.pooledCache=null,m0(A)))}function Jh(){return R4(),O4(),P4(),Q4()}function Q4(){if(Da!==5)return!1;var c=tc,A=Z1;Z1=0;var h=et(Xl),g=W.T,S=z.p;try{z.p=32>h?32:h,W.T=null,h=ey,ey=null;var F=tc,V=Xl;if(Da=0,Uu=tc=null,Xl=0,(tr&6)!==0)throw Error(a(331));var re=tr;if(tr|=4,w4(F.current),b4(F,F.current,V,h),tr=re,R0(0,!1),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(jt,F)}catch{}return!0}finally{z.p=S,W.T=g,L4(c,A)}}function H4(c,A,h){A=Ws(h,A),A=I1(c.stateNode,A,2),c=qo(c,A,2),c!==null&&($e(c,2),sl(c))}function sr(c,A,h){if(c.tag===3)H4(c,c,h);else for(;A!==null;){if(A.tag===3){H4(A,c,h);break}else if(A.tag===1){var g=A.stateNode;if(typeof A.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ec===null||!ec.has(g))){c=Ws(h,c),h=zB(2),g=qo(A,h,2),g!==null&&($B(h,g,A,c),$e(g,2),sl(g));break}}A=A.return}}function ny(c,A,h){var g=c.pingCache;if(g===null){g=c.pingCache=new M$;var S=new Set;g.set(A,S)}else S=g.get(A),S===void 0&&(S=new Set,g.set(A,S));S.has(h)||(Y1=!0,S.add(h),c=Q$.bind(null,c,A,h),A.then(c,c))}function Q$(c,A,h){var g=c.pingCache;g!==null&&g.delete(A),c.pingedLanes|=c.suspendedLanes&h,c.warmLanes&=~h,mr===c&&(Ot&h)===h&&(Jr===4||Jr===3&&(Ot&62914560)===Ot&&300>_t()-Gh?(tr&2)===0&&Mu(c,0):X1|=h,Du===Ot&&(Du=0)),sl(c)}function z4(c,A){A===0&&(A=Po()),c=Zc(c,A),c!==null&&($e(c,A),sl(c))}function H$(c){var A=c.memoizedState,h=0;A!==null&&(h=A.retryLane),z4(c,h)}function z$(c,A){var h=0;switch(c.tag){case 31:case 13:var g=c.stateNode,S=c.memoizedState;S!==null&&(h=S.retryLane);break;case 19:g=c.stateNode;break;case 22:g=c.stateNode._retryCache;break;default:throw Error(a(314))}g!==null&&g.delete(A),z4(c,h)}function $$(c,A){return kt(c,A)}var Zh=null,Ou=null,sy=!1,ex=!1,iy=!1,ac=0;function sl(c){c!==Ou&&c.next===null&&(Ou===null?Zh=Ou=c:Ou=Ou.next=c),ex=!0,sy||(sy=!0,G$())}function R0(c,A){if(!iy&&ex){iy=!0;do for(var h=!1,g=Zh;g!==null;){if(c!==0){var S=g.pendingLanes;if(S===0)var F=0;else{var V=g.suspendedLanes,re=g.pingedLanes;F=(1<<31-zr(42|c)+1)-1,F&=S&~(V&~re),F=F&201326741?F&201326741|1:F?F|2:0}F!==0&&(h=!0,K4(g,F))}else F=Ot,F=el(g,g===mr?F:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(F&3)===0||Ei(g,F)||(h=!0,K4(g,F));g=g.next}while(h);iy=!1}}function V$(){$4()}function $4(){ex=sy=!1;var c=0;ac!==0&&r7()&&(c=ac);for(var A=_t(),h=null,g=Zh;g!==null;){var S=g.next,F=V4(g,A);F===0?(g.next=null,h===null?Zh=S:h.next=S,S===null&&(Ou=h)):(h=g,(c!==0||(F&3)!==0)&&(ex=!0)),g=S}Da!==0&&Da!==5||R0(c),ac!==0&&(ac=0)}function V4(c,A){for(var h=c.suspendedLanes,g=c.pingedLanes,S=c.expirationTimes,F=c.pendingLanes&-62914561;0<F;){var V=31-zr(F),re=1<<V,fe=S[V];fe===-1?((re&h)===0||(re&g)!==0)&&(S[V]=qc(re,A)):fe<=A&&(c.expiredLanes|=re),F&=~re}if(A=mr,h=Ot,h=el(c,c===A?h:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),g=c.callbackNode,h===0||c===A&&(nr===2||nr===9)||c.cancelPendingCommit!==null)return g!==null&&g!==null&&Bt(g),c.callbackNode=null,c.callbackPriority=0;if((h&3)===0||Ei(c,h)){if(A=h&-h,A===c.callbackPriority)return A;switch(g!==null&&Bt(g),et(h)){case 2:case 8:h=Fa;break;case 32:h=xt;break;case 268435456:h=rt;break;default:h=xt}return g=G4.bind(null,c),h=kt(h,g),c.callbackPriority=A,c.callbackNode=h,A}return g!==null&&g!==null&&Bt(g),c.callbackPriority=2,c.callbackNode=null,2}function G4(c,A){if(Da!==0&&Da!==5)return c.callbackNode=null,c.callbackPriority=0,null;var h=c.callbackNode;if(Jh()&&c.callbackNode!==h)return null;var g=Ot;return g=el(c,c===mr?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),g===0?null:(E4(c,g,A),V4(c,_t()),c.callbackNode!=null&&c.callbackNode===h?G4.bind(null,c):null)}function K4(c,A){if(Jh())return null;E4(c,A,!0)}function G$(){n7(function(){(tr&6)!==0?kt(vr,V$):$4()})}function ly(){if(ac===0){var c=Nu;c===0&&(c=bs,bs<<=1,(bs&261888)===0&&(bs=256)),ac=c}return ac}function q4(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:oh(""+c)}function W4(c,A){var h=A.ownerDocument.createElement("input");return h.name=A.name,h.value=A.value,c.id&&h.setAttribute("form",c.id),A.parentNode.insertBefore(h,A),c=new FormData(c),h.parentNode.removeChild(h),c}function K$(c,A,h,g,S){if(A==="submit"&&h&&h.stateNode===S){var F=q4((S[ue]||null).action),V=g.submitter;V&&(A=(A=V[ue]||null)?q4(A.formAction):V.getAttribute("formAction"),A!==null&&(F=A,V=null));var re=new Ah("action","action",null,g,S);c.push({event:re,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ac!==0){var fe=V?W4(S,V):new FormData(S);E1(h,{pending:!0,data:fe,method:S.method,action:F},null,fe)}}else typeof F=="function"&&(re.preventDefault(),fe=V?W4(S,V):new FormData(S),E1(h,{pending:!0,data:fe,method:S.method,action:F},F,fe))},currentTarget:S}]})}}for(var oy=0;oy<$v.length;oy++){var cy=$v[oy],q$=cy.toLowerCase(),W$=cy[0].toUpperCase()+cy.slice(1);Si(q$,"on"+W$)}Si(jS,"onAnimationEnd"),Si(ES,"onAnimationIteration"),Si(SS,"onAnimationStart"),Si("dblclick","onDoubleClick"),Si("focusin","onFocus"),Si("focusout","onBlur"),Si(u$,"onTransitionRun"),Si(A$,"onTransitionStart"),Si(f$,"onTransitionCancel"),Si(BS,"onTransitionEnd"),Vs("onMouseEnter",["mouseout","mouseover"]),Vs("onMouseLeave",["mouseout","mouseover"]),Vs("onPointerEnter",["pointerout","pointerover"]),Vs("onPointerLeave",["pointerout","pointerover"]),Ur("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ur("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ur("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ur("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ur("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ur("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var O0="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(" "),Y$=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(O0));function Y4(c,A){A=(A&4)!==0;for(var h=0;h<c.length;h++){var g=c[h],S=g.event;g=g.listeners;e:{var F=void 0;if(A)for(var V=g.length-1;0<=V;V--){var re=g[V],fe=re.instance,je=re.currentTarget;if(re=re.listener,fe!==F&&S.isPropagationStopped())break e;F=re,S.currentTarget=je;try{F(S)}catch(Oe){hh(Oe)}S.currentTarget=null,F=fe}else for(V=0;V<g.length;V++){if(re=g[V],fe=re.instance,je=re.currentTarget,re=re.listener,fe!==F&&S.isPropagationStopped())break e;F=re,S.currentTarget=je;try{F(S)}catch(Oe){hh(Oe)}S.currentTarget=null,F=fe}}}}function Rt(c,A){var h=A[Ne];h===void 0&&(h=A[Ne]=new Set);var g=c+"__bubble";h.has(g)||(X4(A,c,2,!1),h.add(g))}function dy(c,A,h){var g=0;A&&(g|=4),X4(h,c,g,A)}var tx="_reactListening"+Math.random().toString(36).slice(2);function uy(c){if(!c[tx]){c[tx]=!0,yr.forEach(function(h){h!=="selectionchange"&&(Y$.has(h)||dy(h,!1,c),dy(h,!0,c))});var A=c.nodeType===9?c:c.ownerDocument;A===null||A[tx]||(A[tx]=!0,dy("selectionchange",!1,A))}}function X4(c,A,h,g){switch(j_(A)){case 2:var S=C7;break;case 8:S=k7;break;default:S=jy}h=S.bind(null,A,h,c),S=void 0,!Tv||A!=="touchstart"&&A!=="touchmove"&&A!=="wheel"||(S=!0),g?S!==void 0?c.addEventListener(A,h,{capture:!0,passive:S}):c.addEventListener(A,h,!0):S!==void 0?c.addEventListener(A,h,{passive:S}):c.addEventListener(A,h,!1)}function Ay(c,A,h,g,S){var F=g;if((A&1)===0&&(A&2)===0&&g!==null)e:for(;;){if(g===null)return;var V=g.tag;if(V===3||V===4){var re=g.stateNode.containerInfo;if(re===S)break;if(V===4)for(V=g.return;V!==null;){var fe=V.tag;if((fe===3||fe===4)&&V.stateNode.containerInfo===S)return;V=V.return}for(;re!==null;){if(V=Ge(re),V===null)return;if(fe=V.tag,fe===5||fe===6||fe===26||fe===27){g=F=V;continue e}re=re.parentNode}}g=g.return}rS(function(){var je=F,Oe=Bv(h),Le=[];e:{var Be=_S.get(c);if(Be!==void 0){var Fe=Ah,st=c;switch(c){case"keypress":if(dh(h)===0)break e;case"keydown":case"keyup":Fe=zz;break;case"focusin":st="focus",Fe=Uv;break;case"focusout":st="blur",Fe=Uv;break;case"beforeblur":case"afterblur":Fe=Uv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=sS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=Tz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=Gz;break;case jS:case ES:case SS:Fe=Dz;break;case BS:Fe=qz;break;case"scroll":case"scrollend":Fe=Bz;break;case"wheel":Fe=Yz;break;case"copy":case"cut":case"paste":Fe=Mz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=lS;break;case"toggle":case"beforetoggle":Fe=Jz}var mt=(A&4)!==0,fr=!mt&&(c==="scroll"||c==="scrollend"),ve=mt?Be!==null?Be+"Capture":null:Be;mt=[];for(var he=je,ke;he!==null;){var Pe=he;if(ke=Pe.stateNode,Pe=Pe.tag,Pe!==5&&Pe!==26&&Pe!==27||ke===null||ve===null||(Pe=i0(he,ve),Pe!=null&&mt.push(P0(he,Pe,ke))),fr)break;he=he.return}0<mt.length&&(Be=new Fe(Be,st,null,h,Oe),Le.push({event:Be,listeners:mt}))}}if((A&7)===0){e:{if(Be=c==="mouseover"||c==="pointerover",Fe=c==="mouseout"||c==="pointerout",Be&&h!==Sv&&(st=h.relatedTarget||h.fromElement)&&(Ge(st)||st[Ae]))break e;if((Fe||Be)&&(Be=Oe.window===Oe?Oe:(Be=Oe.ownerDocument)?Be.defaultView||Be.parentWindow:window,Fe?(st=h.relatedTarget||h.toElement,Fe=je,st=st?Ge(st):null,st!==null&&(fr=i(st),mt=st.tag,st!==fr||mt!==5&&mt!==27&&mt!==6)&&(st=null)):(Fe=null,st=je),Fe!==st)){if(mt=sS,Pe="onMouseLeave",ve="onMouseEnter",he="mouse",(c==="pointerout"||c==="pointerover")&&(mt=lS,Pe="onPointerLeave",ve="onPointerEnter",he="pointer"),fr=Fe==null?Be:ze(Fe),ke=st==null?Be:ze(st),Be=new mt(Pe,he+"leave",Fe,h,Oe),Be.target=fr,Be.relatedTarget=ke,Pe=null,Ge(Oe)===je&&(mt=new mt(ve,he+"enter",st,h,Oe),mt.target=ke,mt.relatedTarget=fr,Pe=mt),fr=Pe,Fe&&st)t:{for(mt=X$,ve=Fe,he=st,ke=0,Pe=ve;Pe;Pe=mt(Pe))ke++;Pe=0;for(var dt=he;dt;dt=mt(dt))Pe++;for(;0<ke-Pe;)ve=mt(ve),ke--;for(;0<Pe-ke;)he=mt(he),Pe--;for(;ke--;){if(ve===he||he!==null&&ve===he.alternate){mt=ve;break t}ve=mt(ve),he=mt(he)}mt=null}else mt=null;Fe!==null&&J4(Le,Be,Fe,mt,!1),st!==null&&fr!==null&&J4(Le,fr,st,mt,!0)}}e:{if(Be=je?ze(je):window,Fe=Be.nodeName&&Be.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&Be.type==="file")var qt=hS;else if(fS(Be))if(xS)qt=o$;else{qt=i$;var lt=s$}else Fe=Be.nodeName,!Fe||Fe.toLowerCase()!=="input"||Be.type!=="checkbox"&&Be.type!=="radio"?je&&Ev(je.elementType)&&(qt=hS):qt=l$;if(qt&&(qt=qt(c,je))){pS(Le,qt,h,Oe);break e}lt&&lt(c,Be,je),c==="focusout"&&je&&Be.type==="number"&&je.memoizedProps.value!=null&&jv(Be,"number",Be.value)}switch(lt=je?ze(je):window,c){case"focusin":(fS(lt)||lt.contentEditable==="true")&&(hu=lt,Qv=je,p0=null);break;case"focusout":p0=Qv=hu=null;break;case"mousedown":Hv=!0;break;case"contextmenu":case"mouseup":case"dragend":Hv=!1,CS(Le,h,Oe);break;case"selectionchange":if(d$)break;case"keydown":case"keyup":CS(Le,h,Oe)}var Ft;if(Rv)e:{switch(c){case"compositionstart":var Pt="onCompositionStart";break e;case"compositionend":Pt="onCompositionEnd";break e;case"compositionupdate":Pt="onCompositionUpdate";break e}Pt=void 0}else pu?uS(c,h)&&(Pt="onCompositionEnd"):c==="keydown"&&h.keyCode===229&&(Pt="onCompositionStart");Pt&&(oS&&h.locale!=="ko"&&(pu||Pt!=="onCompositionStart"?Pt==="onCompositionEnd"&&pu&&(Ft=aS()):(Qo=Oe,Fv="value"in Qo?Qo.value:Qo.textContent,pu=!0)),lt=rx(je,Pt),0<lt.length&&(Pt=new iS(Pt,c,null,h,Oe),Le.push({event:Pt,listeners:lt}),Ft?Pt.data=Ft:(Ft=AS(h),Ft!==null&&(Pt.data=Ft)))),(Ft=e$?t$(c,h):r$(c,h))&&(Pt=rx(je,"onBeforeInput"),0<Pt.length&&(lt=new iS("onBeforeInput","beforeinput",null,h,Oe),Le.push({event:lt,listeners:Pt}),lt.data=Ft)),K$(Le,c,je,h,Oe)}Y4(Le,A)})}function P0(c,A,h){return{instance:c,listener:A,currentTarget:h}}function rx(c,A){for(var h=A+"Capture",g=[];c!==null;){var S=c,F=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||F===null||(S=i0(c,h),S!=null&&g.unshift(P0(c,S,F)),S=i0(c,A),S!=null&&g.push(P0(c,S,F))),c.tag===3)return g;c=c.return}return[]}function X$(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function J4(c,A,h,g,S){for(var F=A._reactName,V=[];h!==null&&h!==g;){var re=h,fe=re.alternate,je=re.stateNode;if(re=re.tag,fe!==null&&fe===g)break;re!==5&&re!==26&&re!==27||je===null||(fe=je,S?(je=i0(h,F),je!=null&&V.unshift(P0(h,je,fe))):S||(je=i0(h,F),je!=null&&V.push(P0(h,je,fe)))),h=h.return}V.length!==0&&c.push({event:A,listeners:V})}var J$=/\r\n?/g,Z$=/\u0000|\uFFFD/g;function Z4(c){return(typeof c=="string"?c:""+c).replace(J$,`
`).replace(Z$,"")}function e_(c,A){return A=Z4(A),Z4(c)===A}function Ar(c,A,h,g,S,F){switch(h){case"children":typeof g=="string"?A==="body"||A==="textarea"&&g===""||uu(c,g):(typeof g=="number"||typeof g=="bigint")&&A!=="body"&&uu(c,""+g);break;case"className":ih(c,"class",g);break;case"tabIndex":ih(c,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":ih(c,h,g);break;case"style":eS(c,g,F);break;case"data":if(A!=="object"){ih(c,"data",g);break}case"src":case"href":if(g===""&&(A!=="a"||h!=="href")){c.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){c.removeAttribute(h);break}g=oh(""+g),c.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){c.setAttribute(h,"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 F=="function"&&(h==="formAction"?(A!=="input"&&Ar(c,A,"name",S.name,S,null),Ar(c,A,"formEncType",S.formEncType,S,null),Ar(c,A,"formMethod",S.formMethod,S,null),Ar(c,A,"formTarget",S.formTarget,S,null)):(Ar(c,A,"encType",S.encType,S,null),Ar(c,A,"method",S.method,S,null),Ar(c,A,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){c.removeAttribute(h);break}g=oh(""+g),c.setAttribute(h,g);break;case"onClick":g!=null&&(c.onclick=Ml);break;case"onScroll":g!=null&&Rt("scroll",c);break;case"onScrollEnd":g!=null&&Rt("scrollend",c);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(h=g.__html,h!=null){if(S.children!=null)throw Error(a(60));c.innerHTML=h}}break;case"multiple":c.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":c.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){c.removeAttribute("xlink:href");break}h=oh(""+g),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?c.setAttribute(h,""+g):c.removeAttribute(h);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":g&&typeof g!="function"&&typeof g!="symbol"?c.setAttribute(h,""):c.removeAttribute(h);break;case"capture":case"download":g===!0?c.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?c.setAttribute(h,g):c.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?c.setAttribute(h,g):c.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?c.removeAttribute(h):c.setAttribute(h,g);break;case"popover":Rt("beforetoggle",c),Rt("toggle",c),Zn(c,"popover",g);break;case"xlinkActuate":Ul(c,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ul(c,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ul(c,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ul(c,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ul(c,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ul(c,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ul(c,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ul(c,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ul(c,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Zn(c,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=Ez.get(h)||h,Zn(c,h,g))}}function fy(c,A,h,g,S,F){switch(h){case"style":eS(c,g,F);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(h=g.__html,h!=null){if(S.children!=null)throw Error(a(60));c.innerHTML=h}}break;case"children":typeof g=="string"?uu(c,g):(typeof g=="number"||typeof g=="bigint")&&uu(c,""+g);break;case"onScroll":g!=null&&Rt("scroll",c);break;case"onScrollEnd":g!=null&&Rt("scrollend",c);break;case"onClick":g!=null&&(c.onclick=Ml);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wr.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(S=h.endsWith("Capture"),A=h.slice(2,S?h.length-7:void 0),F=c[ue]||null,F=F!=null?F[h]:null,typeof F=="function"&&c.removeEventListener(A,F,S),typeof g=="function")){typeof F!="function"&&F!==null&&(h in c?c[h]=null:c.hasAttribute(h)&&c.removeAttribute(h)),c.addEventListener(A,g,S);break e}h in c?c[h]=g:g===!0?c.setAttribute(h,""):Zn(c,h,g)}}}function dn(c,A,h){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",c),Rt("load",c);var g=!1,S=!1,F;for(F in h)if(h.hasOwnProperty(F)){var V=h[F];if(V!=null)switch(F){case"src":g=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,A));default:Ar(c,A,F,V,h,null)}}S&&Ar(c,A,"srcSet",h.srcSet,h,null),g&&Ar(c,A,"src",h.src,h,null);return;case"input":Rt("invalid",c);var re=F=V=S=null,fe=null,je=null;for(g in h)if(h.hasOwnProperty(g)){var Oe=h[g];if(Oe!=null)switch(g){case"name":S=Oe;break;case"type":V=Oe;break;case"checked":fe=Oe;break;case"defaultChecked":je=Oe;break;case"value":F=Oe;break;case"defaultValue":re=Oe;break;case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(a(137,A));break;default:Ar(c,A,g,Oe,h,null)}}YE(c,F,re,fe,je,V,S,!1);return;case"select":Rt("invalid",c),g=V=F=null;for(S in h)if(h.hasOwnProperty(S)&&(re=h[S],re!=null))switch(S){case"value":F=re;break;case"defaultValue":V=re;break;case"multiple":g=re;default:Ar(c,A,S,re,h,null)}A=F,h=V,c.multiple=!!g,A!=null?du(c,!!g,A,!1):h!=null&&du(c,!!g,h,!0);return;case"textarea":Rt("invalid",c),F=S=g=null;for(V in h)if(h.hasOwnProperty(V)&&(re=h[V],re!=null))switch(V){case"value":g=re;break;case"defaultValue":S=re;break;case"children":F=re;break;case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(91));break;default:Ar(c,A,V,re,h,null)}JE(c,g,S,F);return;case"option":for(fe in h)if(h.hasOwnProperty(fe)&&(g=h[fe],g!=null))switch(fe){case"selected":c.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Ar(c,A,fe,g,h,null)}return;case"dialog":Rt("beforetoggle",c),Rt("toggle",c),Rt("cancel",c),Rt("close",c);break;case"iframe":case"object":Rt("load",c);break;case"video":case"audio":for(g=0;g<O0.length;g++)Rt(O0[g],c);break;case"image":Rt("error",c),Rt("load",c);break;case"details":Rt("toggle",c);break;case"embed":case"source":case"link":Rt("error",c),Rt("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(je in h)if(h.hasOwnProperty(je)&&(g=h[je],g!=null))switch(je){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,A));default:Ar(c,A,je,g,h,null)}return;default:if(Ev(A)){for(Oe in h)h.hasOwnProperty(Oe)&&(g=h[Oe],g!==void 0&&fy(c,A,Oe,g,h,void 0));return}}for(re in h)h.hasOwnProperty(re)&&(g=h[re],g!=null&&Ar(c,A,re,g,h,null))}function e7(c,A,h,g){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,F=null,V=null,re=null,fe=null,je=null,Oe=null;for(Fe in h){var Le=h[Fe];if(h.hasOwnProperty(Fe)&&Le!=null)switch(Fe){case"checked":break;case"value":break;case"defaultValue":fe=Le;default:g.hasOwnProperty(Fe)||Ar(c,A,Fe,null,g,Le)}}for(var Be in g){var Fe=g[Be];if(Le=h[Be],g.hasOwnProperty(Be)&&(Fe!=null||Le!=null))switch(Be){case"type":F=Fe;break;case"name":S=Fe;break;case"checked":je=Fe;break;case"defaultChecked":Oe=Fe;break;case"value":V=Fe;break;case"defaultValue":re=Fe;break;case"children":case"dangerouslySetInnerHTML":if(Fe!=null)throw Error(a(137,A));break;default:Fe!==Le&&Ar(c,A,Be,Fe,g,Le)}}kv(c,V,re,fe,je,Oe,F,S);return;case"select":Fe=V=re=Be=null;for(F in h)if(fe=h[F],h.hasOwnProperty(F)&&fe!=null)switch(F){case"value":break;case"multiple":Fe=fe;default:g.hasOwnProperty(F)||Ar(c,A,F,null,g,fe)}for(S in g)if(F=g[S],fe=h[S],g.hasOwnProperty(S)&&(F!=null||fe!=null))switch(S){case"value":Be=F;break;case"defaultValue":re=F;break;case"multiple":V=F;default:F!==fe&&Ar(c,A,S,F,g,fe)}A=re,h=V,g=Fe,Be!=null?du(c,!!h,Be,!1):!!g!=!!h&&(A!=null?du(c,!!h,A,!0):du(c,!!h,h?[]:"",!1));return;case"textarea":Fe=Be=null;for(re in h)if(S=h[re],h.hasOwnProperty(re)&&S!=null&&!g.hasOwnProperty(re))switch(re){case"value":break;case"children":break;default:Ar(c,A,re,null,g,S)}for(V in g)if(S=g[V],F=h[V],g.hasOwnProperty(V)&&(S!=null||F!=null))switch(V){case"value":Be=S;break;case"defaultValue":Fe=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(a(91));break;default:S!==F&&Ar(c,A,V,S,g,F)}XE(c,Be,Fe);return;case"option":for(var st in h)if(Be=h[st],h.hasOwnProperty(st)&&Be!=null&&!g.hasOwnProperty(st))switch(st){case"selected":c.selected=!1;break;default:Ar(c,A,st,null,g,Be)}for(fe in g)if(Be=g[fe],Fe=h[fe],g.hasOwnProperty(fe)&&Be!==Fe&&(Be!=null||Fe!=null))switch(fe){case"selected":c.selected=Be&&typeof Be!="function"&&typeof Be!="symbol";break;default:Ar(c,A,fe,Be,g,Fe)}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 mt in h)Be=h[mt],h.hasOwnProperty(mt)&&Be!=null&&!g.hasOwnProperty(mt)&&Ar(c,A,mt,null,g,Be);for(je in g)if(Be=g[je],Fe=h[je],g.hasOwnProperty(je)&&Be!==Fe&&(Be!=null||Fe!=null))switch(je){case"children":case"dangerouslySetInnerHTML":if(Be!=null)throw Error(a(137,A));break;default:Ar(c,A,je,Be,g,Fe)}return;default:if(Ev(A)){for(var fr in h)Be=h[fr],h.hasOwnProperty(fr)&&Be!==void 0&&!g.hasOwnProperty(fr)&&fy(c,A,fr,void 0,g,Be);for(Oe in g)Be=g[Oe],Fe=h[Oe],!g.hasOwnProperty(Oe)||Be===Fe||Be===void 0&&Fe===void 0||fy(c,A,Oe,Be,g,Fe);return}}for(var ve in h)Be=h[ve],h.hasOwnProperty(ve)&&Be!=null&&!g.hasOwnProperty(ve)&&Ar(c,A,ve,null,g,Be);for(Le in g)Be=g[Le],Fe=h[Le],!g.hasOwnProperty(Le)||Be===Fe||Be==null&&Fe==null||Ar(c,A,Le,Be,g,Fe)}function t_(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function t7(){if(typeof performance.getEntriesByType=="function"){for(var c=0,A=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var S=h[g],F=S.transferSize,V=S.initiatorType,re=S.duration;if(F&&re&&t_(V)){for(V=0,re=S.responseEnd,g+=1;g<h.length;g++){var fe=h[g],je=fe.startTime;if(je>re)break;var Oe=fe.transferSize,Le=fe.initiatorType;Oe&&t_(Le)&&(fe=fe.responseEnd,V+=Oe*(fe<re?1:(re-je)/(fe-je)))}if(--g,A+=8*(F+V)/(S.duration/1e3),c++,10<c)break}}if(0<c)return A/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var py=null,hy=null;function ax(c){return c.nodeType===9?c:c.ownerDocument}function r_(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function a_(c,A){if(c===0)switch(A){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&A==="foreignObject"?0:c}function xy(c,A){return c==="textarea"||c==="noscript"||typeof A.children=="string"||typeof A.children=="number"||typeof A.children=="bigint"||typeof A.dangerouslySetInnerHTML=="object"&&A.dangerouslySetInnerHTML!==null&&A.dangerouslySetInnerHTML.__html!=null}var my=null;function r7(){var c=window.event;return c&&c.type==="popstate"?c===my?!1:(my=c,!0):(my=null,!1)}var n_=typeof setTimeout=="function"?setTimeout:void 0,a7=typeof clearTimeout=="function"?clearTimeout:void 0,s_=typeof Promise=="function"?Promise:void 0,n7=typeof queueMicrotask=="function"?queueMicrotask:typeof s_<"u"?function(c){return s_.resolve(null).then(c).catch(s7)}:n_;function s7(c){setTimeout(function(){throw c})}function nc(c){return c==="head"}function i_(c,A){var h=A,g=0;do{var S=h.nextSibling;if(c.removeChild(h),S&&S.nodeType===8)if(h=S.data,h==="/$"||h==="/&"){if(g===0){c.removeChild(S),Hu(A);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")L0(c.ownerDocument.documentElement);else if(h==="head"){h=c.ownerDocument.head,L0(h);for(var F=h.firstChild;F;){var V=F.nextSibling,re=F.nodeName;F[Se]||re==="SCRIPT"||re==="STYLE"||re==="LINK"&&F.rel.toLowerCase()==="stylesheet"||h.removeChild(F),F=V}}else h==="body"&&L0(c.ownerDocument.body);h=S}while(h);Hu(A)}function l_(c,A){var h=c;c=0;do{var g=h.nextSibling;if(h.nodeType===1?A?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(A?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(c===0)break;c--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||c++;h=g}while(h)}function gy(c){var A=c.firstChild;for(A&&A.nodeType===10&&(A=A.nextSibling);A;){var h=A;switch(A=A.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":gy(h),He(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}c.removeChild(h)}}function i7(c,A,h,g){for(;c.nodeType===1;){var S=h;if(c.nodeName.toLowerCase()!==A.toLowerCase()){if(!g&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(g){if(!c[Se])switch(A){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(F=c.getAttribute("rel"),F==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(F!==S.rel||c.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||c.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||c.getAttribute("title")!==(S.title==null?null:S.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(F=c.getAttribute("src"),(F!==(S.src==null?null:S.src)||c.getAttribute("type")!==(S.type==null?null:S.type)||c.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&F&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(A==="input"&&c.type==="hidden"){var F=S.name==null?null:""+S.name;if(S.type==="hidden"&&c.getAttribute("name")===F)return c}else return c;if(c=ei(c.nextSibling),c===null)break}return null}function l7(c,A,h){if(A==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!h||(c=ei(c.nextSibling),c===null))return null;return c}function o_(c,A){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!A||(c=ei(c.nextSibling),c===null))return null;return c}function by(c){return c.data==="$?"||c.data==="$~"}function vy(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function o7(c,A){var h=c.ownerDocument;if(c.data==="$~")c._reactRetry=A;else if(c.data!=="$?"||h.readyState!=="loading")A();else{var g=function(){A(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),c._reactRetry=g}}function ei(c){for(;c!=null;c=c.nextSibling){var A=c.nodeType;if(A===1||A===3)break;if(A===8){if(A=c.data,A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"||A==="F!"||A==="F")break;if(A==="/$"||A==="/&")return null}}return c}var yy=null;function c_(c){c=c.nextSibling;for(var A=0;c;){if(c.nodeType===8){var h=c.data;if(h==="/$"||h==="/&"){if(A===0)return ei(c.nextSibling);A--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||A++}c=c.nextSibling}return null}function d_(c){c=c.previousSibling;for(var A=0;c;){if(c.nodeType===8){var h=c.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(A===0)return c;A--}else h!=="/$"&&h!=="/&"||A++}c=c.previousSibling}return null}function u_(c,A,h){switch(A=ax(h),c){case"html":if(c=A.documentElement,!c)throw Error(a(452));return c;case"head":if(c=A.head,!c)throw Error(a(453));return c;case"body":if(c=A.body,!c)throw Error(a(454));return c;default:throw Error(a(451))}}function L0(c){for(var A=c.attributes;A.length;)c.removeAttributeNode(A[0]);He(c)}var ti=new Map,A_=new Set;function nx(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Jl=z.d;z.d={f:c7,r:d7,D:u7,C:A7,L:f7,m:p7,X:x7,S:h7,M:m7};function c7(){var c=Jl.f(),A=Wh();return c||A}function d7(c){var A=Je(c);A!==null&&A.tag===5&&A.type==="form"?BB(A):Jl.r(c)}var Pu=typeof document>"u"?null:document;function f_(c,A,h){var g=Pu;if(g&&typeof A=="string"&&A){var S=Ks(A);S='link[rel="'+c+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),A_.has(S)||(A_.add(S),c={rel:c,crossOrigin:h,href:A},g.querySelector(S)===null&&(A=g.createElement("link"),dn(A,"link",c),it(A),g.head.appendChild(A)))}}function u7(c){Jl.D(c),f_("dns-prefetch",c,null)}function A7(c,A){Jl.C(c,A),f_("preconnect",c,A)}function f7(c,A,h){Jl.L(c,A,h);var g=Pu;if(g&&c&&A){var S='link[rel="preload"][as="'+Ks(A)+'"]';A==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+Ks(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+Ks(h.imageSizes)+'"]')):S+='[href="'+Ks(c)+'"]';var F=S;switch(A){case"style":F=Lu(c);break;case"script":F=Qu(c)}ti.has(F)||(c=p({rel:"preload",href:A==="image"&&h&&h.imageSrcSet?void 0:c,as:A},h),ti.set(F,c),g.querySelector(S)!==null||A==="style"&&g.querySelector(Q0(F))||A==="script"&&g.querySelector(H0(F))||(A=g.createElement("link"),dn(A,"link",c),it(A),g.head.appendChild(A)))}}function p7(c,A){Jl.m(c,A);var h=Pu;if(h&&c){var g=A&&typeof A.as=="string"?A.as:"script",S='link[rel="modulepreload"][as="'+Ks(g)+'"][href="'+Ks(c)+'"]',F=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":F=Qu(c)}if(!ti.has(F)&&(c=p({rel:"modulepreload",href:c},A),ti.set(F,c),h.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(H0(F)))return}g=h.createElement("link"),dn(g,"link",c),it(g),h.head.appendChild(g)}}}function h7(c,A,h){Jl.S(c,A,h);var g=Pu;if(g&&c){var S=Ye(g).hoistableStyles,F=Lu(c);A=A||"default";var V=S.get(F);if(!V){var re={loading:0,preload:null};if(V=g.querySelector(Q0(F)))re.loading=5;else{c=p({rel:"stylesheet",href:c,"data-precedence":A},h),(h=ti.get(F))&&wy(c,h);var fe=V=g.createElement("link");it(fe),dn(fe,"link",c),fe._p=new Promise(function(je,Oe){fe.onload=je,fe.onerror=Oe}),fe.addEventListener("load",function(){re.loading|=1}),fe.addEventListener("error",function(){re.loading|=2}),re.loading|=4,sx(V,A,g)}V={type:"stylesheet",instance:V,count:1,state:re},S.set(F,V)}}}function x7(c,A){Jl.X(c,A);var h=Pu;if(h&&c){var g=Ye(h).hoistableScripts,S=Qu(c),F=g.get(S);F||(F=h.querySelector(H0(S)),F||(c=p({src:c,async:!0},A),(A=ti.get(S))&&Ny(c,A),F=h.createElement("script"),it(F),dn(F,"link",c),h.head.appendChild(F)),F={type:"script",instance:F,count:1,state:null},g.set(S,F))}}function m7(c,A){Jl.M(c,A);var h=Pu;if(h&&c){var g=Ye(h).hoistableScripts,S=Qu(c),F=g.get(S);F||(F=h.querySelector(H0(S)),F||(c=p({src:c,async:!0,type:"module"},A),(A=ti.get(S))&&Ny(c,A),F=h.createElement("script"),it(F),dn(F,"link",c),h.head.appendChild(F)),F={type:"script",instance:F,count:1,state:null},g.set(S,F))}}function p_(c,A,h,g){var S=(S=ae.current)?nx(S):null;if(!S)throw Error(a(446));switch(c){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(A=Lu(h.href),h=Ye(S).hoistableStyles,g=h.get(A),g||(g={type:"style",instance:null,count:0,state:null},h.set(A,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){c=Lu(h.href);var F=Ye(S).hoistableStyles,V=F.get(c);if(V||(S=S.ownerDocument||S,V={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},F.set(c,V),(F=S.querySelector(Q0(c)))&&!F._p&&(V.instance=F,V.state.loading=5),ti.has(c)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},ti.set(c,h),F||g7(S,c,h,V.state))),A&&g===null)throw Error(a(528,""));return V}if(A&&g!==null)throw Error(a(529,""));return null;case"script":return A=h.async,h=h.src,typeof h=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=Qu(h),h=Ye(S).hoistableScripts,g=h.get(A),g||(g={type:"script",instance:null,count:0,state:null},h.set(A,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,c))}}function Lu(c){return'href="'+Ks(c)+'"'}function Q0(c){return'link[rel="stylesheet"]['+c+"]"}function h_(c){return p({},c,{"data-precedence":c.precedence,precedence:null})}function g7(c,A,h,g){c.querySelector('link[rel="preload"][as="style"]['+A+"]")?g.loading=1:(A=c.createElement("link"),g.preload=A,A.addEventListener("load",function(){return g.loading|=1}),A.addEventListener("error",function(){return g.loading|=2}),dn(A,"link",h),it(A),c.head.appendChild(A))}function Qu(c){return'[src="'+Ks(c)+'"]'}function H0(c){return"script[async]"+c}function x_(c,A,h){if(A.count++,A.instance===null)switch(A.type){case"style":var g=c.querySelector('style[data-href~="'+Ks(h.href)+'"]');if(g)return A.instance=g,it(g),g;var S=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(c.ownerDocument||c).createElement("style"),it(g),dn(g,"style",S),sx(g,h.precedence,c),A.instance=g;case"stylesheet":S=Lu(h.href);var F=c.querySelector(Q0(S));if(F)return A.state.loading|=4,A.instance=F,it(F),F;g=h_(h),(S=ti.get(S))&&wy(g,S),F=(c.ownerDocument||c).createElement("link"),it(F);var V=F;return V._p=new Promise(function(re,fe){V.onload=re,V.onerror=fe}),dn(F,"link",g),A.state.loading|=4,sx(F,h.precedence,c),A.instance=F;case"script":return F=Qu(h.src),(S=c.querySelector(H0(F)))?(A.instance=S,it(S),S):(g=h,(S=ti.get(F))&&(g=p({},h),Ny(g,S)),c=c.ownerDocument||c,S=c.createElement("script"),it(S),dn(S,"link",g),c.head.appendChild(S),A.instance=S);case"void":return null;default:throw Error(a(443,A.type))}else A.type==="stylesheet"&&(A.state.loading&4)===0&&(g=A.instance,A.state.loading|=4,sx(g,h.precedence,c));return A.instance}function sx(c,A,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=g.length?g[g.length-1]:null,F=S,V=0;V<g.length;V++){var re=g[V];if(re.dataset.precedence===A)F=re;else if(F!==S)break}F?F.parentNode.insertBefore(c,F.nextSibling):(A=h.nodeType===9?h.head:h,A.insertBefore(c,A.firstChild))}function wy(c,A){c.crossOrigin==null&&(c.crossOrigin=A.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=A.referrerPolicy),c.title==null&&(c.title=A.title)}function Ny(c,A){c.crossOrigin==null&&(c.crossOrigin=A.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=A.referrerPolicy),c.integrity==null&&(c.integrity=A.integrity)}var ix=null;function m_(c,A,h){if(ix===null){var g=new Map,S=ix=new Map;S.set(h,g)}else S=ix,g=S.get(h),g||(g=new Map,S.set(h,g));if(g.has(c))return g;for(g.set(c,null),h=h.getElementsByTagName(c),S=0;S<h.length;S++){var F=h[S];if(!(F[Se]||F[ie]||c==="link"&&F.getAttribute("rel")==="stylesheet")&&F.namespaceURI!=="http://www.w3.org/2000/svg"){var V=F.getAttribute(A)||"";V=c+V;var re=g.get(V);re?re.push(F):g.set(V,[F])}}return g}function g_(c,A,h){c=c.ownerDocument||c,c.head.insertBefore(h,A==="title"?c.querySelector("head > title"):null)}function b7(c,A,h){if(h===1||A.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof A.precedence!="string"||typeof A.href!="string"||A.href==="")break;return!0;case"link":if(typeof A.rel!="string"||typeof A.href!="string"||A.href===""||A.onLoad||A.onError)break;switch(A.rel){case"stylesheet":return c=A.disabled,typeof A.precedence=="string"&&c==null;default:return!0}case"script":if(A.async&&typeof A.async!="function"&&typeof A.async!="symbol"&&!A.onLoad&&!A.onError&&A.src&&typeof A.src=="string")return!0}return!1}function b_(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function v7(c,A,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=Lu(g.href),F=A.querySelector(Q0(S));if(F){A=F._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(c.count++,c=lx.bind(c),A.then(c,c)),h.state.loading|=4,h.instance=F,it(F);return}F=A.ownerDocument||A,g=h_(g),(S=ti.get(S))&&wy(g,S),F=F.createElement("link"),it(F);var V=F;V._p=new Promise(function(re,fe){V.onload=re,V.onerror=fe}),dn(F,"link",g),h.instance=F}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(h,A),(A=h.state.preload)&&(h.state.loading&3)===0&&(c.count++,h=lx.bind(c),A.addEventListener("load",h),A.addEventListener("error",h))}}var Cy=0;function y7(c,A){return c.stylesheets&&c.count===0&&cx(c,c.stylesheets),0<c.count||0<c.imgCount?function(h){var g=setTimeout(function(){if(c.stylesheets&&cx(c,c.stylesheets),c.unsuspend){var F=c.unsuspend;c.unsuspend=null,F()}},6e4+A);0<c.imgBytes&&Cy===0&&(Cy=62500*t7());var S=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&cx(c,c.stylesheets),c.unsuspend)){var F=c.unsuspend;c.unsuspend=null,F()}},(c.imgBytes>Cy?50:800)+A);return c.unsuspend=h,function(){c.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function lx(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cx(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var ox=null;function cx(c,A){c.stylesheets=null,c.unsuspend!==null&&(c.count++,ox=new Map,A.forEach(w7,c),ox=null,lx.call(c))}function w7(c,A){if(!(A.state.loading&4)){var h=ox.get(c);if(h)var g=h.get(null);else{h=new Map,ox.set(c,h);for(var S=c.querySelectorAll("link[data-precedence],style[data-precedence]"),F=0;F<S.length;F++){var V=S[F];(V.nodeName==="LINK"||V.getAttribute("media")!=="not all")&&(h.set(V.dataset.precedence,V),g=V)}g&&h.set(null,g)}S=A.instance,V=S.getAttribute("data-precedence"),F=h.get(V)||g,F===g&&h.set(null,S),h.set(V,S),this.count++,g=lx.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),F?F.parentNode.insertBefore(S,F.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(S,c.firstChild)),A.state.loading|=4}}var z0={$$typeof:C,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function N7(c,A,h,g,S,F,V,re,fe){this.tag=1,this.containerInfo=c,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=Dl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dl(0),this.hiddenUpdates=Dl(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=F,this.onRecoverableError=V,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=fe,this.incompleteTransitions=new Map}function v_(c,A,h,g,S,F,V,re,fe,je,Oe,Le){return c=new N7(c,A,h,V,fe,je,Oe,Le,re),A=1,F===!0&&(A|=24),F=ys(3,null,null,A),c.current=F,F.stateNode=c,A=a1(),A.refCount++,c.pooledCache=A,A.refCount++,F.memoizedState={element:g,isDehydrated:h,cache:A},l1(F),c}function y_(c){return c?(c=gu,c):gu}function w_(c,A,h,g,S,F){S=y_(S),g.context===null?g.context=S:g.pendingContext=S,g=Ko(A),g.payload={element:h},F=F===void 0?null:F,F!==null&&(g.callback=F),h=qo(c,g,A),h!==null&&(ss(h,c,A),y0(h,c,A))}function N_(c,A){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var h=c.retryLane;c.retryLane=h!==0&&h<A?h:A}}function ky(c,A){N_(c,A),(c=c.alternate)&&N_(c,A)}function C_(c){if(c.tag===13||c.tag===31){var A=Zc(c,67108864);A!==null&&ss(A,c,67108864),ky(c,67108864)}}function k_(c){if(c.tag===13||c.tag===31){var A=js();A=qe(A);var h=Zc(c,A);h!==null&&ss(h,c,A),ky(c,A)}}var dx=!0;function C7(c,A,h,g){var S=W.T;W.T=null;var F=z.p;try{z.p=2,jy(c,A,h,g)}finally{z.p=F,W.T=S}}function k7(c,A,h,g){var S=W.T;W.T=null;var F=z.p;try{z.p=8,jy(c,A,h,g)}finally{z.p=F,W.T=S}}function jy(c,A,h,g){if(dx){var S=Ey(g);if(S===null)Ay(c,A,g,ux,h),E_(c,g);else if(E7(S,c,A,h,g))g.stopPropagation();else if(E_(c,g),A&4&&-1<j7.indexOf(c)){for(;S!==null;){var F=Je(S);if(F!==null)switch(F.tag){case 3:if(F=F.stateNode,F.current.memoizedState.isDehydrated){var V=sn(F.pendingLanes);if(V!==0){var re=F;for(re.pendingLanes|=2,re.entangledLanes|=2;V;){var fe=1<<31-zr(V);re.entanglements[1]|=fe,V&=~fe}sl(F),(tr&6)===0&&(Kh=_t()+500,R0(0))}}break;case 31:case 13:re=Zc(F,2),re!==null&&ss(re,F,2),Wh(),ky(F,2)}if(F=Ey(g),F===null&&Ay(c,A,g,ux,h),F===S)break;S=F}S!==null&&g.stopPropagation()}else Ay(c,A,g,null,h)}}function Ey(c){return c=Bv(c),Sy(c)}var ux=null;function Sy(c){if(ux=null,c=Ge(c),c!==null){var A=i(c);if(A===null)c=null;else{var h=A.tag;if(h===13){if(c=l(A),c!==null)return c;c=null}else if(h===31){if(c=o(A),c!==null)return c;c=null}else if(h===3){if(A.stateNode.current.memoizedState.isDehydrated)return A.tag===3?A.stateNode.containerInfo:null;c=null}else A!==c&&(c=null)}}return ux=c,null}function j_(c){switch(c){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(Ir()){case vr:return 2;case Fa:return 8;case xt:case dr:return 32;case rt:return 268435456;default:return 32}default:return 32}}var By=!1,sc=null,ic=null,lc=null,$0=new Map,V0=new Map,oc=[],j7="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 E_(c,A){switch(c){case"focusin":case"focusout":sc=null;break;case"dragenter":case"dragleave":ic=null;break;case"mouseover":case"mouseout":lc=null;break;case"pointerover":case"pointerout":$0.delete(A.pointerId);break;case"gotpointercapture":case"lostpointercapture":V0.delete(A.pointerId)}}function G0(c,A,h,g,S,F){return c===null||c.nativeEvent!==F?(c={blockedOn:A,domEventName:h,eventSystemFlags:g,nativeEvent:F,targetContainers:[S]},A!==null&&(A=Je(A),A!==null&&C_(A)),c):(c.eventSystemFlags|=g,A=c.targetContainers,S!==null&&A.indexOf(S)===-1&&A.push(S),c)}function E7(c,A,h,g,S){switch(A){case"focusin":return sc=G0(sc,c,A,h,g,S),!0;case"dragenter":return ic=G0(ic,c,A,h,g,S),!0;case"mouseover":return lc=G0(lc,c,A,h,g,S),!0;case"pointerover":var F=S.pointerId;return $0.set(F,G0($0.get(F)||null,c,A,h,g,S)),!0;case"gotpointercapture":return F=S.pointerId,V0.set(F,G0(V0.get(F)||null,c,A,h,g,S)),!0}return!1}function S_(c){var A=Ge(c.target);if(A!==null){var h=i(A);if(h!==null){if(A=h.tag,A===13){if(A=l(h),A!==null){c.blockedOn=A,de(c.priority,function(){k_(h)});return}}else if(A===31){if(A=o(h),A!==null){c.blockedOn=A,de(c.priority,function(){k_(h)});return}}else if(A===3&&h.stateNode.current.memoizedState.isDehydrated){c.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}c.blockedOn=null}function Ax(c){if(c.blockedOn!==null)return!1;for(var A=c.targetContainers;0<A.length;){var h=Ey(c.nativeEvent);if(h===null){h=c.nativeEvent;var g=new h.constructor(h.type,h);Sv=g,h.target.dispatchEvent(g),Sv=null}else return A=Je(h),A!==null&&C_(A),c.blockedOn=h,!1;A.shift()}return!0}function B_(c,A,h){Ax(c)&&h.delete(A)}function S7(){By=!1,sc!==null&&Ax(sc)&&(sc=null),ic!==null&&Ax(ic)&&(ic=null),lc!==null&&Ax(lc)&&(lc=null),$0.forEach(B_),V0.forEach(B_)}function fx(c,A){c.blockedOn===A&&(c.blockedOn=null,By||(By=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,S7)))}var px=null;function __(c){px!==c&&(px=c,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){px===c&&(px=null);for(var A=0;A<c.length;A+=3){var h=c[A],g=c[A+1],S=c[A+2];if(typeof g!="function"){if(Sy(g||h)===null)continue;break}var F=Je(h);F!==null&&(c.splice(A,3),A-=3,E1(F,{pending:!0,data:S,method:h.method,action:g},g,S))}}))}function Hu(c){function A(fe){return fx(fe,c)}sc!==null&&fx(sc,c),ic!==null&&fx(ic,c),lc!==null&&fx(lc,c),$0.forEach(A),V0.forEach(A);for(var h=0;h<oc.length;h++){var g=oc[h];g.blockedOn===c&&(g.blockedOn=null)}for(;0<oc.length&&(h=oc[0],h.blockedOn===null);)S_(h),h.blockedOn===null&&oc.shift();if(h=(c.ownerDocument||c).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var S=h[g],F=h[g+1],V=S[ue]||null;if(typeof F=="function")V||__(h);else if(V){var re=null;if(F&&F.hasAttribute("formAction")){if(S=F,V=F[ue]||null)re=V.formAction;else if(Sy(S)!==null)continue}else re=V.action;typeof re=="function"?h[g+1]=re:(h.splice(g,3),g-=3),__(h)}}}function T_(){function c(F){F.canIntercept&&F.info==="react-transition"&&F.intercept({handler:function(){return new Promise(function(V){return S=V})},focusReset:"manual",scroll:"manual"})}function A(){S!==null&&(S(),S=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var F=navigation.currentEntry;F&&F.url!=null&&navigation.navigate(F.url,{state:F.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,S=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",A),navigation.addEventListener("navigateerror",A),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",A),navigation.removeEventListener("navigateerror",A),S!==null&&(S(),S=null)}}}function _y(c){this._internalRoot=c}hx.prototype.render=_y.prototype.render=function(c){var A=this._internalRoot;if(A===null)throw Error(a(409));var h=A.current,g=js();w_(h,g,c,A,null,null)},hx.prototype.unmount=_y.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var A=c.containerInfo;w_(c.current,2,null,c,null,null),Wh(),A[Ae]=null}};function hx(c){this._internalRoot=c}hx.prototype.unstable_scheduleHydration=function(c){if(c){var A=ee();c={blockedOn:null,target:c,priority:A};for(var h=0;h<oc.length&&A!==0&&A<oc[h].priority;h++);oc.splice(h,0,c),h===0&&S_(c)}};var F_=t.version;if(F_!=="19.2.4")throw Error(a(527,F_,"19.2.4"));z.findDOMNode=function(c){var A=c._reactInternals;if(A===void 0)throw typeof c.render=="function"?Error(a(188)):(c=Object.keys(c).join(","),Error(a(268,c)));return c=u(A),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var B7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xx=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xx.isDisabled&&xx.supportsFiber)try{jt=xx.inject(B7),er=xx}catch{}}return q0.createRoot=function(c,A){if(!s(c))throw Error(a(299));var h=!1,g="",S=PB,F=LB,V=QB;return A!=null&&(A.unstable_strictMode===!0&&(h=!0),A.identifierPrefix!==void 0&&(g=A.identifierPrefix),A.onUncaughtError!==void 0&&(S=A.onUncaughtError),A.onCaughtError!==void 0&&(F=A.onCaughtError),A.onRecoverableError!==void 0&&(V=A.onRecoverableError)),A=v_(c,1,!1,null,null,h,g,null,S,F,V,T_),c[Ae]=A.current,uy(c),new _y(A)},q0.hydrateRoot=function(c,A,h){if(!s(c))throw Error(a(299));var g=!1,S="",F=PB,V=LB,re=QB,fe=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onUncaughtError!==void 0&&(F=h.onUncaughtError),h.onCaughtError!==void 0&&(V=h.onCaughtError),h.onRecoverableError!==void 0&&(re=h.onRecoverableError),h.formState!==void 0&&(fe=h.formState)),A=v_(c,1,!0,A,h??null,g,S,fe,F,V,re,T_),A.context=y_(null),h=A.current,g=js(),g=qe(g),S=Ko(g),S.callback=null,qo(h,S,g),h=g,A.current.lanes=h,$e(A,h),sl(A),c[Ae]=A.current,uy(c),new hx(A)},q0.version="19.2.4",q0}var H_;function H7(){if(H_)return Dy.exports;H_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dy.exports=Q7(),Dy.exports}var z7=H7();const $7=El(z7);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const V7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G7=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),z_=e=>{const t=G7(e);return t.charAt(0).toUpperCase()+t.slice(1)},xM=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),K7=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var q7={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"};/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const W7=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:l,...o},d)=>j.createElement("svg",{ref:d,...q7,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:xM("lucide",s),...!i&&!K7(o)&&{"aria-hidden":"true"},...o},[...l.map(([u,f])=>j.createElement(u,f)),...Array.isArray(i)?i:[i]]));/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ie=(e,t)=>{const r=j.forwardRef(({className:a,...s},i)=>j.createElement(W7,{ref:i,iconNode:t,className:xM(`lucide-${V7(z_(e))}`,`lucide-${e}`,a),...s}));return r.displayName=z_(e),r};/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y7=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],La=Ie("activity",Y7);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const X7=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],J7=Ie("arrow-down-right",X7);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Z7=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],fs=Ie("arrow-left",Z7);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eV=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],kA=Ie("arrow-right-left",eV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tV=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Bc=Ie("arrow-right",tV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rV=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],ZC=Ie("arrow-up-right",rV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aV=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],$i=Ie("banknote",aV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nV=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],mM=Ie("book-open",nV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sV=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],$_=Ie("bookmark",sV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iV=[["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"}]],V_=Ie("bot",iV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lV=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],Gr=Ie("building-2",lV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oV=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],mi=Ie("calculator",oV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cV=[["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"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],gM=Ie("calendar-check",cV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dV=[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],G_=Ie("calendar-days",dV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uV=[["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"}]],Lr=Ie("calendar",uV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AV=[["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"}]],ek=Ie("camera",AV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fV=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],po=Ie("chart-column",fV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pV=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]],bM=Ie("chart-no-axes-column-increasing",pV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hV=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],Md=Ie("chart-pie",hV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xV=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],K_=Ie("check",xV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mV=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],tk=Ie("chevron-down",mV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gV=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Os=Ie("chevron-right",gV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bV=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],rk=Ie("chevron-up",bV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vV=[["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"}]],Cr=Ie("circle-alert",vV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],wV=Ie("circle-arrow-down",yV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],CV=Ie("circle-arrow-up",NV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kV=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Wi=Ie("circle-check-big",kV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],zt=Ie("circle-check",jV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EV=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],SV=Ie("circle-play",EV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ak=Ie("circle-plus",BV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _V=[["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"}]],TV=Ie("circle-question-mark",_V);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],vM=Ie("circle-x",FV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IV=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]],DV=Ie("circuit-board",IV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UV=[["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"}]],Xd=Ie("clipboard-list",UV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MV=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Oc=Ie("clock",MV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RV=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],OV=Ie("code-xml",RV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PV=[["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"}]],lb=Ie("copy",PV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LV=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Oy=Ie("cpu",LV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QV=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],_p=Ie("credit-card",QV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HV=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],zV=Ie("database-zap",HV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $V=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],ko=Ie("database",$V);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VV=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],GV=Ie("delete",VV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KV=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],wn=Ie("dollar-sign",KV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qV=[["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"}]],Yi=Ie("download",qV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WV=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],YV=Ie("earth",WV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XV=[["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"}]],yM=Ie("external-link",XV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JV=[["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"}]],_c=Ie("eye",JV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZV=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Jd=Ie("file-code",ZV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eG=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],$f=Ie("file-search",eG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tG=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],gl=Ie("file-spreadsheet",tG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rG=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],gr=Ie("file-text",rG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aG=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],nG=Ie("fingerprint-pattern",aG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sG=[["circle",{cx:"15",cy:"19",r:"2",key:"u2pros"}],["path",{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1",key:"1jj40k"}],["path",{d:"M15 11v-1",key:"cntcp"}],["path",{d:"M15 17v-2",key:"1279jj"}]],Rm=Ie("folder-archive",sG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iG=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],q_=Ie("folder",iG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lG=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],nk=Ie("funnel",lG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oG=[["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"}]],ja=Ie("globe",oG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cG=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],Zd=Ie("handshake",cG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dG=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],uG=Ie("hard-drive",dG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AG=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Ba=Ie("history",AG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fG=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],pG=Ie("house",fG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hG=[["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"}]],Tp=Ie("image",hG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Nn=Ie("info",xG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mG=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],jA=Ie("key",mG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gG=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],xr=Ie("landmark",gG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bG=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Pc=Ie("layers",bG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vG=[["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"}]],yG=Ie("layout-dashboard",vG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wG=[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["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"}]],NG=Ie("layout-panel-left",wG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CG=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],Om=Ie("layout-template",CG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kG=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Vf=Ie("link",kG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jG=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],wM=Ie("list-filter",jG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EG=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Vi=Ie("loader-circle",EG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SG=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Qt=Ie("loader",SG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BG=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],NM=Ie("lock-open",BG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _G=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Rd=Ie("lock",_G);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TG=[["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"}]],Pm=Ie("log-out",TG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FG=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Qr=Ie("mail",FG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IG=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],CM=Ie("map-pin",IG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DG=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],Gf=Ie("megaphone",DG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UG=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],MG=Ie("menu",UG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RG=[["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"}]],vn=Ie("message-circle",RG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OG=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["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"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],PG=Ie("message-square-quote",OG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LG=[["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"}]],QG=Ie("message-square",LG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HG=[["rect",{width:"20",height:"15",x:"2",y:"4",rx:"2",key:"2no95f"}],["rect",{width:"8",height:"7",x:"6",y:"8",rx:"1",key:"zh9wx"}],["path",{d:"M18 8v7",key:"o5zi4n"}],["path",{d:"M6 19v2",key:"1loha6"}],["path",{d:"M18 19v2",key:"1dawf0"}]],zG=Ie("microwave",HG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $G=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],VG=Ie("octagon-alert",$G);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GG=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],sk=Ie("panels-top-left",GG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KG=[["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"}]],vl=Ie("pencil",KG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qG=[["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"}]],ps=Ie("percent",qG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WG=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],ik=Ie("phone",WG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YG=[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]],Sl=Ie("plane",YG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XG=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],JG=Ie("play",XG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZG=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Cn=Ie("plus",ZG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eK=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],yt=Ie("printer",eK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tK=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Kf=Ie("radio",tK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rK=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],aa=Ie("receipt-text",rK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aK=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],nK=Ie("receipt",aK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sK=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ot=Ie("refresh-cw",sK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iK=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],lK=Ie("rotate-cw",iK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oK=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],qn=Ie("save",oK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cK=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],Fp=Ie("scale",cK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dK=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],uK=Ie("scissors",dK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AK=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Xt=Ie("search",AK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fK=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],pK=Ie("send-horizontal",fK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hK=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Gi=Ie("send",hK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xK=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]],mK=Ie("server-crash",xK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gK=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],bK=Ie("server",gK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vK=[["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"}]],ob=Ie("settings",vK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yK=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],cb=Ie("settings-2",yK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wK=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],_a=Ie("share-2",wK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NK=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],hs=Ie("shield-alert",NK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CK=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ea=Ie("shield-check",CK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kK=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],kM=Ie("shield-x",kK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jK=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ho=Ie("shield",jK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EK=[["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"}]],Lc=Ie("star",EK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SK=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],yl=Ie("table",SK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BK=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],_K=Ie("tag",BK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],lk=Ie("target",TK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FK=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ok=Ie("terminal",FK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IK=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],jM=Ie("toggle-left",IK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DK=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],EM=Ie("toggle-right",DK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UK=[["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"}]],Ta=Ie("trash-2",UK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MK=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],db=Ie("trending-down",MK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RK=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ha=Ie("trending-up",RK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OK=[["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"}]],na=Ie("triangle-alert",OK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PK=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],ub=Ie("truck",PK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LK=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],QK=Ie("type",LK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HK=[["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"}]],OA=Ie("upload",HK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zK=[["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"}]],$K=Ie("user-check",zK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VK=[["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"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],GK=Ie("user-minus",VK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KK=[["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"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],oN=Ie("user-plus",KK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qK=[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]],PA=Ie("user-search",qK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WK=[["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"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],YK=Ie("user-x",WK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XK=[["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"}]],eu=Ie("user",XK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JK=[["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"}]],Oi=Ie("users",JK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZK=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Tc=Ie("wallet",ZK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eq=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],W_=Ie("waves",eq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tq=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],qf=Ie("wrench",tq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rq=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ft=Ie("x",rq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aq=[["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"}]],sa=Ie("zap",aq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nq=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],sq=Ie("zoom-in",nq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iq=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],lq=Ie("zoom-out",iq),oq="https://condominios.microautomatismo.com",cq="/CBO/SanDiego/AvDJC/UrbVDO/Tejar/",la=`${oq}${cq}`,ye=`${la}api`,Ps="Kernel V4.2.04 MC/MB",Ra="El Tejar Alterno-Microautomatismo",Ue=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Er=()=>{const e=new Date;return new Intl.DateTimeFormat("en-CA",{timeZone:"America/Caracas",year:"numeric",month:"2-digit",day:"2-digit"}).format(e)},Ve=async(e,t={})=>{const r=t.method||"GET",a={...t,mode:"cors",credentials:"include",cache:"no-cache",headers:{"Content-Type":"application/json",Accept:"application/json",...t.headers}};try{const s=await fetch(e,a);if(s.status===404){if(r==="GET")return{ok:!0,status:200,json:async()=>[]};throw new Error("Endpoint no encontrado (404).")}if(!s.ok){const i=await s.text();let l=`Error ${s.status}`;try{const o=JSON.parse(i);l=o.error||o.message||l}catch{l=i.substring(0,100)||l}throw new Error(l)}return s}catch(s){throw s}},we={getInitialDebtData:async()=>(await(await Ve(`${ye}/get_initial_debt_data.php`)).json()).data||[],getArchivedAgreements:async()=>(await(await Ve(`${ye}/get_archived_agreements.php`)).json()).data||[],getModuleStatus:async()=>await(await Ve(`${ye}/get_modules.php`)).json(),saveModuleStatus:async(e,t)=>await Ve(`${ye}/save_module_status.php`,{method:"POST",body:JSON.stringify({moduleId:e,isActive:t})}),getFinancialTotals:async()=>await(await Ve(`${ye}/get_financial_totals.php`)).json(),runDiagnostics:async e=>await(await Ve(`${ye}/system_diagnostics.php`,{method:"POST",body:JSON.stringify({action:e})})).json(),getProviders:async()=>await(await Ve(`${ye}/get_providers.php`)).json(),saveProvider:async e=>await Ve(`${ye}/save_provider.php`,{method:"POST",body:JSON.stringify(e)}),deleteProvider:async e=>await Ve(`${ye}/delete_provider.php`,{method:"POST",body:JSON.stringify({rif:e})}),getProviderHistory:async e=>await(await Ve(`${ye}/get_provider_history.php?rif=${e}`)).json(),getAuditLogs:async()=>await(await Ve(`${ye}/get_logs.php`)).json(),clearAuditLogs:async()=>await Ve(`${ye}/clear_logs.php`,{method:"POST"}),logNavigation:async e=>{try{await fetch(`${ye}/log_navigation.php`,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({module:e})})}catch{}},sendWelcomeEmail:async e=>await Ve(`${ye}/send_welcome_email.php`,{method:"POST",body:JSON.stringify({userId:e})}),getExchangeRateHistory:async()=>{try{const t=await(await Ve(`${ye}/get_exchange_rates.php`)).json();return Array.isArray(t)?t:[]}catch{return[]}},saveExchangeRate:async e=>await Ve(`${ye}/save_exchange_rate.php`,{method:"POST",body:JSON.stringify(e)}),saveExchangeRateBatch:async e=>await Ve(`${ye}/save_exchange_rate_batch.php`,{method:"POST",body:JSON.stringify({rates:e})}),syncExternalDb:async()=>await Ve(`${ye}/sync_external_db.php`,{method:"POST"}),syncLiveRate:async()=>await(await Ve(`${ye}/sync_external_db.php`,{method:"POST"})).json(),syncMissingRates:async e=>({success:!1,message:"Auto-sync deshabilitado"}),getReservations:async()=>{const t=await(await Ve(`${ye}/get_reservations.php`)).json();return Array.isArray(t)?t:[]},saveReservation:async e=>await Ve(`${ye}/save_reservation.php`,{method:"POST",body:JSON.stringify(e)}),updateReservationStatus:async(e,t)=>await Ve(`${ye}/update_reservation_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteReservation:async e=>await Ve(`${ye}/delete_reservation.php`,{method:"POST",body:JSON.stringify({id:e})}),getAnnouncements:async()=>{const t=await(await Ve(`${ye}/get_announcements.php`)).json();return Array.isArray(t)?t:[]},saveAnnouncement:async e=>await Ve(`${ye}/save_announcement.php`,{method:"POST",body:JSON.stringify(e)}),updateAnnouncementStatus:async(e,t)=>await Ve(`${ye}/update_announcement_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteAnnouncement:async e=>await Ve(`${ye}/delete_announcement.php`,{method:"POST",body:JSON.stringify({id:e})}),getMaintenanceRequests:async()=>{const t=await(await Ve(`${ye}/get_maintenance.php`)).json();return Array.isArray(t)?t:[]},saveMaintenanceRequest:async e=>await Ve(`${ye}/save_maintenance.php`,{method:"POST",body:JSON.stringify(e)}),updateMaintenanceStatus:async(e,t)=>await Ve(`${ye}/update_maintenance_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteMaintenance:async e=>await Ve(`${ye}/delete_maintenance.php`,{method:"POST",body:JSON.stringify({id:e})}),getSystemSettings:async()=>await(await Ve(`${ye}/get_settings.php`)).json(),updateSystemSetting:async(e,t)=>await Ve(`${ye}/update_setting.php`,{method:"POST",body:JSON.stringify({key:e,value:t})}),toggleMaintenanceMode:async e=>await(await Ve(`${ye}/toggle_maintenance_mode.php`,{method:"POST",body:JSON.stringify({enabled:e})})).json(),checkSession:async()=>{try{const t=await(await Ve(`${ye}/session.php`)).json();return t.active?t.user:null}catch{return null}},login:async e=>{const r=await(await Ve(`${ye}/login.php`,{method:"POST",body:JSON.stringify(e)})).json();if(!r.user)throw new Error(r.error||"Fallo de autenticación");return r.user},logout:async()=>{try{await Ve(`${ye}/logout.php`,{method:"POST"})}catch{console.warn("Logout API failed, continuing with local cleanup")}},getFees:async()=>{const t=await(await Ve(`${ye}/get_fees.php`)).json();return Array.isArray(t)?t:[]},saveFee:async e=>await Ve(`${ye}/save_fee.php`,{method:"POST",body:JSON.stringify(e)}),deleteFee:async e=>await Ve(`${ye}/delete_fee.php`,{method:"POST",body:JSON.stringify({id:e})}),registerPayment:async(e,t,r,a,s,i,l,o)=>await Ve(`${ye}/register_payment.php`,{method:"POST",body:JSON.stringify({feeId:e,propertyId:t,amount:r,method:a,reference:s,date:i,slot:l,amount_bs:o})}),getProperties:async()=>{const t=await(await Ve(`${ye}/get_properties.php`)).json();return Array.isArray(t)?t:[]},saveProperty:async e=>await Ve(`${ye}/save_property.php`,{method:"POST",body:JSON.stringify(e)}),deleteProperty:async e=>await Ve(`${ye}/delete_property.php`,{method:"POST",body:JSON.stringify({id:e})}),getMyProperty:async e=>await(await Ve(`${ye}/get_my_status.php`)).json(),getResidents:async()=>{const t=await(await Ve(`${ye}/get_residents.php`)).json();return Array.isArray(t)?t:[]},saveResident:async e=>await Ve(`${ye}/save_resident.php`,{method:"POST",body:JSON.stringify(e)}),deleteResident:async e=>await Ve(`${ye}/delete_resident.php`,{method:"POST",body:JSON.stringify({id:e})}),getUsers:async()=>{const t=await(await Ve(`${ye}/get_users.php`)).json();return Array.isArray(t)?t:[]},saveUser:async e=>await Ve(`${ye}/save_user.php`,{method:"POST",body:JSON.stringify(e)}),deleteUser:async e=>await Ve(`${ye}/delete_user.php`,{method:"POST",body:JSON.stringify({id:e})}),getDashboardStats:async()=>await(await Ve(`${ye}/get_dashboard_stats.php`)).json(),getBankTransactions:async e=>{const t=e?`${ye}/get_bank_transactions.php?role=${e}`:`${ye}/get_bank_transactions.php`,a=await(await Ve(t)).json();return Array.isArray(a)?a:[]},getCriticalBills:async()=>{const t=await(await Ve(`${ye}/get_critical_bills.php`)).json();return Array.isArray(t)?t:[]},getBankPreciseTransactions:async(e,t)=>{const a=await(await Ve(`${ye}/get_bank_precise.php?month=${e}&year=${t}`)).json();return Array.isArray(a.transactions)?a.transactions:[]},getPendingBills:async()=>{const t=await(await Ve(`${ye}/get_pending_bills.php`)).json();return Array.isArray(t)?t:[]},savePendingBill:async e=>await Ve(`${ye}/save_pending_bill.php`,{method:"POST",body:JSON.stringify(e)}),deletePendingBill:async e=>await Ve(`${ye}/delete_pending_bill.php`,{method:"POST",body:JSON.stringify({id:e})}),payPendingBill:async(e,t,r,a)=>await Ve(`${ye}/pay_pending_bill.php`,{method:"POST",body:JSON.stringify({id:e,reference:t,source:r,date:a})}),getPolls:async()=>{const t=await(await Ve(`${ye}/get_polls.php`)).json();return Array.isArray(t)?t:[]},savePoll:async e=>await Ve(`${ye}/save_poll.php`,{method:"POST",body:JSON.stringify(e)}),closePoll:async e=>await Ve(`${ye}/close_poll.php`,{method:"POST",body:JSON.stringify({id:e})}),deletePoll:async e=>await Ve(`${ye}/delete_poll.php`,{method:"POST",body:JSON.stringify({id:e})}),submitVote:async(e,t)=>await Ve(`${ye}/submit_vote.php`,{method:"POST",body:JSON.stringify({pollId:e,answers:t})}),getDataForms:async()=>{const t=await(await Ve(`${ye}/get_data_forms.php`)).json();return Array.isArray(t)?t:[]},saveDataForm:async e=>await Ve(`${ye}/save_data_form.php`,{method:"POST",body:JSON.stringify(e)}),deleteDataForm:async e=>await Ve(`${ye}/delete_data_form.php`,{method:"POST",body:JSON.stringify({id:e})}),toggleDataFormStatus:async e=>await Ve(`${ye}/toggle_data_form_status.php`,{method:"POST",body:JSON.stringify({id:e})}),submitDataFormResponse:async(e,t)=>await Ve(`${ye}/submit_data_form_response.php`,{method:"POST",body:JSON.stringify({formId:e,data:t})}),getLiveVotes:async()=>{const t=await(await Ve(`${ye}/get_live_votes.php`)).json();return Array.isArray(t)?t:[]},saveLiveVote:async e=>await Ve(`${ye}/save_live_vote.php`,{method:"POST",body:JSON.stringify(e)}),updateLiveVoteStatus:async(e,t)=>await Ve(`${ye}/update_live_vote_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),castLiveVote:async(e,t)=>await Ve(`${ye}/cast_live_vote.php`,{method:"POST",body:JSON.stringify({voteId:e,optionId:t})}),deleteLiveVote:async e=>await Ve(`${ye}/delete_live_vote.php`,{method:"POST",body:JSON.stringify({id:e})}),getAssemblies:async()=>{const t=await(await Ve(`${ye}/get_assemblies.php`)).json();return Array.isArray(t)?t:[]},saveAssembly:async e=>await Ve(`${ye}/save_assembly.php`,{method:"POST",body:JSON.stringify(e)}),deleteAssembly:async e=>await Ve(`${ye}/delete_assembly.php`,{method:"POST",body:JSON.stringify({id:e})}),getReserveFundHistory:async(e,t)=>{const r=e&&t?`${ye}/get_reserve_fund_history.php?start=${e}&end=${t}`:`${ye}/get_reserve_fund_history.php`;return await(await Ve(r)).json()},getDetailedExcelReport:async(e,t,r)=>await(await Ve(`${ye}/get_detailed_excel_report.php?month=${e}&year=${t}&type=${r}`)).json(),getCreditBalances:async()=>{const t=await(await Ve(`${ye}/get_credit_balances.php`)).json();return Array.isArray(t.data)?t.data:[]},exportDatabaseSQL:()=>{window.open(`${ye}/export_sql.php`,"_blank")},getMonthlyCollectionHistory:async()=>{const t=await(await Ve(`${ye}/get_monthly_collection.php`)).json();return Array.isArray(t)?t:[]},syncMonthlyCollection:async()=>await(await Ve(`${ye}/sync_monthly_collection.php`)).json(),deleteMonthlyCollection:async e=>await(await Ve(`${ye}/delete_monthly_collection.php?id=${e}`)).json(),getPaymentReports:async e=>{const t=e?`${ye}/get_payment_reports.php?propertyId=${e}`:`${ye}/get_payment_reports.php`,a=await(await Ve(t)).json();return Array.isArray(a)?a:[]},savePaymentReport:async e=>await Ve(`${ye}/report_payment_owner.php`,{method:"POST",body:JSON.stringify(e)}),updatePaymentReportStatus:async(e,t,r,a,s)=>await Ve(`${ye}/update_payment_report_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t,observations:r,assignedTo:a,targetId:s})}),getDebtList:async(e,t)=>await(await Ve(`${ye}/get_debt_list.php?month=${e}&year=${t}`)).json(),getSolventList:async(e,t)=>await(await Ve(`${ye}/get_solvent_list.php?month=${e}&year=${t}`)).json(),getSaldoDesglosado:async(e,t,r)=>await(await Ve(`${ye}/get_saldo_desglosado.php?propertyId=${e}&month=${t}&year=${r}`)).json(),saveSaldoDesglosadoVisibility:async e=>await Ve(`${ye}/save_module_status.php`,{method:"POST",body:JSON.stringify({moduleId:"saldo-desglosado",isActive:e})})},SM=j.createContext(void 0),dq=({children:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState([]),[i,l]=j.useState([]),[o,d]=j.useState([]),[u,f]=j.useState([]),[p,x]=j.useState([]),[m,b]=j.useState([]),[v,y]=j.useState([]),[k,_]=j.useState([]),[C,E]=j.useState([]),[T,B]=j.useState([]),[I,M]=j.useState([]),[U,D]=j.useState([]),[L,R]=j.useState([]),[Q,G]=j.useState([]),[K,W]=j.useState(null),[z,Z]=j.useState([]),[Y,te]=j.useState(!1),[O,P]=j.useState({incomeTransferPercent:0,expenseTransferPercent:0}),[q,H]=j.useState(!1),[J,ae]=j.useState(null),oe=j.useMemo(()=>{if(!v||v.length===0)return 1;const Tt=[...v].sort((Yr,Ia)=>new Date(Ia.date).getTime()-new Date(Yr.date).getTime())[0];return Tt.pmValue&&Tt.pmValue>0?Tt.pmValue:Tt.amValue||1},[v]),ce=j.useCallback(async $e=>{const Tt=$e||J;H(!0);try{const[Yr,Ia,xe,qe,et,ee,de,se,ie,ue,Ae,Ne,Me,Ce,Ee,Se,He,Ge]=await Promise.all([we.getFees().catch(()=>[]),we.getProperties().catch(()=>[]),we.getResidents().catch(()=>[]),Tt==="admin"||Tt==="programmer"?we.getUsers().catch(()=>[]):Promise.resolve([]),we.getProviders().catch(()=>[]),Tt==="admin"||Tt==="programmer"?we.getBankTransactions("admin").catch(()=>[]):Promise.resolve([]),we.getExchangeRateHistory().catch(()=>[]),we.getPendingBills().catch(()=>[]),we.getPolls().catch(()=>[]),we.getDataForms().catch(()=>[]),we.getLiveVotes().catch(()=>[]),we.getReservations().catch(()=>[]),we.getAnnouncements().catch(()=>[]),we.getMaintenanceRequests().catch(()=>[]),we.getSystemSettings().catch(()=>({pool_enabled:"false"})),we.getAssemblies().catch(()=>[]),we.getFinancialTotals().catch(()=>null),we.getModuleStatus().catch(()=>[])]);r(Yr),s(Ia),l(xe),d(qe),f(et),x(ee),y(de),b(se),_(ie),E(ue),B(Ae),M(Ne),D(Me),R(Ce),te(Ee.pool_enabled==="true"),G(Se),W(He),Z(Ge)}catch(Yr){console.error(Yr)}finally{H(!1)}},[J]),ne=j.useCallback($e=>{ae($e)},[]),le=async($e,Tt)=>{await we.saveModuleStatus($e,Tt),await ce()},ge=async $e=>{await we.saveReservation($e),await ce()},X=async($e,Tt)=>{await we.updateReservationStatus($e,Tt),await ce()},pe=async $e=>{await we.deleteReservation($e),await ce()},be=async $e=>{await we.saveAnnouncement($e),await ce()},me=async($e,Tt)=>{await we.updateAnnouncementStatus($e,Tt),await ce()},_e=async $e=>{await we.deleteAnnouncement($e),await ce()},Te=async $e=>{await we.saveMaintenanceRequest($e),await ce()},Xe=async($e,Tt)=>{await we.updateMaintenanceStatus($e,Tt),await ce()},At=async $e=>{await we.deleteMaintenance($e),await ce()},kt=async $e=>{await we.updateSystemSetting("pool_enabled",String($e)),await ce()},Bt=async $e=>{await we.saveAssembly($e),await ce()},Kr=async $e=>{await we.deleteAssembly($e),await ce()},qr=async $e=>{await we.saveFee($e),await ce()},_t=async $e=>{await we.deleteFee($e),await ce()},Ir=async($e,Tt,Yr,Ia,xe,qe,et,ee)=>{const de=await fetch(`${ye}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:$e,propertyId:Tt,amount:Yr,method:Ia,reference:xe,date:qe,slot:et,amount_bs:ee})}),se=await de.json();if(!de.ok)throw new Error(se.error||"Fallo crítico en motor de pagos");await ce()},vr=async $e=>{const Tt=await fetch(`${ye}/delete_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:$e})}),Yr=await Tt.json();if(!Tt.ok)throw new Error(Yr.error||"Fallo al anular pago");await ce()},Fa=async($e,Tt,Yr)=>{const Ia=await fetch(`${ye}/update_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:$e,propertyId:Tt,payment:Yr})}),xe=await Ia.json();if(!Ia.ok)throw new Error(xe.error||"Fallo al actualizar pago");await ce()},xt=async $e=>{},dr=async $e=>{},rt=async $e=>{},Ct=async $e=>{await we.savePendingBill($e),await ce()},Vt=async $e=>{await we.deletePendingBill($e),await ce()},jt=async $e=>{await we.savePendingBill($e),await ce()},er=async($e,Tt,Yr,Ia)=>{await we.payPendingBill($e,Tt,Yr,Ia),await ce()},Dr=async($e,Tt,Yr)=>{await we.updateSystemSetting("receipt_sent","true"),await ce()},zr=$e=>P($e),Jn=async $e=>{await we.savePoll($e),await ce()},$s=async $e=>{await we.closePoll($e),await ce()},Zi=async $e=>{await we.deletePoll($e),await ce()},bs=async($e,Tt)=>{await we.submitVote($e,Tt),await ce()},ji=async $e=>{await we.saveDataForm($e),await ce()},Wr=async $e=>{await we.deleteDataForm($e),await ce()},sn=async $e=>{await we.toggleDataFormStatus($e),await ce()},el=async($e,Tt)=>{await we.submitDataFormResponse($e,Tt),await ce()},Ei=async $e=>{await we.saveLiveVote($e),await ce()},qc=async($e,Tt)=>{await we.updateLiveVoteStatus($e,Tt),await ce()},Po=async($e,Tt)=>{await we.castLiveVote($e,Tt),await ce()},Dl=async $e=>{await we.deleteLiveVote($e),await ce()};return n.jsx(SM.Provider,{value:{fees:t,properties:a,residents:i,users:o,providers:u,transactions:p,pendingBills:m,exchangeRateHistory:v,polls:k,dataForms:C,liveVotes:T,reservations:I,announcements:U,maintenance:L,assemblies:Q,financialTotals:K,moduleStatus:z,isPoolEnabled:Y,loading:q,refreshData:ce,setUserRole:ne,latestRate:oe,updateModuleStatus:le,addFee:qr,deleteFee:_t,registerPayment:Ir,deletePayment:vr,updatePayment:Fa,addTransaction:xt,deleteTransaction:dr,updateTransaction:rt,addPendingBill:Ct,deletePendingBill:Vt,updatePendingBill:jt,markReceiptSent:Dr,payPendingBill:er,bankFees:O,updateBankFees:zr,addPoll:Jn,closePoll:$s,deletePoll:Zi,submitVote:bs,addDataForm:ji,deleteDataForm:Wr,toggleDataFormStatus:sn,submitDataForm:el,addLiveVote:Ei,updateLiveVoteStatus:qc,castLiveVote:Po,deleteLiveVote:Dl,addReservation:ge,updateReservationStatus:X,deleteReservation:pe,addAnnouncement:be,updateAnnouncementStatus:me,deleteAnnouncement:_e,addMaintenance:Te,updateMaintenanceStatus:Xe,deleteMaintenance:At,togglePoolAvailability:kt,addAssembly:Bt,deleteAssembly:Kr},children:e})},ht=()=>{const e=j.useContext(SM);if(!e)throw new Error("useData must be used within DataProvider");return e};function BM(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=BM(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Fr(){for(var e,t,r=0,a="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=BM(e))&&(a&&(a+=" "),a+=t);return a}var uq=["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","onTimeUpdateCapture","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"];function ck(e){if(typeof e!="string")return!1;var t=uq;return t.includes(e)}var Aq=["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"],fq=new Set(Aq);function _M(e){return typeof e!="string"?!1:fq.has(e)}function TM(e){return typeof e=="string"&&e.startsWith("data-")}function Ki(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(_M(r)||TM(r))&&(t[r]=e[r]);return t}function Ab(e){if(e==null)return null;if(j.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ki(t)}return typeof e=="object"&&!Array.isArray(e)?Ki(e):null}function bi(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(_M(r)||TM(r)||ck(r))&&(t[r]=e[r]);return t}function pq(e){return e==null?null:j.isValidElement(e)?bi(e.props):typeof e=="object"&&!Array.isArray(e)?bi(e):null}var hq=["children","width","height","viewBox","className","style","title","desc"];function cN(){return cN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},cN.apply(null,arguments)}function xq(e,t){if(e==null)return{};var r,a,s=mq(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function mq(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var FM=j.forwardRef((e,t)=>{var{children:r,width:a,height:s,viewBox:i,className:l,style:o,title:d,desc:u}=e,f=xq(e,hq),p=i||{width:a,height:s,x:0,y:0},x=Fr("recharts-surface",l);return j.createElement("svg",cN({},bi(f),{className:x,width:a,height:s,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),j.createElement("title",null,d),j.createElement("desc",null,u),r)}),gq=["children","className"];function dN(){return dN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},dN.apply(null,arguments)}function bq(e,t){if(e==null)return{};var r,a,s=vq(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function vq(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var wl=j.forwardRef((e,t)=>{var{children:r,className:a}=e,s=bq(e,gq),i=Fr("recharts-layer",a);return j.createElement("g",dN({className:i},bi(s),{ref:t}),r)}),IM=hM(),yq=j.createContext(null);function ea(e){return function(){return e}}const uN=Math.PI,AN=2*uN,pd=1e-6,wq=AN-pd;function DM(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Nq(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return DM;const r=10**t;return function(a){this._+=a[0];for(let s=1,i=a.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+a[s]}}class Cq{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?DM:Nq(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,a,s){this._append`Q${+t},${+r},${this._x1=+a},${this._y1=+s}`}bezierCurveTo(t,r,a,s,i,l){this._append`C${+t},${+r},${+a},${+s},${this._x1=+i},${this._y1=+l}`}arcTo(t,r,a,s,i){if(t=+t,r=+r,a=+a,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let l=this._x1,o=this._y1,d=a-t,u=s-r,f=l-t,p=o-r,x=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(x>pd)if(!(Math.abs(p*d-u*f)>pd)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let m=a-l,b=s-o,v=d*d+u*u,y=m*m+b*b,k=Math.sqrt(v),_=Math.sqrt(x),C=i*Math.tan((uN-Math.acos((v+x-y)/(2*k*_)))/2),E=C/_,T=C/k;Math.abs(E-1)>pd&&this._append`L${t+E*f},${r+E*p}`,this._append`A${i},${i},0,0,${+(p*m>f*b)},${this._x1=t+T*d},${this._y1=r+T*u}`}}arc(t,r,a,s,i,l){if(t=+t,r=+r,a=+a,l=!!l,a<0)throw new Error(`negative radius: ${a}`);let o=a*Math.cos(s),d=a*Math.sin(s),u=t+o,f=r+d,p=1^l,x=l?s-i:i-s;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>pd||Math.abs(this._y1-f)>pd)&&this._append`L${u},${f}`,a&&(x<0&&(x=x%AN+AN),x>wq?this._append`A${a},${a},0,1,${p},${t-o},${r-d}A${a},${a},0,1,${p},${this._x1=u},${this._y1=f}`:x>pd&&this._append`A${a},${a},0,${+(x>=uN)},${p},${this._x1=t+a*Math.cos(i)},${this._y1=r+a*Math.sin(i)}`)}rect(t,r,a,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${a=+a}v${+s}h${-a}Z`}toString(){return this._}}function UM(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const a=Math.floor(r);if(!(a>=0))throw new RangeError(`invalid digits: ${r}`);t=a}return e},()=>new Cq(t)}function dk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function MM(e){this._context=e}MM.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 fb(e){return new MM(e)}function RM(e){return e[0]}function OM(e){return e[1]}function PM(e,t){var r=ea(!0),a=null,s=fb,i=null,l=UM(o);e=typeof e=="function"?e:e===void 0?RM:ea(e),t=typeof t=="function"?t:t===void 0?OM:ea(t);function o(d){var u,f=(d=dk(d)).length,p,x=!1,m;for(a==null&&(i=s(m=l())),u=0;u<=f;++u)!(u<f&&r(p=d[u],u,d))===x&&((x=!x)?i.lineStart():i.lineEnd()),x&&i.point(+e(p,u,d),+t(p,u,d));if(m)return i=null,m+""||null}return o.x=function(d){return arguments.length?(e=typeof d=="function"?d:ea(+d),o):e},o.y=function(d){return arguments.length?(t=typeof d=="function"?d:ea(+d),o):t},o.defined=function(d){return arguments.length?(r=typeof d=="function"?d:ea(!!d),o):r},o.curve=function(d){return arguments.length?(s=d,a!=null&&(i=s(a)),o):s},o.context=function(d){return arguments.length?(d==null?a=i=null:i=s(a=d),o):a},o}function mx(e,t,r){var a=null,s=ea(!0),i=null,l=fb,o=null,d=UM(u);e=typeof e=="function"?e:e===void 0?RM:ea(+e),t=typeof t=="function"?t:ea(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?OM:ea(+r);function u(p){var x,m,b,v=(p=dk(p)).length,y,k=!1,_,C=new Array(v),E=new Array(v);for(i==null&&(o=l(_=d())),x=0;x<=v;++x){if(!(x<v&&s(y=p[x],x,p))===k)if(k=!k)m=x,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),b=x-1;b>=m;--b)o.point(C[b],E[b]);o.lineEnd(),o.areaEnd()}k&&(C[x]=+e(y,x,p),E[x]=+t(y,x,p),o.point(a?+a(y,x,p):C[x],r?+r(y,x,p):E[x]))}if(_)return o=null,_+""||null}function f(){return PM().defined(s).curve(l).context(i)}return u.x=function(p){return arguments.length?(e=typeof p=="function"?p:ea(+p),a=null,u):e},u.x0=function(p){return arguments.length?(e=typeof p=="function"?p:ea(+p),u):e},u.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:ea(+p),u):a},u.y=function(p){return arguments.length?(t=typeof p=="function"?p:ea(+p),r=null,u):t},u.y0=function(p){return arguments.length?(t=typeof p=="function"?p:ea(+p),u):t},u.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ea(+p),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(a).y(t)},u.defined=function(p){return arguments.length?(s=typeof p=="function"?p:ea(!!p),u):s},u.curve=function(p){return arguments.length?(l=p,i!=null&&(o=l(i)),u):l},u.context=function(p){return arguments.length?(p==null?i=o=null:o=l(i=p),u):i},u}class LM{constructor(t,r){this._context=t,this._x=r}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(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function kq(e){return new LM(e,!0)}function jq(e){return new LM(e,!1)}function Lm(){}function Qm(e,t,r){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+r)/6)}function QM(e){this._context=e}QM.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:Qm(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:Qm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Eq(e){return new QM(e)}function HM(e){this._context=e}HM.prototype={areaStart:Lm,areaEnd:Lm,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:Qm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Sq(e){return new HM(e)}function zM(e){this._context=e}zM.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 r=(this._x0+4*this._x1+e)/6,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,a):this._context.moveTo(r,a);break;case 3:this._point=4;default:Qm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bq(e){return new zM(e)}function $M(e){this._context=e}$M.prototype={areaStart:Lm,areaEnd:Lm,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 _q(e){return new $M(e)}function Y_(e){return e<0?-1:1}function X_(e,t,r){var a=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(a||s<0&&-0),l=(r-e._y1)/(s||a<0&&-0),o=(i*s+l*a)/(a+s);return(Y_(i)+Y_(l))*Math.min(Math.abs(i),Math.abs(l),.5*Math.abs(o))||0}function J_(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Py(e,t,r){var a=e._x0,s=e._y0,i=e._x1,l=e._y1,o=(i-a)/3;e._context.bezierCurveTo(a+o,s+o*t,i-o,l-o*r,i,l)}function Hm(e){this._context=e}Hm.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:Py(this,this._t0,J_(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 r=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,Py(this,J_(this,r=X_(this,e,t)),r);break;default:Py(this,this._t0,r=X_(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function VM(e){this._context=new GM(e)}(VM.prototype=Object.create(Hm.prototype)).point=function(e,t){Hm.prototype.point.call(this,t,e)};function GM(e){this._context=e}GM.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,r,a,s,i){this._context.bezierCurveTo(t,e,a,r,i,s)}};function Tq(e){return new Hm(e)}function Fq(e){return new VM(e)}function KM(e){this._context=e}KM.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var a=Z_(e),s=Z_(t),i=0,l=1;l<r;++i,++l)this._context.bezierCurveTo(a[0][i],s[0][i],a[1][i],s[1][i],e[l],t[l]);(this._line||this._line!==0&&r===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 Z_(e){var t,r=e.length-1,a,s=new Array(r),i=new Array(r),l=new Array(r);for(s[0]=0,i[0]=2,l[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,l[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,l[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)a=s[t]/i[t-1],i[t]-=a,l[t]-=a*l[t-1];for(s[r-1]=l[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(l[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function Iq(e){return new KM(e)}function pb(e,t){this._context=e,this._t=t}pb.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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Dq(e){return new pb(e,.5)}function Uq(e){return new pb(e,0)}function Mq(e){return new pb(e,1)}function Od(e,t){if((l=e.length)>1)for(var r=1,a,s,i=e[t[0]],l,o=i.length;r<l;++r)for(s=i,i=e[t[r]],a=0;a<o;++a)i[a][1]+=i[a][0]=isNaN(s[a][1])?s[a][0]:s[a][1]}function fN(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Rq(e,t){return e[t]}function Oq(e){const t=[];return t.key=e,t}function Pq(){var e=ea([]),t=fN,r=Od,a=Rq;function s(i){var l=Array.from(e.apply(this,arguments),Oq),o,d=l.length,u=-1,f;for(const p of i)for(o=0,++u;o<d;++o)(l[o][u]=[0,+a(p,l[o].key,u,i)]).data=p;for(o=0,f=dk(t(l));o<d;++o)l[f[o]].index=o;return r(l,f),l}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:ea(Array.from(i)),s):e},s.value=function(i){return arguments.length?(a=typeof i=="function"?i:ea(+i),s):a},s.order=function(i){return arguments.length?(t=i==null?fN:typeof i=="function"?i:ea(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??Od,s):r},s}function Lq(e,t){if((a=e.length)>0){for(var r,a,s=0,i=e[0].length,l;s<i;++s){for(l=r=0;r<a;++r)l+=e[r][s][1]||0;if(l)for(r=0;r<a;++r)e[r][s][1]/=l}Od(e,t)}}function Qq(e,t){if((s=e.length)>0){for(var r=0,a=e[t[0]],s,i=a.length;r<i;++r){for(var l=0,o=0;l<s;++l)o+=e[l][r][1]||0;a[r][1]+=a[r][0]=-o/2}Od(e,t)}}function Hq(e,t){if(!(!((l=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,a=1,s,i,l;a<i;++a){for(var o=0,d=0,u=0;o<l;++o){for(var f=e[t[o]],p=f[a][1]||0,x=f[a-1][1]||0,m=(p-x)/2,b=0;b<o;++b){var v=e[t[b]],y=v[a][1]||0,k=v[a-1][1]||0;m+=y-k}d+=p,u+=m*p}s[a-1][1]+=s[a-1][0]=r,d&&(r-=u/d)}s[a-1][1]+=s[a-1][0]=r,Od(e,t)}}var Ly={},Qy={},eT;function zq(){return eT||(eT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(Qy)),Qy}var Hy={},tT;function qM(){return tT||(tT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(Hy)),Hy}var zy={},rT;function uk(){return rT||(rT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var a;return typeof r=="string"||typeof r=="symbol"?r:Object.is((a=r==null?void 0:r.valueOf)==null?void 0:a.call(r),-0)?"-0":String(r)}e.toKey=t})(zy)),zy}var $y={},Vy={},aT;function $q(){return aT||(aT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const a=String(r);return a==="0"&&Object.is(Number(r),-0)?"-0":a}e.toString=t})(Vy)),Vy}var nT;function Ak(){return nT||(nT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$q(),r=uk();function a(s){if(Array.isArray(s))return s.map(r.toKey);if(typeof s=="symbol")return[s];s=t.toString(s);const i=[],l=s.length;if(l===0)return i;let o=0,d="",u="",f=!1;for(s.charCodeAt(0)===46&&(i.push(""),o++);o<l;){const p=s[o];u?p==="\\"&&o+1<l?(o++,d+=s[o]):p===u?u="":d+=p:f?p==='"'||p==="'"?u=p:p==="]"?(f=!1,i.push(d),d=""):d+=p:p==="["?(f=!0,d&&(i.push(d),d="")):p==="."?d&&(i.push(d),d=""):d+=p,o++}return d&&i.push(d),i}e.toPath=a})($y)),$y}var sT;function fk(){return sT||(sT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zq(),r=qM(),a=uk(),s=Ak();function i(o,d,u){if(o==null)return u;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return u;const f=o[d];return f===void 0?r.isDeepKey(d)?i(o,s.toPath(d),u):u:f}case"number":case"symbol":{typeof d=="number"&&(d=a.toKey(d));const f=o[d];return f===void 0?u:f}default:{if(Array.isArray(d))return l(o,d,u);if(Object.is(d==null?void 0:d.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return u;const f=o[d];return f===void 0?u:f}}}function l(o,d,u){if(d.length===0)return u;let f=o;for(let p=0;p<d.length;p++){if(f==null||t.isUnsafeProperty(d[p]))return u;f=f[d[p]]}return f===void 0?u:f}e.get=i})(Ly)),Ly}var Gy,iT;function Vq(){return iT||(iT=1,Gy=fk().get),Gy}var Gq=Vq();const hb=El(Gq);var Kq=4;function gc(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kq,r=10**t,a=Math.round(e*r)/r;return Object.is(a,-0)?0:a}function fn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return e.reduce((s,i,l)=>{var o=r[l-1];return typeof o=="string"?s+o+i:o!==void 0?s+gc(o)+i:s+i},"")}var Ai=e=>e===0?0:e>0?1:-1,Nl=e=>typeof e=="number"&&e!=+e,Pd=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ct=e=>(typeof e=="number"||e instanceof Number)&&!Nl(e),Cl=e=>ct(e)||typeof e=="string",qq=0,Wf=e=>{var t=++qq;return"".concat(e||"").concat(t)},Fc=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ct(t)&&typeof t!="string")return a;var i;if(Pd(t)){if(r==null)return a;var l=t.indexOf("%");i=r*parseFloat(t.slice(0,l))/100}else i=+t;return Nl(i)&&(i=a),s&&r!=null&&i>r&&(i=r),i},WM=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},a=0;a<t;a++)if(!r[String(e[a])])r[String(e[a])]=!0;else return!0;return!1};function pl(e,t,r){return ct(e)&&ct(t)?gc(e+r*(t-e)):t}function YM(e,t,r){if(!(!e||!e.length))return e.find(a=>a&&(typeof t=="function"?t(a):hb(a,t))===r)}var Rn=e=>e===null||typeof e>"u",pk=e=>Rn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function ds(e){return e!=null}function LA(){}var XM=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,hk=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(j.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var a={};return Object.keys(r).forEach(s=>{ck(s)&&(a[s]=(i=>r[s](r,i)))}),a},Wq=(e,t,r)=>a=>(e(t,r,a),null),Yq=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var a=null;return Object.keys(e).forEach(s=>{var i=e[s];ck(s)&&typeof i=="function"&&(a||(a={}),a[s]=Wq(i,t,r))}),a};function lT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Xq(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lT(Object(r),!0).forEach(function(a){Jq(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lT(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Jq(e,t,r){return(t=Zq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zq(e){var t=eW(e,"string");return typeof t=="symbol"?t:t+""}function eW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zs(e,t){var r=Xq({},e),a=t,s=Object.keys(t),i=s.reduce((l,o)=>(l[o]===void 0&&a[o]!==void 0&&(l[o]=a[o]),l),r);return i}var Ky={},qy={},oT;function tW(){return oT||(oT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a){const s=new Map;for(let i=0;i<r.length;i++){const l=r[i],o=a(l,i,r);s.has(o)||s.set(o,l)}return Array.from(s.values())}e.uniqBy=t})(qy)),qy}var Wy={},cT;function rW(){return cT||(cT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a){return function(...s){return r.apply(this,s.slice(0,a))}}e.ary=t})(Wy)),Wy}var Yy={},dT;function JM(){return dT||(dT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Yy)),Yy}var Xy={},Jy={},Zy={},uT;function aW(){return uT||(uT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(Zy)),Zy}var AT;function xk(){return AT||(AT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aW();function r(a){return a!=null&&typeof a!="function"&&t.isLength(a.length)}e.isArrayLike=r})(Jy)),Jy}var ew={},fT;function nW(){return fT||(fT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(ew)),ew}var pT;function sW(){return pT||(pT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xk(),r=nW();function a(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=a})(Xy)),Xy}var tw={},rw={},hT;function iW(){return hT||(hT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fk();function r(a){return function(s){return t.get(s,a)}}e.property=r})(rw)),rw}var aw={},nw={},sw={},iw={},xT;function ZM(){return xT||(xT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(iw)),iw}var lw={},mT;function eR(){return mT||(mT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(lw)),lw}var ow={},gT;function tR(){return gT||(gT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a){return r===a||Number.isNaN(r)&&Number.isNaN(a)}e.isEqualsSameValueZero=t})(ow)),ow}var bT;function lW(){return bT||(bT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ZM(),r=eR(),a=tR();function s(f,p,x){return typeof x!="function"?s(f,p,()=>{}):i(f,p,function m(b,v,y,k,_,C){const E=x(b,v,y,k,_,C);return E!==void 0?!!E:i(b,v,m,C)},new Map)}function i(f,p,x,m){if(p===f)return!0;switch(typeof p){case"object":return l(f,p,x,m);case"function":return Object.keys(p).length>0?i(f,{...p},x,m):a.isEqualsSameValueZero(f,p);default:return t.isObject(f)?typeof p=="string"?p==="":!0:a.isEqualsSameValueZero(f,p)}}function l(f,p,x,m){if(p==null)return!0;if(Array.isArray(p))return d(f,p,x,m);if(p instanceof Map)return o(f,p,x,m);if(p instanceof Set)return u(f,p,x,m);const b=Object.keys(p);if(f==null||r.isPrimitive(f))return b.length===0;if(b.length===0)return!0;if(m!=null&&m.has(p))return m.get(p)===f;m==null||m.set(p,f);try{for(let v=0;v<b.length;v++){const y=b[v];if(!r.isPrimitive(f)&&!(y in f)||p[y]===void 0&&f[y]!==void 0||p[y]===null&&f[y]!==null||!x(f[y],p[y],y,f,p,m))return!1}return!0}finally{m==null||m.delete(p)}}function o(f,p,x,m){if(p.size===0)return!0;if(!(f instanceof Map))return!1;for(const[b,v]of p.entries()){const y=f.get(b);if(x(y,v,b,f,p,m)===!1)return!1}return!0}function d(f,p,x,m){if(p.length===0)return!0;if(!Array.isArray(f))return!1;const b=new Set;for(let v=0;v<p.length;v++){const y=p[v];let k=!1;for(let _=0;_<f.length;_++){if(b.has(_))continue;const C=f[_];let E=!1;if(x(C,y,v,f,p,m)&&(E=!0),E){b.add(_),k=!0;break}}if(!k)return!1}return!0}function u(f,p,x,m){return p.size===0?!0:f instanceof Set?d([...f],[...p],x,m):!1}e.isMatchWith=s,e.isSetMatch=u})(sw)),sw}var vT;function rR(){return vT||(vT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lW();function r(a,s){return t.isMatchWith(a,s,()=>{})}e.isMatch=r})(nw)),nw}var cw={},dw={},uw={},yT;function oW(){return yT||(yT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(a=>Object.prototype.propertyIsEnumerable.call(r,a))}e.getSymbols=t})(uw)),uw}var Aw={},wT;function mk(){return wT||(wT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(Aw)),Aw}var fw={},NT;function aR(){return NT||(NT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",a="[object Number]",s="[object Boolean]",i="[object Arguments]",l="[object Symbol]",o="[object Date]",d="[object Map]",u="[object Set]",f="[object Array]",p="[object Function]",x="[object ArrayBuffer]",m="[object Object]",b="[object Error]",v="[object DataView]",y="[object Uint8Array]",k="[object Uint8ClampedArray]",_="[object Uint16Array]",C="[object Uint32Array]",E="[object BigUint64Array]",T="[object Int8Array]",B="[object Int16Array]",I="[object Int32Array]",M="[object BigInt64Array]",U="[object Float32Array]",D="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=x,e.arrayTag=f,e.bigInt64ArrayTag=M,e.bigUint64ArrayTag=E,e.booleanTag=s,e.dataViewTag=v,e.dateTag=o,e.errorTag=b,e.float32ArrayTag=U,e.float64ArrayTag=D,e.functionTag=p,e.int16ArrayTag=B,e.int32ArrayTag=I,e.int8ArrayTag=T,e.mapTag=d,e.numberTag=a,e.objectTag=m,e.regexpTag=t,e.setTag=u,e.stringTag=r,e.symbolTag=l,e.uint16ArrayTag=_,e.uint32ArrayTag=C,e.uint8ArrayTag=y,e.uint8ClampedArrayTag=k})(fw)),fw}var pw={},CT;function cW(){return CT||(CT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(pw)),pw}var kT;function nR(){return kT||(kT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oW(),r=mk(),a=aR(),s=eR(),i=cW();function l(f,p){return o(f,void 0,f,new Map,p)}function o(f,p,x,m=new Map,b=void 0){const v=b==null?void 0:b(f,p,x,m);if(v!==void 0)return v;if(s.isPrimitive(f))return f;if(m.has(f))return m.get(f);if(Array.isArray(f)){const y=new Array(f.length);m.set(f,y);for(let k=0;k<f.length;k++)y[k]=o(f[k],k,x,m,b);return Object.hasOwn(f,"index")&&(y.index=f.index),Object.hasOwn(f,"input")&&(y.input=f.input),y}if(f instanceof Date)return new Date(f.getTime());if(f instanceof RegExp){const y=new RegExp(f.source,f.flags);return y.lastIndex=f.lastIndex,y}if(f instanceof Map){const y=new Map;m.set(f,y);for(const[k,_]of f)y.set(k,o(_,k,x,m,b));return y}if(f instanceof Set){const y=new Set;m.set(f,y);for(const k of f)y.add(o(k,void 0,x,m,b));return y}if(typeof Buffer<"u"&&Buffer.isBuffer(f))return f.subarray();if(i.isTypedArray(f)){const y=new(Object.getPrototypeOf(f)).constructor(f.length);m.set(f,y);for(let k=0;k<f.length;k++)y[k]=o(f[k],k,x,m,b);return y}if(f instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&f instanceof SharedArrayBuffer)return f.slice(0);if(f instanceof DataView){const y=new DataView(f.buffer.slice(0),f.byteOffset,f.byteLength);return m.set(f,y),d(y,f,x,m,b),y}if(typeof File<"u"&&f instanceof File){const y=new File([f],f.name,{type:f.type});return m.set(f,y),d(y,f,x,m,b),y}if(typeof Blob<"u"&&f instanceof Blob){const y=new Blob([f],{type:f.type});return m.set(f,y),d(y,f,x,m,b),y}if(f instanceof Error){const y=new f.constructor;return m.set(f,y),y.message=f.message,y.name=f.name,y.stack=f.stack,y.cause=f.cause,d(y,f,x,m,b),y}if(f instanceof Boolean){const y=new Boolean(f.valueOf());return m.set(f,y),d(y,f,x,m,b),y}if(f instanceof Number){const y=new Number(f.valueOf());return m.set(f,y),d(y,f,x,m,b),y}if(f instanceof String){const y=new String(f.valueOf());return m.set(f,y),d(y,f,x,m,b),y}if(typeof f=="object"&&u(f)){const y=Object.create(Object.getPrototypeOf(f));return m.set(f,y),d(y,f,x,m,b),y}return f}function d(f,p,x=f,m,b){const v=[...Object.keys(p),...t.getSymbols(p)];for(let y=0;y<v.length;y++){const k=v[y],_=Object.getOwnPropertyDescriptor(f,k);(_==null||_.writable)&&(f[k]=o(p[k],k,x,m,b))}}function u(f){switch(r.getTag(f)){case a.argumentsTag:case a.arrayTag:case a.arrayBufferTag:case a.dataViewTag:case a.booleanTag:case a.dateTag:case a.float32ArrayTag:case a.float64ArrayTag:case a.int8ArrayTag:case a.int16ArrayTag:case a.int32ArrayTag:case a.mapTag:case a.numberTag:case a.objectTag:case a.regexpTag:case a.setTag:case a.stringTag:case a.symbolTag:case a.uint8ArrayTag:case a.uint8ClampedArrayTag:case a.uint16ArrayTag:case a.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=o,e.copyProperties=d})(dw)),dw}var jT;function dW(){return jT||(jT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nR();function r(a){return t.cloneDeepWithImpl(a,void 0,a,new Map,void 0)}e.cloneDeep=r})(cw)),cw}var ET;function uW(){return ET||(ET=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rR(),r=dW();function a(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=a})(aw)),aw}var hw={},xw={},mw={},ST;function AW(){return ST||(ST=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nR(),r=mk(),a=aR();function s(i,l){return t.cloneDeepWith(i,(o,d,u,f)=>{const p=l==null?void 0:l(o,d,u,f);if(p!==void 0)return p;if(typeof i=="object"){if(r.getTag(i)===a.objectTag&&typeof i.constructor!="function"){const x={};return f.set(i,x),t.copyProperties(x,i,u,f),x}switch(Object.prototype.toString.call(i)){case a.numberTag:case a.stringTag:case a.booleanTag:{const x=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(x,i),x}case a.argumentsTag:{const x={};return t.copyProperties(x,i),x.length=i.length,x[Symbol.iterator]=i[Symbol.iterator],x}default:return}}})}e.cloneDeepWith=s})(mw)),mw}var BT;function fW(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AW();function r(a){return t.cloneDeepWith(a)}e.cloneDeep=r})(xw)),xw}var gw={},bw={},_T;function sR(){return _T||(_T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(a,s=Number.MAX_SAFE_INTEGER){switch(typeof a){case"number":return Number.isInteger(a)&&a>=0&&a<s;case"symbol":return!1;case"string":return t.test(a)}}e.isIndex=r})(bw)),bw}var vw={},TT;function pW(){return TT||(TT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mk();function r(a){return a!==null&&typeof a=="object"&&t.getTag(a)==="[object Arguments]"}e.isArguments=r})(vw)),vw}var FT;function hW(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qM(),r=sR(),a=pW(),s=Ak();function i(l,o){let d;if(Array.isArray(o)?d=o:typeof o=="string"&&t.isDeepKey(o)&&(l==null?void 0:l[o])==null?d=s.toPath(o):d=[o],d.length===0)return!1;let u=l;for(let f=0;f<d.length;f++){const p=d[f];if((u==null||!Object.hasOwn(u,p))&&!((Array.isArray(u)||a.isArguments(u))&&r.isIndex(p)&&p<u.length))return!1;u=u[p]}return!0}e.has=i})(gw)),gw}var IT;function xW(){return IT||(IT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rR(),r=uk(),a=fW(),s=fk(),i=hW();function l(o,d){switch(typeof o){case"object":{Object.is(o==null?void 0:o.valueOf(),-0)&&(o="-0");break}case"number":{o=r.toKey(o);break}}return d=a.cloneDeep(d),function(u){const f=s.get(u,o);return f===void 0?i.has(u,o):d===void 0?f===void 0:t.isMatch(f,d)}}e.matchesProperty=l})(hw)),hw}var DT;function mW(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JM(),r=iW(),a=uW(),s=xW();function i(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?s.matchesProperty(l[0],l[1]):a.matches(l);case"string":case"symbol":case"number":return r.property(l)}}e.iteratee=i})(tw)),tw}var UT;function gW(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tW(),r=rW(),a=JM(),s=sW(),i=mW();function l(o,d=a.identity){return s.isArrayLikeObject(o)?t.uniqBy(Array.from(o),r.ary(i.iteratee(d),1)):[]}e.uniqBy=l})(Ky)),Ky}var yw,MT;function bW(){return MT||(MT=1,yw=gW().uniqBy),yw}var vW=bW();const RT=El(vW);function yW(e,t,r){return t===!0?RT(e,r):typeof t=="function"?RT(e,t):e}var ww={exports:{}},Nw={},Cw={exports:{}},kw={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var OT;function wW(){if(OT)return kw;OT=1;var e=RA();function t(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function o(p,x){var m=x(),b=a({inst:{value:m,getSnapshot:x}}),v=b[0].inst,y=b[1];return i(function(){v.value=m,v.getSnapshot=x,d(v)&&y({inst:v})},[p,m,x]),s(function(){return d(v)&&y({inst:v}),p(function(){d(v)&&y({inst:v})})},[p]),l(m),m}function d(p){var x=p.getSnapshot;p=p.value;try{var m=x();return!r(p,m)}catch{return!0}}function u(p,x){return x()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return kw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,kw}var PT;function NW(){return PT||(PT=1,Cw.exports=wW()),Cw.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var LT;function CW(){if(LT)return Nw;LT=1;var e=RA(),t=NW();function r(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var a=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,o=e.useMemo,d=e.useDebugValue;return Nw.useSyncExternalStoreWithSelector=function(u,f,p,x,m){var b=i(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=o(function(){function k(B){if(!_){if(_=!0,C=B,B=x(B),m!==void 0&&v.hasValue){var I=v.value;if(m(I,B))return E=I}return E=B}if(I=E,a(C,B))return I;var M=x(B);return m!==void 0&&m(I,M)?(C=B,I):(C=B,E=M)}var _=!1,C,E,T=p===void 0?null:p;return[function(){return k(f())},T===null?void 0:function(){return k(T())}]},[f,p,x,m]);var y=s(u,b[0],b[1]);return l(function(){v.hasValue=!0,v.value=y},[y]),d(y),y},Nw}var QT;function kW(){return QT||(QT=1,ww.exports=CW()),ww.exports}var jW=kW(),gk=j.createContext(null),EW=e=>e,en=()=>{var e=j.useContext(gk);return e?e.store.dispatch:EW},Cm=()=>{},SW=()=>Cm,BW=(e,t)=>e===t;function pt(e){var t=j.useContext(gk),r=j.useMemo(()=>t?a=>{if(a!=null)return e(a)}:Cm,[t,e]);return jW.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:SW,t?t.store.getState:Cm,t?t.store.getState:Cm,r,BW)}function _W(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function TW(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function FW(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${r}]`)}}var HT=e=>Array.isArray(e)?e:[e];function IW(e){const t=Array.isArray(e[0])?e[0]:e;return FW(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function DW(e,t){const r=[],{length:a}=e;for(let s=0;s<a;s++)r.push(e[s].apply(null,t));return r}var UW=class{constructor(e){this.value=e}deref(){return this.value}},MW=typeof WeakRef<"u"?WeakRef:UW,RW=0,zT=1;function gx(){return{s:RW,v:void 0,o:null,p:null}}function iR(e,t={}){let r=gx();const{resultEqualityCheck:a}=t;let s,i=0;function l(){var p;let o=r;const{length:d}=arguments;for(let x=0,m=d;x<m;x++){const b=arguments[x];if(typeof b=="function"||typeof b=="object"&&b!==null){let v=o.o;v===null&&(o.o=v=new WeakMap);const y=v.get(b);y===void 0?(o=gx(),v.set(b,o)):o=y}else{let v=o.p;v===null&&(o.p=v=new Map);const y=v.get(b);y===void 0?(o=gx(),v.set(b,o)):o=y}}const u=o;let f;if(o.s===zT)f=o.v;else if(f=e.apply(null,arguments),i++,a){const x=((p=s==null?void 0:s.deref)==null?void 0:p.call(s))??s;x!=null&&a(x,f)&&(f=x,i!==0&&i--),s=typeof f=="object"&&f!==null||typeof f=="function"?new MW(f):f}return u.s=zT,u.v=f,f}return l.clearCache=()=>{r=gx(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function OW(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...s)=>{let i=0,l=0,o,d={},u=s.pop();typeof u=="object"&&(d=u,u=s.pop()),_W(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const f={...r,...d},{memoize:p,memoizeOptions:x=[],argsMemoize:m=iR,argsMemoizeOptions:b=[]}=f,v=HT(x),y=HT(b),k=IW(s),_=p(function(){return i++,u.apply(null,arguments)},...v),C=m(function(){l++;const T=DW(k,arguments);return o=_.apply(null,T),o},...y);return Object.assign(C,{resultFunc:u,memoizedResultFunc:_,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>o,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:p,argsMemoize:m})};return Object.assign(a,{withTypes:()=>a}),a}var De=OW(iR),PW=Object.assign((e,t=De)=>{TW(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),a=r.map(i=>e[i]);return t(a,(...i)=>i.reduce((l,o,d)=>(l[r[d]]=o,l),{}))},{withTypes:()=>PW}),jw={},Ew={},Sw={},$T;function LW(){return $T||($T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(a){return typeof a=="symbol"?1:a===null?2:a===void 0?3:a!==a?4:0}const r=(a,s,i)=>{if(a!==s){const l=t(a),o=t(s);if(l===o&&l===0){if(a<s)return i==="desc"?1:-1;if(a>s)return i==="desc"?-1:1}return i==="desc"?o-l:l-o}return 0};e.compareValues=r})(Sw)),Sw}var Bw={},_w={},VT;function lR(){return VT||(VT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(_w)),_w}var GT;function QW(){return GT||(GT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lR(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function s(i,l){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(a.test(i)||!r.test(i))||l!=null&&Object.hasOwn(l,i)}e.isKey=s})(Bw)),Bw}var KT;function HW(){return KT||(KT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LW(),r=QW(),a=Ak();function s(i,l,o,d){if(i==null)return[];o=d?void 0:o,Array.isArray(i)||(i=Object.values(i)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(o)||(o=o==null?[]:[o]),o=o.map(m=>String(m));const u=(m,b)=>{let v=m;for(let y=0;y<b.length&&v!=null;++y)v=v[b[y]];return v},f=(m,b)=>b==null||m==null?b:typeof m=="object"&&"key"in m?Object.hasOwn(b,m.key)?b[m.key]:u(b,m.path):typeof m=="function"?m(b):Array.isArray(m)?u(b,m):typeof b=="object"?b[m]:b,p=l.map(m=>(Array.isArray(m)&&m.length===1&&(m=m[0]),m==null||typeof m=="function"||Array.isArray(m)||r.isKey(m)?m:{key:m,path:a.toPath(m)}));return i.map(m=>({original:m,criteria:p.map(b=>f(b,m))})).slice().sort((m,b)=>{for(let v=0;v<p.length;v++){const y=t.compareValues(m.criteria[v],b.criteria[v],o[v]);if(y!==0)return y}return 0}).map(m=>m.original)}e.orderBy=s})(Ew)),Ew}var Tw={},qT;function zW(){return qT||(qT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a=1){const s=[],i=Math.floor(a),l=(o,d)=>{for(let u=0;u<o.length;u++){const f=o[u];Array.isArray(f)&&d<i?l(f,d+1):s.push(f)}};return l(r,0),s}e.flatten=t})(Tw)),Tw}var Fw={},WT;function oR(){return WT||(WT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sR(),r=xk(),a=ZM(),s=tR();function i(l,o,d){return a.isObject(d)&&(typeof o=="number"&&r.isArrayLike(d)&&t.isIndex(o)&&o<d.length||typeof o=="string"&&o in d)?s.isEqualsSameValueZero(d[o],l):!1}e.isIterateeCall=i})(Fw)),Fw}var YT;function $W(){return YT||(YT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HW(),r=zW(),a=oR();function s(i,...l){const o=l.length;return o>1&&a.isIterateeCall(i,l[0],l[1])?l=[]:o>2&&a.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(i,r.flatten(l),["asc"])}e.sortBy=s})(jw)),jw}var Iw,XT;function VW(){return XT||(XT=1,Iw=$W().sortBy),Iw}var GW=VW();const xb=El(GW);var cR=e=>e.legend.settings,KW=e=>e.legend.size,qW=e=>e.legend.payload;De([qW,cR],(e,t)=>{var{itemSorter:r}=t,a=e.flat(1);return r?xb(a,r):a});var bx=1;function WW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=j.useState({height:0,left:0,top:0,width:0}),a=j.useCallback(s=>{if(s!=null){var i=s.getBoundingClientRect(),l={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(l.height-t.height)>bx||Math.abs(l.left-t.left)>bx||Math.abs(l.top-t.top)>bx||Math.abs(l.width-t.width)>bx)&&r({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,a]}function An(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 YW=typeof Symbol=="function"&&Symbol.observable||"@@observable",JT=YW,Dw=()=>Math.random().toString(36).substring(7).split("").join("."),XW={INIT:`@@redux/INIT${Dw()}`,REPLACE:`@@redux/REPLACE${Dw()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Dw()}`},zm=XW;function bk(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function dR(e,t,r){if(typeof e!="function")throw new Error(An(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(An(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(An(1));return r(dR)(e,t)}let a=e,s=t,i=new Map,l=i,o=0,d=!1;function u(){l===i&&(l=new Map,i.forEach((y,k)=>{l.set(k,y)}))}function f(){if(d)throw new Error(An(3));return s}function p(y){if(typeof y!="function")throw new Error(An(4));if(d)throw new Error(An(5));let k=!0;u();const _=o++;return l.set(_,y),function(){if(k){if(d)throw new Error(An(6));k=!1,u(),l.delete(_),i=null}}}function x(y){if(!bk(y))throw new Error(An(7));if(typeof y.type>"u")throw new Error(An(8));if(typeof y.type!="string")throw new Error(An(17));if(d)throw new Error(An(9));try{d=!0,s=a(s,y)}finally{d=!1}return(i=l).forEach(_=>{_()}),y}function m(y){if(typeof y!="function")throw new Error(An(10));a=y,x({type:zm.REPLACE})}function b(){const y=p;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(An(11));function _(){const E=k;E.next&&E.next(f())}return _(),{unsubscribe:y(_)}},[JT](){return this}}}return x({type:zm.INIT}),{dispatch:x,subscribe:p,getState:f,replaceReducer:m,[JT]:b}}function JW(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:zm.INIT})>"u")throw new Error(An(12));if(typeof r(void 0,{type:zm.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(An(13))})}function uR(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const l=t[i];typeof e[l]=="function"&&(r[l]=e[l])}const a=Object.keys(r);let s;try{JW(r)}catch(i){s=i}return function(l={},o){if(s)throw s;let d=!1;const u={};for(let f=0;f<a.length;f++){const p=a[f],x=r[p],m=l[p],b=x(m,o);if(typeof b>"u")throw o&&o.type,new Error(An(14));u[p]=b,d=d||b!==m}return d=d||a.length!==Object.keys(l).length,d?u:l}}function $m(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...a)=>t(r(...a)))}function ZW(...e){return t=>(r,a)=>{const s=t(r,a);let i=()=>{throw new Error(An(15))};const l={getState:s.getState,dispatch:(d,...u)=>i(d,...u)},o=e.map(d=>d(l));return i=$m(...o)(s.dispatch),{...s,dispatch:i}}}function AR(e){return bk(e)&&"type"in e&&typeof e.type=="string"}var fR=Symbol.for("immer-nothing"),ZT=Symbol.for("immer-draftable"),Wn=Symbol.for("immer-state");function Ii(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Us=Object,EA=Us.getPrototypeOf,Vm="constructor",mb="prototype",pN="configurable",Gm="enumerable",km="writable",Yf="value",xo=e=>!!e&&!!e[Wn];function qi(e){var t;return e?pR(e)||bb(e)||!!e[ZT]||!!((t=e[Vm])!=null&&t[ZT])||vb(e)||yb(e):!1}var eY=Us[mb][Vm].toString(),eF=new WeakMap;function pR(e){if(!e||!vk(e))return!1;const t=EA(e);if(t===null||t===Us[mb])return!0;const r=Us.hasOwnProperty.call(t,Vm)&&t[Vm];if(r===Object)return!0;if(!nA(r))return!1;let a=eF.get(r);return a===void 0&&(a=Function.toString.call(r),eF.set(r,a)),a===eY}function gb(e,t,r=!0){Ip(e)===0?(r?Reflect.ownKeys(e):Us.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((a,s)=>t(s,a,e))}function Ip(e){const t=e[Wn];return t?t.type_:bb(e)?1:vb(e)?2:yb(e)?3:0}var tF=(e,t,r=Ip(e))=>r===2?e.has(t):Us[mb].hasOwnProperty.call(e,t),hN=(e,t,r=Ip(e))=>r===2?e.get(t):e[t],Km=(e,t,r,a=Ip(e))=>{a===2?e.set(t,r):a===3?e.add(r):e[t]=r};function tY(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var bb=Array.isArray,vb=e=>e instanceof Map,yb=e=>e instanceof Set,vk=e=>typeof e=="object",nA=e=>typeof e=="function",Uw=e=>typeof e=="boolean";function rY(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ro=e=>e.copy_||e.base_,yk=e=>e.modified_?e.copy_:e.base_;function xN(e,t){if(vb(e))return new Map(e);if(yb(e))return new Set(e);if(bb(e))return Array[mb].slice.call(e);const r=pR(e);if(t===!0||t==="class_only"&&!r){const a=Us.getOwnPropertyDescriptors(e);delete a[Wn];let s=Reflect.ownKeys(a);for(let i=0;i<s.length;i++){const l=s[i],o=a[l];o[km]===!1&&(o[km]=!0,o[pN]=!0),(o.get||o.set)&&(a[l]={[pN]:!0,[km]:!0,[Gm]:o[Gm],[Yf]:e[l]})}return Us.create(EA(e),a)}else{const a=EA(e);if(a!==null&&r)return{...e};const s=Us.create(a);return Us.assign(s,e)}}function wk(e,t=!1){return wb(e)||xo(e)||!qi(e)||(Ip(e)>1&&Us.defineProperties(e,{set:vx,add:vx,clear:vx,delete:vx}),Us.freeze(e),t&&gb(e,(r,a)=>{wk(a,!0)},!1)),e}function aY(){Ii(2)}var vx={[Yf]:aY};function wb(e){return e===null||!vk(e)?!0:Us.isFrozen(e)}var qm="MapSet",mN="Patches",rF="ArrayMethods",hR={};function Ld(e){const t=hR[e];return t||Ii(0,e),t}var aF=e=>!!hR[e],Xf,xR=()=>Xf,nY=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:aF(qm)?Ld(qm):void 0,arrayMethodsPlugin_:aF(rF)?Ld(rF):void 0});function nF(e,t){t&&(e.patchPlugin_=Ld(mN),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gN(e){bN(e),e.drafts_.forEach(sY),e.drafts_=null}function bN(e){e===Xf&&(Xf=e.parent_)}var sF=e=>Xf=nY(Xf,e);function sY(e){const t=e[Wn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function iF(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Wn].modified_&&(gN(t),Ii(4)),qi(e)&&(e=lF(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[Wn].base_,e,t)}else e=lF(t,r);return iY(t,e,!0),gN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fR?e:void 0}function lF(e,t){if(wb(t))return t;const r=t[Wn];if(!r)return Wm(t,e.handledSet_,e);if(!Nb(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:a}=r;if(a)for(;a.length>0;)a.pop()(e);bR(r,e)}return r.copy_}function iY(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&wk(t,r)}function mR(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Nb=(e,t)=>e.scope_===t,lY=[];function gR(e,t,r,a){const s=ro(e),i=e.type_;if(a!==void 0&&hN(s,a,i)===t){Km(s,a,r,i);return}if(!e.draftLocations_){const o=e.draftLocations_=new Map;gb(s,(d,u)=>{if(xo(u)){const f=o.get(u)||[];f.push(d),o.set(u,f)}})}const l=e.draftLocations_.get(t)??lY;for(const o of l)Km(s,o,r,i)}function oY(e,t,r){e.callbacks_.push(function(s){var o;const i=t;if(!i||!Nb(i,s))return;(o=s.mapSetPlugin_)==null||o.fixSetContents(i);const l=yk(i);gR(e,i.draft_??i,l,r),bR(i,s)})}function bR(e,t){var a;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((a=e.assigned_)==null?void 0:a.size)??0)>0)){const{patchPlugin_:s}=t;if(s){const i=s.getPath(e);i&&s.generatePatches_(e,i,t)}mR(e)}}function cY(e,t,r){const{scope_:a}=e;if(xo(r)){const s=r[Wn];Nb(s,a)&&s.callbacks_.push(function(){jm(e);const l=yk(s);gR(e,r,l,t)})}else qi(r)&&e.callbacks_.push(function(){const i=ro(e);e.type_===3?i.has(r)&&Wm(r,a.handledSet_,a):hN(i,t,e.type_)===r&&a.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Wm(hN(e.copy_,t,e.type_),a.handledSet_,a)})}function Wm(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||xo(e)||t.has(e)||!qi(e)||wb(e)||(t.add(e),gb(e,(a,s)=>{if(xo(s)){const i=s[Wn];if(Nb(i,r)){const l=yk(i);Km(e,a,l,e.type_),mR(i)}}else qi(s)&&Wm(s,t,r)})),e}function dY(e,t){const r=bb(e),a={type_:r?1:0,scope_:t?t.scope_:xR(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=a,i=Ym;r&&(s=[a],i=Jf);const{revoke:l,proxy:o}=Proxy.revocable(s,i);return a.draft_=o,a.revoke_=l,[o,a]}var Ym={get(e,t){if(t===Wn)return e;let r=e.scope_.arrayMethodsPlugin_;const a=e.type_===1&&typeof t=="string";if(a&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const s=ro(e);if(!tF(s,t,e.type_))return uY(e,s,t);const i=s[t];if(e.finalized_||!qi(i)||a&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&rY(t))return i;if(i===Mw(e.base_,t)){jm(e);const l=e.type_===1?+t:t,o=yN(e.scope_,i,e,l);return e.copy_[l]=o}return i},has(e,t){return t in ro(e)},ownKeys(e){return Reflect.ownKeys(ro(e))},set(e,t,r){const a=vR(ro(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=Mw(ro(e),t),i=s==null?void 0:s[Wn];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(tY(r,s)&&(r!==void 0||tF(e.base_,t,e.type_)))return!0;jm(e),vN(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),cY(e,t,r)),!0},deleteProperty(e,t){return jm(e),Mw(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vN(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ro(e),a=Reflect.getOwnPropertyDescriptor(r,t);return a&&{[km]:!0,[pN]:e.type_!==1||t!=="length",[Gm]:a[Gm],[Yf]:r[t]}},defineProperty(){Ii(11)},getPrototypeOf(e){return EA(e.base_)},setPrototypeOf(){Ii(12)}},Jf={};for(let e in Ym){let t=Ym[e];Jf[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Jf.deleteProperty=function(e,t){return Jf.set.call(this,e,t,void 0)};Jf.set=function(e,t,r){return Ym.set.call(this,e[0],t,r,e[0])};function Mw(e,t){const r=e[Wn];return(r?ro(r):e)[t]}function uY(e,t,r){var s;const a=vR(t,r);return a?Yf in a?a[Yf]:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function vR(e,t){if(!(t in e))return;let r=EA(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=EA(r)}}function vN(e){e.modified_||(e.modified_=!0,e.parent_&&vN(e.parent_))}function jm(e){e.copy_||(e.assigned_=new Map,e.copy_=xN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var AY=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,a,s)=>{if(nA(r)&&!nA(a)){const l=a;a=r;const o=this;return function(u=l,...f){return o.produce(u,p=>a.call(this,p,...f))}}nA(a)||Ii(6),s!==void 0&&!nA(s)&&Ii(7);let i;if(qi(r)){const l=sF(this),o=yN(l,r,void 0);let d=!0;try{i=a(o),d=!1}finally{d?gN(l):bN(l)}return nF(l,s),iF(i,l)}else if(!r||!vk(r)){if(i=a(r),i===void 0&&(i=r),i===fR&&(i=void 0),this.autoFreeze_&&wk(i,!0),s){const l=[],o=[];Ld(mN).generateReplacementPatches_(r,i,{patches_:l,inversePatches_:o}),s(l,o)}return i}else Ii(1,r)},this.produceWithPatches=(r,a)=>{if(nA(r))return(o,...d)=>this.produceWithPatches(o,u=>r(u,...d));let s,i;return[this.produce(r,a,(o,d)=>{s=o,i=d}),s,i]},Uw(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Uw(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Uw(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){qi(t)||Ii(8),xo(t)&&(t=Pi(t));const r=sF(this),a=yN(r,t,void 0);return a[Wn].isManual_=!0,bN(r),a}finishDraft(t,r){const a=t&&t[Wn];(!a||!a.isManual_)&&Ii(9);const{scope_:s}=a;return nF(s,r),iF(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let a;for(a=r.length-1;a>=0;a--){const i=r[a];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}a>-1&&(r=r.slice(a+1));const s=Ld(mN).applyPatches_;return xo(t)?s(t,r):this.produce(t,i=>s(i,r))}};function yN(e,t,r,a){const[s,i]=vb(t)?Ld(qm).proxyMap_(t,r):yb(t)?Ld(qm).proxySet_(t,r):dY(t,r);return((r==null?void 0:r.scope_)??xR()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=a,r&&a!==void 0?oY(r,i,a):i.callbacks_.push(function(d){var f;(f=d.mapSetPlugin_)==null||f.fixSetContents(i);const{patchPlugin_:u}=d;i.modified_&&u&&u.generatePatches_(i,[],d)}),s}function Pi(e){return xo(e)||Ii(10,e),yR(e)}function yR(e){if(!qi(e)||wb(e))return e;const t=e[Wn];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=xN(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=xN(e,!0);return gb(r,(s,i)=>{Km(r,s,yR(i))},a),t&&(t.finalized_=!1),r}var fY=new AY,wR=fY.produce;function NR(e){return({dispatch:r,getState:a})=>s=>i=>typeof i=="function"?i(r,a,e):s(i)}var pY=NR(),hY=NR,xY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$m:$m.apply(null,arguments)};function vi(e,t){function r(...a){if(t){let s=t(...a);if(!s)throw new Error(Rs(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:a[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=a=>AR(a)&&a.type===e,r}var CR=class xf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,xf.prototype)}static get[Symbol.species](){return xf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new xf(...t[0].concat(this)):new xf(...t.concat(this))}};function oF(e){return qi(e)?wR(e,()=>{}):e}function yx(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function mY(e){return typeof e=="boolean"}var gY=()=>function(t){const{thunk:r=!0,immutableCheck:a=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let l=new CR;return r&&(mY(r)?l.push(pY):l.push(hY(r.extraArgument))),l},kR="RTK_autoBatch",Or=()=>e=>({payload:e,meta:{[kR]:!0}}),cF=e=>t=>{setTimeout(t,e)},jR=(e={type:"raf"})=>t=>(...r)=>{const a=t(...r);let s=!0,i=!1,l=!1;const o=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:cF(10):e.type==="callback"?e.queueNotification:cF(e.timeout),u=()=>{l=!1,i&&(i=!1,o.forEach(f=>f()))};return Object.assign({},a,{subscribe(f){const p=()=>s&&f(),x=a.subscribe(p);return o.add(f),()=>{x(),o.delete(f)}},dispatch(f){var p;try{return s=!((p=f==null?void 0:f.meta)!=null&&p[kR]),i=!s,i&&(l||(l=!0,d(u))),a.dispatch(f)}finally{s=!0}}})},bY=e=>function(r){const{autoBatch:a=!0}=r??{};let s=new CR(e);return a&&s.push(jR(typeof a=="object"?a:void 0)),s};function vY(e){const t=gY(),{reducer:r=void 0,middleware:a,devTools:s=!0,preloadedState:i=void 0,enhancers:l=void 0}=e||{};let o;if(typeof r=="function")o=r;else if(bk(r))o=uR(r);else throw new Error(Rs(1));let d;typeof a=="function"?d=a(t):d=t();let u=$m;s&&(u=xY({trace:!1,...typeof s=="object"&&s}));const f=ZW(...d),p=bY(f);let x=typeof l=="function"?l(p):p();const m=u(...x);return dR(o,i,m)}function ER(e){const t={},r=[];let a;const s={addCase(i,l){const o=typeof i=="string"?i:i.type;if(!o)throw new Error(Rs(28));if(o in t)throw new Error(Rs(29));return t[o]=l,s},addAsyncThunk(i,l){return l.pending&&(t[i.pending.type]=l.pending),l.rejected&&(t[i.rejected.type]=l.rejected),l.fulfilled&&(t[i.fulfilled.type]=l.fulfilled),l.settled&&r.push({matcher:i.settled,reducer:l.settled}),s},addMatcher(i,l){return r.push({matcher:i,reducer:l}),s},addDefaultCase(i){return a=i,s}};return e(s),[t,r,a]}function yY(e){return typeof e=="function"}function wY(e,t){let[r,a,s]=ER(t),i;if(yY(e))i=()=>oF(e());else{const o=oF(e);i=()=>o}function l(o=i(),d){let u=[r[d.type],...a.filter(({matcher:f})=>f(d)).map(({reducer:f})=>f)];return u.filter(f=>!!f).length===0&&(u=[s]),u.reduce((f,p)=>{if(p)if(xo(f)){const m=p(f,d);return m===void 0?f:m}else{if(qi(f))return wR(f,x=>p(x,d));{const x=p(f,d);if(x===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return f},o)}return l.getInitialState=i,l}var NY="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",CY=(e=21)=>{let t="",r=e;for(;r--;)t+=NY[Math.random()*64|0];return t},kY=Symbol.for("rtk-slice-createasyncthunk");function jY(e,t){return`${e}/${t}`}function EY({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[kY];return function(s){const{name:i,reducerPath:l=i}=s;if(!i)throw new Error(Rs(11));const o=(typeof s.reducers=="function"?s.reducers(BY()):s.reducers)||{},d=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(E,T){const B=typeof E=="string"?E:E.type;if(!B)throw new Error(Rs(12));if(B in u.sliceCaseReducersByType)throw new Error(Rs(13));return u.sliceCaseReducersByType[B]=T,f},addMatcher(E,T){return u.sliceMatchers.push({matcher:E,reducer:T}),f},exposeAction(E,T){return u.actionCreators[E]=T,f},exposeCaseReducer(E,T){return u.sliceCaseReducersByName[E]=T,f}};d.forEach(E=>{const T=o[E],B={reducerName:E,type:jY(i,E),createNotation:typeof s.reducers=="function"};TY(T)?IY(B,T,f,t):_Y(B,T,f)});function p(){const[E={},T=[],B=void 0]=typeof s.extraReducers=="function"?ER(s.extraReducers):[s.extraReducers],I={...E,...u.sliceCaseReducersByType};return wY(s.initialState,M=>{for(let U in I)M.addCase(U,I[U]);for(let U of u.sliceMatchers)M.addMatcher(U.matcher,U.reducer);for(let U of T)M.addMatcher(U.matcher,U.reducer);B&&M.addDefaultCase(B)})}const x=E=>E,m=new Map,b=new WeakMap;let v;function y(E,T){return v||(v=p()),v(E,T)}function k(){return v||(v=p()),v.getInitialState()}function _(E,T=!1){function B(M){let U=M[E];return typeof U>"u"&&T&&(U=yx(b,B,k)),U}function I(M=x){const U=yx(m,T,()=>new WeakMap);return yx(U,M,()=>{const D={};for(const[L,R]of Object.entries(s.selectors??{}))D[L]=SY(R,M,()=>yx(b,M,k),T);return D})}return{reducerPath:E,getSelectors:I,get selectors(){return I(B)},selectSlice:B}}const C={name:i,reducer:y,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:k,..._(l),injectInto(E,{reducerPath:T,...B}={}){const I=T??l;return E.inject({reducerPath:I,reducer:y},B),{...C,..._(I,!0)}}};return C}}function SY(e,t,r,a){function s(i,...l){let o=t(i);return typeof o>"u"&&a&&(o=r()),e(o,...l)}return s.unwrapped=e,s}var ms=EY();function BY(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function _Y({type:e,reducerName:t,createNotation:r},a,s){let i,l;if("reducer"in a){if(r&&!FY(a))throw new Error(Rs(17));i=a.reducer,l=a.prepare}else i=a;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,l?vi(e,l):vi(e))}function TY(e){return e._reducerDefinitionType==="asyncThunk"}function FY(e){return e._reducerDefinitionType==="reducerWithPrepare"}function IY({type:e,reducerName:t},r,a,s){if(!s)throw new Error(Rs(18));const{payloadCreator:i,fulfilled:l,pending:o,rejected:d,settled:u,options:f}=r,p=s(e,i,f);a.exposeAction(t,p),l&&a.addCase(p.fulfilled,l),o&&a.addCase(p.pending,o),d&&a.addCase(p.rejected,d),u&&a.addMatcher(p.settled,u),a.exposeCaseReducer(t,{fulfilled:l||wx,pending:o||wx,rejected:d||wx,settled:u||wx})}function wx(){}var DY="task",SR="listener",BR="completed",Nk="cancelled",UY=`task-${Nk}`,MY=`task-${BR}`,wN=`${SR}-${Nk}`,RY=`${SR}-${BR}`,Cb=class{constructor(e){Ty(this,"name","TaskAbortError");Ty(this,"message");this.code=e,this.message=`${DY} ${Nk} (reason: ${e})`}},Ck=(e,t)=>{if(typeof e!="function")throw new TypeError(Rs(32))},Xm=()=>{},_R=(e,t=Xm)=>(e.catch(t),e),TR=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),jd=e=>{if(e.aborted)throw new Cb(e.reason)};function FR(e,t){let r=Xm;return new Promise((a,s)=>{const i=()=>s(new Cb(e.reason));if(e.aborted){i();return}r=TR(e,i),t.finally(()=>r()).then(a,s)}).finally(()=>{r=Xm})}var OY=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Cb?"cancelled":"rejected",error:r}}finally{t==null||t()}},Jm=e=>t=>_R(FR(e,t).then(r=>(jd(e),r))),IR=e=>{const t=Jm(e);return r=>t(new Promise(a=>setTimeout(a,r)))},{assign:xA}=Object,dF={},kb="listenerMiddleware",PY=(e,t)=>{const r=a=>TR(e,()=>a.abort(e.reason));return(a,s)=>{Ck(a);const i=new AbortController;r(i);const l=OY(async()=>{jd(e),jd(i.signal);const o=await a({pause:Jm(i.signal),delay:IR(i.signal),signal:i.signal});return jd(i.signal),o},()=>i.abort(MY));return s!=null&&s.autoJoin&&t.push(l.catch(Xm)),{result:Jm(e)(l),cancel(){i.abort(UY)}}}},LY=(e,t)=>{const r=async(a,s)=>{jd(t);let i=()=>{};const o=[new Promise((d,u)=>{let f=e({predicate:a,effect:(p,x)=>{x.unsubscribe(),d([p,x.getState(),x.getOriginalState()])}});i=()=>{f(),u()}})];s!=null&&o.push(new Promise(d=>setTimeout(d,s,null)));try{const d=await FR(t,Promise.race(o));return jd(t),d}finally{i()}};return(a,s)=>_R(r(a,s))},DR=e=>{let{type:t,actionCreator:r,matcher:a,predicate:s,effect:i}=e;if(t)s=vi(t).match;else if(r)t=r.type,s=r.match;else if(a)s=a;else if(!s)throw new Error(Rs(21));return Ck(i),{predicate:s,type:t,effect:i}},UR=xA(e=>{const{type:t,predicate:r,effect:a}=DR(e);return{id:CY(),effect:a,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Rs(22))}}},{withTypes:()=>UR}),uF=(e,t)=>{const{type:r,effect:a,predicate:s}=DR(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===a)},NN=e=>{e.pending.forEach(t=>{t.abort(wN)})},QY=(e,t)=>()=>{for(const r of t.keys())NN(r);e.clear()},AF=(e,t,r)=>{try{e(t,r)}catch(a){setTimeout(()=>{throw a},0)}},MR=xA(vi(`${kb}/add`),{withTypes:()=>MR}),HY=vi(`${kb}/removeAll`),RR=xA(vi(`${kb}/remove`),{withTypes:()=>RR}),zY=(...e)=>{console.error(`${kb}/error`,...e)},Dp=(e={})=>{const t=new Map,r=new Map,a=m=>{const b=r.get(m)??0;r.set(m,b+1)},s=m=>{const b=r.get(m)??1;b===1?r.delete(m):r.set(m,b-1)},{extra:i,onError:l=zY}=e;Ck(l);const o=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),b=>{m.unsubscribe(),b!=null&&b.cancelActive&&NN(m)}),d=m=>{const b=uF(t,m)??UR(m);return o(b)};xA(d,{withTypes:()=>d});const u=m=>{const b=uF(t,m);return b&&(b.unsubscribe(),m.cancelActive&&NN(b)),!!b};xA(u,{withTypes:()=>u});const f=async(m,b,v,y)=>{const k=new AbortController,_=LY(d,k.signal),C=[];try{m.pending.add(k),a(m),await Promise.resolve(m.effect(b,xA({},v,{getOriginalState:y,condition:(E,T)=>_(E,T).then(Boolean),take:_,delay:IR(k.signal),pause:Jm(k.signal),extra:i,signal:k.signal,fork:PY(k.signal,C),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((E,T,B)=>{E!==k&&(E.abort(wN),B.delete(E))})},cancel:()=>{k.abort(wN),m.pending.delete(k)},throwIfCancelled:()=>{jd(k.signal)}})))}catch(E){E instanceof Cb||AF(l,E,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(RY),s(m),m.pending.delete(k)}},p=QY(t,r);return{middleware:m=>b=>v=>{if(!AR(v))return b(v);if(MR.match(v))return d(v.payload);if(HY.match(v)){p();return}if(RR.match(v))return u(v.payload);let y=m.getState();const k=()=>{if(y===dF)throw new Error(Rs(23));return y};let _;try{if(_=b(v),t.size>0){const C=m.getState(),E=Array.from(t.values());for(const T of E){let B=!1;try{B=T.predicate(v,C,y)}catch(I){B=!1,AF(l,I,{raisedBy:"predicate"})}B&&f(T,v,m,k)}}}finally{y=dF}return _},startListening:d,stopListening:u,clearListeners:p}};function Rs(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 $Y={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},OR=ms({name:"chartLayout",initialState:$Y,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,a,s,i;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(a=t.payload.right)!==null&&a!==void 0?a:0,e.margin.bottom=(s=t.payload.bottom)!==null&&s!==void 0?s:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:VY,setLayout:GY,setChartSize:KY,setScale:qY}=OR.actions,WY=OR.reducer;function PR(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Ht(e){return Number.isFinite(e)}function kl(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function fF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function cA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fF(Object(r),!0).forEach(function(a){YY(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function YY(e,t,r){return(t=XY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XY(e){var t=JY(e,"string");return typeof t=="symbol"?t:t+""}function JY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yn(e,t,r){return Rn(e)||Rn(t)?r:Cl(t)?hb(e,t,r):typeof t=="function"?t(e):r}var ZY=(e,t,r)=>{if(t&&r){var{width:a,height:s}=r,{align:i,verticalAlign:l,layout:o}=t;if((o==="vertical"||o==="horizontal"&&l==="middle")&&i!=="center"&&ct(e[i]))return cA(cA({},e),{},{[i]:e[i]+(a||0)});if((o==="horizontal"||o==="vertical"&&i==="center")&&l!=="middle"&&ct(e[l]))return cA(cA({},e),{},{[l]:e[l]+(s||0)})}return e},Bl=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",LR=(e,t,r,a)=>{if(a)return e.map(o=>o.coordinate);var s,i,l=e.map(o=>(o.coordinate===t&&(s=!0),o.coordinate===r&&(i=!0),o.coordinate));return s||l.push(t),i||l.push(r),l},QR=(e,t,r)=>{if(!e)return null;var{duplicateDomain:a,type:s,range:i,scale:l,realScaleType:o,isCategorical:d,categoricalDomain:u,tickCount:f,ticks:p,niceTicks:x,axisType:m}=e;if(!l)return null;var b=o==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,v=s==="category"&&l.bandwidth?l.bandwidth()/b:0;if(v=m==="angleAxis"&&i&&i.length>=2?Ai(i[0]-i[1])*2*v:v,p||x){var y=(p||x||[]).map((k,_)=>{var C=a?a.indexOf(k):k,E=l.map(C);return Ht(E)?{coordinate:E+v,value:k,offset:v,index:_}:null}).filter(ds);return y}return d&&u?u.map((k,_)=>{var C=l.map(k);return Ht(C)?{coordinate:C+v,value:k,index:_,offset:v}:null}).filter(ds):l.ticks&&f!=null?l.ticks(f).map((k,_)=>{var C=l.map(k);return Ht(C)?{coordinate:C+v,value:k,index:_,offset:v}:null}).filter(ds):l.domain().map((k,_)=>{var C=l.map(k);return Ht(C)?{coordinate:C+v,value:a?a[k]:k,index:_,offset:v}:null}).filter(ds)},eX=e=>{var t,r=e.length;if(!(r<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var s=0;s<a;++s)for(var i=0,l=0,o=0;o<r;++o){var d=e[o],u=d==null?void 0:d[s];if(u!=null){var f=u[1],p=u[0],x=Nl(f)?p:f;x>=0?(u[0]=i,i+=x,u[1]=i):(u[0]=l,l+=x,u[1]=l)}}}},tX=e=>{var t,r=e.length;if(!(r<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var s=0;s<a;++s)for(var i=0,l=0;l<r;++l){var o=e[l],d=o==null?void 0:o[s];if(d!=null){var u=Nl(d[1])?d[0]:d[1];u>=0?(d[0]=i,i+=u,d[1]=i):(d[0]=0,d[1]=0)}}}},rX={sign:eX,expand:Lq,none:Od,silhouette:Qq,wiggle:Hq,positive:tX},aX=(e,t,r)=>{var a,s=(a=rX[r])!==null&&a!==void 0?a:Od,i=Pq().keys(t).value((o,d)=>Number(yn(o,d,0))).order(fN).offset(s),l=i(e);return l.forEach((o,d)=>{o.forEach((u,f)=>{var p=yn(e[f],t[d],0);Array.isArray(p)&&p.length===2&&ct(p[0])&&ct(p[1])&&(u[0]=p[0],u[1]=p[1])})}),l};function nX(e){return e==null?void 0:String(e)}function pF(e){var{axis:t,ticks:r,bandSize:a,entry:s,index:i,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Rn(s[t.dataKey])){var o=YM(r,"value",s[t.dataKey]);if(o)return o.coordinate+a/2}return r!=null&&r[i]?r[i].coordinate+a/2:null}var d=yn(s,Rn(l)?t.dataKey:l),u=t.scale.map(d);return ct(u)?u:null}var sX=e=>{var t=e.flat(2).filter(ct);return[Math.min(...t),Math.max(...t)]},iX=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],lX=(e,t,r)=>{if(e!=null)return iX(Object.keys(e).reduce((a,s)=>{var i=e[s];if(!i)return a;var{stackedData:l}=i,o=l.reduce((d,u)=>{var f=PR(u,t,r),p=sX(f);return!Ht(p[0])||!Ht(p[1])?d:[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(o[0],a[0]),Math.max(o[1],a[1])]},[1/0,-1/0]))},hF=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,xF=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Zm=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!r||a>0)return a}if(e&&t&&t.length>=2){for(var s=xb(t,f=>f.coordinate),i=1/0,l=1,o=s.length;l<o;l++){var d=s[l],u=s[l-1];i=Math.min(((d==null?void 0:d.coordinate)||0)-((u==null?void 0:u.coordinate)||0),i)}return i===1/0?0:i}return r?void 0:0};function mF(e){var{tooltipEntrySettings:t,dataKey:r,payload:a,value:s,name:i}=e;return cA(cA({},t),{},{dataKey:r,payload:a,value:s,name:i})}function HR(e,t){if(e)return String(e);if(typeof t=="string")return t}var oX=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},cX=(e,t)=>t==="centric"?e.angle:e.radius,jo=e=>e.layout.width,Eo=e=>e.layout.height,dX=e=>e.layout.scale,zR=e=>e.layout.margin,jb=De(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Eb=De(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),uX="data-recharts-item-index",AX="data-recharts-item-id",Up=60;function gF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Nx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gF(Object(r),!0).forEach(function(a){fX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function fX(e,t,r){return(t=pX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pX(e){var t=hX(e,"string");return typeof t=="symbol"?t:t+""}function hX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xX=e=>e.brush.height;function mX(e){var t=Eb(e);return t.reduce((r,a)=>{if(a.orientation==="left"&&!a.mirror&&!a.hide){var s=typeof a.width=="number"?a.width:Up;return r+s}return r},0)}function gX(e){var t=Eb(e);return t.reduce((r,a)=>{if(a.orientation==="right"&&!a.mirror&&!a.hide){var s=typeof a.width=="number"?a.width:Up;return r+s}return r},0)}function bX(e){var t=jb(e);return t.reduce((r,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?r+a.height:r,0)}function vX(e){var t=jb(e);return t.reduce((r,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?r+a.height:r,0)}var kn=De([jo,Eo,zR,xX,mX,gX,bX,vX,cR,KW],(e,t,r,a,s,i,l,o,d,u)=>{var f={left:(r.left||0)+s,right:(r.right||0)+i},p={top:(r.top||0)+l,bottom:(r.bottom||0)+o},x=Nx(Nx({},p),f),m=x.bottom;x.bottom+=a,x=ZY(x,d,u);var b=e-x.left-x.right,v=t-x.top-x.bottom;return Nx(Nx({brushBottom:m},x),{},{width:Math.max(b,0),height:Math.max(v,0)})}),yX=De(kn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),$R=De(jo,Eo,(e,t)=>({x:0,y:0,width:e,height:t})),wX=j.createContext(null),gs=()=>j.useContext(wX)!=null,Sb=e=>e.brush,Bb=De([Sb,kn,zR],(e,t,r)=>({height:e.height,x:ct(e.x)?e.x:t.left,y:ct(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:ct(e.width)?e.width:t.width})),Rw={},Ow={},Pw={},bF;function NX(){return bF||(bF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a,{signal:s,edges:i}={}){let l,o=null;const d=i!=null&&i.includes("leading"),u=i==null||i.includes("trailing"),f=()=>{o!==null&&(r.apply(l,o),l=void 0,o=null)},p=()=>{u&&f(),v()};let x=null;const m=()=>{x!=null&&clearTimeout(x),x=setTimeout(()=>{x=null,p()},a)},b=()=>{x!==null&&(clearTimeout(x),x=null)},v=()=>{b(),l=void 0,o=null},y=()=>{f()},k=function(..._){if(s!=null&&s.aborted)return;l=this,o=_;const C=x==null;m(),d&&C&&f()};return k.schedule=m,k.cancel=v,k.flush=y,s==null||s.addEventListener("abort",v,{once:!0}),k}e.debounce=t})(Pw)),Pw}var vF;function CX(){return vF||(vF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NX();function r(a,s=0,i={}){typeof i!="object"&&(i={});const{leading:l=!1,trailing:o=!0,maxWait:d}=i,u=Array(2);l&&(u[0]="leading"),o&&(u[1]="trailing");let f,p=null;const x=t.debounce(function(...v){f=a.apply(this,v),p=null},s,{edges:u}),m=function(...v){return d!=null&&(p===null&&(p=Date.now()),Date.now()-p>=d)?(f=a.apply(this,v),p=Date.now(),x.cancel(),x.schedule(),f):(x.apply(this,v),f)},b=()=>(x.flush(),f);return m.cancel=x.cancel,m.flush=b,m}e.debounce=r})(Ow)),Ow}var yF;function kX(){return yF||(yF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CX();function r(a,s=0,i={}){const{leading:l=!0,trailing:o=!0}=i;return t.debounce(a,s,{leading:l,maxWait:s,trailing:o})}e.throttle=r})(Rw)),Rw}var Lw,wF;function jX(){return wF||(wF=1,Lw=kX().throttle),Lw}var EX=jX();const SX=El(EX);var eg=function(t,r){for(var a=arguments.length,s=new Array(a>2?a-2:0),i=2;i<a;i++)s[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>s[l++]))}},hl={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},VR=(e,t,r)=>{var{width:a=hl.width,height:s=hl.height,aspect:i,maxHeight:l}=r,o=Pd(a)?e:Number(a),d=Pd(s)?t:Number(s);return i&&i>0&&(o?d=o/i:d&&(o=d*i),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:o,calculatedHeight:d}},BX={width:0,height:0,overflow:"visible"},_X={width:0,overflowX:"visible"},TX={height:0,overflowY:"visible"},FX={},IX=e=>{var{width:t,height:r}=e,a=Pd(t),s=Pd(r);return a&&s?BX:a?_X:s?TX:FX};function DX(e){var{width:t,height:r,aspect:a}=e,s=t,i=r;return s===void 0&&i===void 0?(s=hl.width,i=hl.height):s===void 0?s=a&&a>0?void 0:hl.width:i===void 0&&(i=a&&a>0?void 0:hl.height),{width:s,height:i}}function CN(){return CN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},CN.apply(null,arguments)}function NF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function CF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NF(Object(r),!0).forEach(function(a){UX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function UX(e,t,r){return(t=MX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MX(e){var t=RX(e,"string");return typeof t=="symbol"?t:t+""}function RX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GR=j.createContext(hl.initialDimension);function OX(e){return kl(e.width)&&kl(e.height)}function KR(e){var{children:t,width:r,height:a}=e,s=j.useMemo(()=>({width:r,height:a}),[r,a]);return OX(s)?j.createElement(GR.Provider,{value:s},t):null}var kk=()=>j.useContext(GR),PX=j.forwardRef((e,t)=>{var{aspect:r,initialDimension:a=hl.initialDimension,width:s,height:i,minWidth:l=hl.minWidth,minHeight:o,maxHeight:d,children:u,debounce:f=hl.debounce,id:p,className:x,onResize:m,style:b={}}=e,v=j.useRef(null),y=j.useRef();y.current=m,j.useImperativeHandle(t,()=>v.current);var[k,_]=j.useState({containerWidth:a.width,containerHeight:a.height}),C=j.useCallback((M,U)=>{_(D=>{var L=Math.round(M),R=Math.round(U);return D.containerWidth===L&&D.containerHeight===R?D:{containerWidth:L,containerHeight:R}})},[]);j.useEffect(()=>{if(v.current==null||typeof ResizeObserver>"u")return LA;var M=R=>{var Q,G=R[0];if(G!=null){var{width:K,height:W}=G.contentRect;C(K,W),(Q=y.current)===null||Q===void 0||Q.call(y,K,W)}};f>0&&(M=SX(M,f,{trailing:!0,leading:!1}));var U=new ResizeObserver(M),{width:D,height:L}=v.current.getBoundingClientRect();return C(D,L),U.observe(v.current),()=>{U.disconnect()}},[C,f]);var{containerWidth:E,containerHeight:T}=k;eg(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:B,calculatedHeight:I}=VR(E,T,{width:s,height:i,aspect:r,maxHeight:d});return eg(B!=null&&B>0||I!=null&&I>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,B,I,s,i,l,o,r),j.createElement("div",{id:p?"".concat(p):void 0,className:Fr("recharts-responsive-container",x),style:CF(CF({},b),{},{width:s,height:i,minWidth:l,minHeight:o,maxHeight:d}),ref:v},j.createElement("div",{style:IX({width:s,height:i})},j.createElement(KR,{width:B,height:I},u)))}),jk=j.forwardRef((e,t)=>{var r=kk();if(kl(r.width)&&kl(r.height))return e.children;var{width:a,height:s}=DX({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:l}=VR(void 0,void 0,{width:a,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return ct(i)&&ct(l)?j.createElement(KR,{width:i,height:l},e.children):j.createElement(PX,CN({},e,{width:a,height:s,ref:t}))});function Ek(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 _b=()=>{var e,t=gs(),r=pt(yX),a=pt(Bb),s=(e=pt(Sb))===null||e===void 0?void 0:e.padding;return!t||!a||!s?r:{width:a.width-s.left-s.right,height:a.height-s.top-s.bottom,x:s.left,y:s.top}},LX={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},qR=()=>{var e;return(e=pt(kn))!==null&&e!==void 0?e:LX},WR=()=>pt(jo),YR=()=>pt(Eo),Hr=e=>e.layout.layoutType,QA=()=>pt(Hr),Sk=()=>{var e=QA();if(e==="horizontal"||e==="vertical")return e},XR=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},QX=()=>{var e=QA();return e!==void 0},Mp=e=>{var t=en(),r=gs(),{width:a,height:s}=e,i=kk(),l=a,o=s;return i&&(l=i.width>0?i.width:a,o=i.height>0?i.height:s),j.useEffect(()=>{!r&&kl(l)&&kl(o)&&t(KY({width:l,height:o}))},[t,r,l,o]),null},JR=Symbol.for("immer-nothing"),kF=Symbol.for("immer-draftable"),Ls=Symbol.for("immer-state");function Di(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Zf=Object.getPrototypeOf;function SA(e){return!!e&&!!e[Ls]}function Qd(e){var t;return e?ZR(e)||Array.isArray(e)||!!e[kF]||!!((t=e.constructor)!=null&&t[kF])||Rp(e)||Fb(e):!1}var HX=Object.prototype.constructor.toString(),jF=new WeakMap;function ZR(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let a=jF.get(r);return a===void 0&&(a=Function.toString.call(r),jF.set(r,a)),a===HX}function tg(e,t,r=!0){Tb(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((a,s)=>t(s,a,e))}function Tb(e){const t=e[Ls];return t?t.type_:Array.isArray(e)?1:Rp(e)?2:Fb(e)?3:0}function kN(e,t){return Tb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function eO(e,t,r){const a=Tb(e);a===2?e.set(t,r):a===3?e.add(r):e[t]=r}function zX(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Rp(e){return e instanceof Map}function Fb(e){return e instanceof Set}function hd(e){return e.copy_||e.base_}function jN(e,t){if(Rp(e))return new Map(e);if(Fb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=ZR(e);if(t===!0||t==="class_only"&&!r){const a=Object.getOwnPropertyDescriptors(e);delete a[Ls];let s=Reflect.ownKeys(a);for(let i=0;i<s.length;i++){const l=s[i],o=a[l];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(a[l]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[l]})}return Object.create(Zf(e),a)}else{const a=Zf(e);if(a!==null&&r)return{...e};const s=Object.create(a);return Object.assign(s,e)}}function Bk(e,t=!1){return Ib(e)||SA(e)||!Qd(e)||(Tb(e)>1&&Object.defineProperties(e,{set:Cx,add:Cx,clear:Cx,delete:Cx}),Object.freeze(e),t&&Object.values(e).forEach(r=>Bk(r,!0))),e}function $X(){Di(2)}var Cx={value:$X};function Ib(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var VX={};function Hd(e){const t=VX[e];return t||Di(0,e),t}var ep;function tO(){return ep}function GX(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function EF(e,t){t&&(Hd("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function EN(e){SN(e),e.drafts_.forEach(KX),e.drafts_=null}function SN(e){e===ep&&(ep=e.parent_)}function SF(e){return ep=GX(ep,e)}function KX(e){const t=e[Ls];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function BF(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ls].modified_&&(EN(t),Di(4)),Qd(e)&&(e=rg(t,e),t.parent_||ag(t,e)),t.patches_&&Hd("Patches").generateReplacementPatches_(r[Ls].base_,e,t.patches_,t.inversePatches_)):e=rg(t,r,[]),EN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==JR?e:void 0}function rg(e,t,r){if(Ib(t))return t;const a=e.immer_.shouldUseStrictIteration(),s=t[Ls];if(!s)return tg(t,(i,l)=>_F(e,s,t,i,l,r),a),t;if(s.scope_!==e)return t;if(!s.modified_)return ag(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const i=s.copy_;let l=i,o=!1;s.type_===3&&(l=new Set(i),i.clear(),o=!0),tg(l,(d,u)=>_F(e,s,i,d,u,r,o),a),ag(e,i,!1),r&&e.patches_&&Hd("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function _F(e,t,r,a,s,i,l){if(s==null||typeof s!="object"&&!l)return;const o=Ib(s);if(!(o&&!l)){if(SA(s)){const d=i&&t&&t.type_!==3&&!kN(t.assigned_,a)?i.concat(a):void 0,u=rg(e,s,d);if(eO(r,a,u),SA(u))e.canAutoFreeze_=!1;else return}else l&&r.add(s);if(Qd(s)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===s&&o)return;rg(e,s),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Rp(r)?r.has(a):Object.prototype.propertyIsEnumerable.call(r,a))&&ag(e,s)}}}function ag(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bk(t,r)}function qX(e,t){const r=Array.isArray(e),a={type_:r?1:0,scope_:t?t.scope_:tO(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=a,i=_k;r&&(s=[a],i=tp);const{revoke:l,proxy:o}=Proxy.revocable(s,i);return a.draft_=o,a.revoke_=l,o}var _k={get(e,t){if(t===Ls)return e;const r=hd(e);if(!kN(r,t))return WX(e,r,t);const a=r[t];return e.finalized_||!Qd(a)?a:a===Qw(e.base_,t)?(Hw(e),e.copy_[t]=_N(a,e)):a},has(e,t){return t in hd(e)},ownKeys(e){return Reflect.ownKeys(hd(e))},set(e,t,r){const a=rO(hd(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=Qw(hd(e),t),i=s==null?void 0:s[Ls];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(zX(r,s)&&(r!==void 0||kN(e.base_,t)))return!0;Hw(e),BN(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Qw(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Hw(e),BN(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=hd(e),a=Reflect.getOwnPropertyDescriptor(r,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:r[t]}},defineProperty(){Di(11)},getPrototypeOf(e){return Zf(e.base_)},setPrototypeOf(){Di(12)}},tp={};tg(_k,(e,t)=>{tp[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tp.deleteProperty=function(e,t){return tp.set.call(this,e,t,void 0)};tp.set=function(e,t,r){return _k.set.call(this,e[0],t,r,e[0])};function Qw(e,t){const r=e[Ls];return(r?hd(r):e)[t]}function WX(e,t,r){var s;const a=rO(t,r);return a?"value"in a?a.value:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function rO(e,t){if(!(t in e))return;let r=Zf(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=Zf(r)}}function BN(e){e.modified_||(e.modified_=!0,e.parent_&&BN(e.parent_))}function Hw(e){e.copy_||(e.copy_=jN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var YX=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,a)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const l=this;return function(d=i,...u){return l.produce(d,f=>r.call(this,f,...u))}}typeof r!="function"&&Di(6),a!==void 0&&typeof a!="function"&&Di(7);let s;if(Qd(t)){const i=SF(this),l=_N(t,void 0);let o=!0;try{s=r(l),o=!1}finally{o?EN(i):SN(i)}return EF(i,a),BF(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===JR&&(s=void 0),this.autoFreeze_&&Bk(s,!0),a){const i=[],l=[];Hd("Patches").generateReplacementPatches_(t,s,i,l),a(i,l)}return s}else Di(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(l,...o)=>this.produceWithPatches(l,d=>t(d,...o));let a,s;return[this.produce(t,r,(l,o)=>{a=l,s=o}),a,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Qd(e)||Di(8),SA(e)&&(e=XX(e));const t=SF(this),r=_N(e,void 0);return r[Ls].isManual_=!0,SN(t),r}finishDraft(e,t){const r=e&&e[Ls];(!r||!r.isManual_)&&Di(9);const{scope_:a}=r;return EF(a,t),BF(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));const a=Hd("Patches").applyPatches_;return SA(e)?a(e,t):this.produce(e,s=>a(s,t))}};function _N(e,t){const r=Rp(e)?Hd("MapSet").proxyMap_(e,t):Fb(e)?Hd("MapSet").proxySet_(e,t):qX(e,t);return(t?t.scope_:tO()).drafts_.push(r),r}function XX(e){return SA(e)||Di(10,e),aO(e)}function aO(e){if(!Qd(e)||Ib(e))return e;const t=e[Ls];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=jN(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=jN(e,!0);return tg(r,(s,i)=>{eO(r,s,aO(i))},a),t&&(t.finalized_=!1),r}var JX=new YX;JX.produce;var ZX={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},nO=ms({name:"legend",initialState:ZX,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(t.payload)},prepare:Or()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:a}=t.payload,s=Pi(e).payload.indexOf(r);s>-1&&(e.payload[s]=a)},prepare:Or()},removeLegendPayload:{reducer(e,t){var r=Pi(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Or()}}}),{setLegendSize:oIe,setLegendSettings:cIe,addLegendPayload:eJ,replaceLegendPayload:tJ,removeLegendPayload:rJ}=nO.actions,aJ=nO.reducer;function TN(){return TN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},TN.apply(null,arguments)}function TF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function W0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TF(Object(r),!0).forEach(function(a){nJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function nJ(e,t,r){return(t=sJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sJ(e){var t=iJ(e,"string");return typeof t=="symbol"?t:t+""}function iJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lJ(e){return Array.isArray(e)&&Cl(e[0])&&Cl(e[1])?e.join(" ~ "):e}var zu={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},oJ=e=>{var{separator:t=zu.separator,contentStyle:r,itemStyle:a,labelStyle:s=zu.labelStyle,payload:i,formatter:l,itemSorter:o,wrapperClassName:d,labelClassName:u,label:f,labelFormatter:p,accessibilityLayer:x=zu.accessibilityLayer}=e,m=()=>{if(i&&i.length){var T={padding:0,margin:0},B=(o?xb(i,o):i).map((I,M)=>{if(I.type==="none")return null;var U=I.formatter||l||lJ,{value:D,name:L}=I,R=D,Q=L;if(U){var G=U(D,L,I,M,i);if(Array.isArray(G))[R,Q]=G;else if(G!=null)R=G;else return null}var K=W0(W0({},zu.itemStyle),{},{color:I.color||zu.itemStyle.color},a);return j.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:K},Cl(Q)?j.createElement("span",{className:"recharts-tooltip-item-name"},Q):null,Cl(Q)?j.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,j.createElement("span",{className:"recharts-tooltip-item-value"},R),j.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return j.createElement("ul",{className:"recharts-tooltip-item-list",style:T},B)}return null},b=W0(W0({},zu.contentStyle),r),v=W0({margin:0},s),y=!Rn(f),k=y?f:"",_=Fr("recharts-default-tooltip",d),C=Fr("recharts-tooltip-label",u);y&&p&&i!==void 0&&i!==null&&(k=p(f,i));var E=x?{role:"status","aria-live":"assertive"}:{};return j.createElement("div",TN({className:_,style:b},E),j.createElement("p",{className:C,style:v},j.isValidElement(k)?k:"".concat(k)),m())},Y0="recharts-tooltip-wrapper",cJ={visibility:"hidden"};function dJ(e){var{coordinate:t,translateX:r,translateY:a}=e;return Fr(Y0,{["".concat(Y0,"-right")]:ct(r)&&t&&ct(t.x)&&r>=t.x,["".concat(Y0,"-left")]:ct(r)&&t&&ct(t.x)&&r<t.x,["".concat(Y0,"-bottom")]:ct(a)&&t&&ct(t.y)&&a>=t.y,["".concat(Y0,"-top")]:ct(a)&&t&&ct(t.y)&&a<t.y})}function FF(e){var{allowEscapeViewBox:t,coordinate:r,key:a,offset:s,position:i,reverseDirection:l,tooltipDimension:o,viewBox:d,viewBoxDimension:u}=e;if(i&&ct(i[a]))return i[a];var f=r[a]-o-(s>0?s:0),p=r[a]+s;if(t[a])return l[a]?f:p;var x=d[a];if(x==null)return 0;if(l[a]){var m=f,b=x;return m<b?Math.max(p,x):Math.max(f,x)}if(u==null)return 0;var v=p+o,y=x+u;return v>y?Math.max(f,x):Math.max(p,x)}function uJ(e){var{translateX:t,translateY:r,useTranslate3d:a}=e;return{transform:a?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function AJ(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:a,offsetLeft:s,position:i,reverseDirection:l,tooltipBox:o,useTranslate3d:d,viewBox:u}=e,f,p,x;return o.height>0&&o.width>0&&r?(p=FF({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:l,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),x=FF({allowEscapeViewBox:t,coordinate:r,key:"y",offset:a,position:i,reverseDirection:l,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),f=uJ({translateX:p,translateY:x,useTranslate3d:d})):f=cJ,{cssProperties:f,cssClasses:dJ({translateX:p,translateY:x,coordinate:r})}}function IF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function kx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IF(Object(r),!0).forEach(function(a){FN(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function FN(e,t,r){return(t=fJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fJ(e){var t=pJ(e,"string");return typeof t=="symbol"?t:t+""}function pJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class hJ extends j.PureComponent{constructor(){super(...arguments),FN(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),FN(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,a,s,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(a=this.props.coordinate)===null||a===void 0?void 0:a.x)!==null&&r!==void 0?r:0,y:(s=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&s!==void 0?s:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:a,animationEasing:s,children:i,coordinate:l,hasPayload:o,isAnimationActive:d,offset:u,position:f,reverseDirection:p,useTranslate3d:x,viewBox:m,wrapperStyle:b,lastBoundingBox:v,innerRef:y,hasPortalFromProps:k}=this.props,_=typeof u=="number"?u:u.x,C=typeof u=="number"?u:u.y,{cssClasses:E,cssProperties:T}=AJ({allowEscapeViewBox:r,coordinate:l,offsetLeft:_,offsetTop:C,position:f,reverseDirection:p,tooltipBox:{height:v.height,width:v.width},useTranslate3d:x,viewBox:m}),B=k?{}:kx(kx({transition:d&&t?"transform ".concat(a,"ms ").concat(s):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&o?"visible":"hidden",position:"absolute",top:0,left:0}),I=kx(kx({},B),{},{visibility:!this.state.dismissed&&t&&o?"visible":"hidden"},b);return j.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:E,style:I,ref:y},i)}}var sO=()=>{var e;return(e=pt(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function IN(){return IN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},IN.apply(null,arguments)}function DF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function UF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DF(Object(r),!0).forEach(function(a){xJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function xJ(e,t,r){return(t=mJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mJ(e){var t=gJ(e,"string");return typeof t=="symbol"?t:t+""}function gJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MF={curveBasisClosed:Sq,curveBasisOpen:Bq,curveBasis:Eq,curveBumpX:kq,curveBumpY:jq,curveLinearClosed:_q,curveLinear:fb,curveMonotoneX:Tq,curveMonotoneY:Fq,curveNatural:Iq,curveStep:Dq,curveStepAfter:Mq,curveStepBefore:Uq},ng=e=>Ht(e.x)&&Ht(e.y),RF=e=>e.base!=null&&ng(e.base)&&ng(e),X0=e=>e.x,J0=e=>e.y,bJ=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(pk(e));if((r==="curveMonotone"||r==="curveBump")&&t){var a=MF["".concat(r).concat(t==="vertical"?"Y":"X")];if(a)return a}return MF[r]||fb},OF={connectNulls:!1,type:"linear"},vJ=e=>{var{type:t=OF.type,points:r=[],baseLine:a,layout:s,connectNulls:i=OF.connectNulls}=e,l=bJ(t,s),o=i?r.filter(ng):r;if(Array.isArray(a)){var d,u=r.map((b,v)=>UF(UF({},b),{},{base:a[v]}));s==="vertical"?d=mx().y(J0).x1(X0).x0(b=>b.base.x):d=mx().x(X0).y1(J0).y0(b=>b.base.y);var f=d.defined(RF).curve(l),p=i?u.filter(RF):u;return f(p)}var x;s==="vertical"&&ct(a)?x=mx().y(J0).x1(X0).x0(a):ct(a)?x=mx().x(X0).y1(J0).y0(a):x=PM().x(X0).y(J0);var m=x.defined(ng).curve(l);return m(o)},Em=e=>{var{className:t,points:r,path:a,pathRef:s}=e,i=QA();if((!r||!r.length)&&!a)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},o=r&&r.length?vJ(l):a;return j.createElement("path",IN({},Ki(e),hk(e),{className:Fr("recharts-curve",t),d:o===null?void 0:o,ref:s}))},yJ=["x","y","top","left","width","height","className"];function DN(){return DN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},DN.apply(null,arguments)}function PF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function wJ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PF(Object(r),!0).forEach(function(a){NJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function NJ(e,t,r){return(t=CJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CJ(e){var t=kJ(e,"string");return typeof t=="symbol"?t:t+""}function kJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jJ(e,t){if(e==null)return{};var r,a,s=EJ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function EJ(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var SJ=(e,t,r,a,s,i)=>"M".concat(e,",").concat(s,"v").concat(a,"M").concat(i,",").concat(t,"h").concat(r),BJ=e=>{var{x:t=0,y:r=0,top:a=0,left:s=0,width:i=0,height:l=0,className:o}=e,d=jJ(e,yJ),u=wJ({x:t,y:r,top:a,left:s,width:i,height:l},d);return!ct(t)||!ct(r)||!ct(i)||!ct(l)||!ct(a)||!ct(s)?null:j.createElement("path",DN({},bi(u),{className:Fr("recharts-cross",o),d:SJ(t,r,i,l,a,s)}))};function _J(e,t,r,a){var s=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?a:r.width-1,height:e==="horizontal"?r.height-1:a}}function LF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function QF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LF(Object(r),!0).forEach(function(a){TJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function TJ(e,t,r){return(t=FJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FJ(e){var t=IJ(e,"string");return typeof t=="symbol"?t:t+""}function IJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DJ=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),UJ=(e,t,r)=>e.map(a=>"".concat(DJ(a)," ").concat(t,"ms ").concat(r)).join(","),MJ=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,a)=>r.filter(s=>a.includes(s))),rp=(e,t)=>Object.keys(t).reduce((r,a)=>QF(QF({},r),{},{[a]:e(a,t[a])}),{});function HF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ma(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HF(Object(r),!0).forEach(function(a){RJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function RJ(e,t,r){return(t=OJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OJ(e){var t=PJ(e,"string");return typeof t=="symbol"?t:t+""}function PJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sg=(e,t,r)=>e+(t-e)*r,UN=e=>{var{from:t,to:r}=e;return t!==r},iO=(e,t,r)=>{var a=rp((s,i)=>{if(UN(i)){var[l,o]=e(i.from,i.to,i.velocity);return Ma(Ma({},i),{},{from:l,velocity:o})}return i},t);return r<1?rp((s,i)=>UN(i)&&a[s]!=null?Ma(Ma({},i),{},{velocity:sg(i.velocity,a[s].velocity,r),from:sg(i.from,a[s].from,r)}):i,t):iO(e,a,r-1)};function LJ(e,t,r,a,s,i){var l,o=a.reduce((x,m)=>Ma(Ma({},x),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),d=()=>rp((x,m)=>m.from,o),u=()=>!Object.values(o).filter(UN).length,f=null,p=x=>{l||(l=x);var m=x-l,b=m/r.dt;o=iO(r,o,b),s(Ma(Ma(Ma({},e),t),d())),l=x,u()||(f=i.setTimeout(p))};return()=>(f=i.setTimeout(p),()=>{var x;(x=f)===null||x===void 0||x()})}function QJ(e,t,r,a,s,i,l){var o=null,d=s.reduce((p,x)=>{var m=e[x],b=t[x];return m==null||b==null?p:Ma(Ma({},p),{},{[x]:[m,b]})},{}),u,f=p=>{u||(u=p);var x=(p-u)/a,m=rp((v,y)=>sg(...y,r(x)),d);if(i(Ma(Ma(Ma({},e),t),m)),x<1)o=l.setTimeout(f);else{var b=rp((v,y)=>sg(...y,r(1)),d);i(Ma(Ma(Ma({},e),t),b))}};return()=>(o=l.setTimeout(f),()=>{var p;(p=o)===null||p===void 0||p()})}const HJ=(e,t,r,a,s,i)=>{var l=MJ(e,t);return r==null?()=>(s(Ma(Ma({},e),t)),()=>{}):r.isStepper===!0?LJ(e,t,r,l,s,i):QJ(e,t,r,a,l,s,i)};var ig=1e-4,lO=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],oO=(e,t)=>e.map((r,a)=>r*t**a).reduce((r,a)=>r+a),zF=(e,t)=>r=>{var a=lO(e,t);return oO(a,r)},zJ=(e,t)=>r=>{var a=lO(e,t),s=[...a.map((i,l)=>i*l).slice(1),0];return oO(s,r)},$J=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var a=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(a==null||a.length!==4)return null;var s=a.map(i=>parseFloat(i));return[s[0],s[1],s[2],s[3]]},VJ=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];if(r.length===1)switch(r[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 s=$J(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},GJ=(e,t,r,a)=>{var s=zF(e,r),i=zF(t,a),l=zJ(e,r),o=u=>u>1?1:u<0?0:u,d=u=>{for(var f=u>1?1:u,p=f,x=0;x<8;++x){var m=s(p)-f,b=l(p);if(Math.abs(m-f)<ig||b<ig)return i(p);p=o(p-m/b)}return i(p)};return d.isStepper=!1,d},$F=function(){return GJ(...VJ(...arguments))},KJ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:a=8,dt:s=17}=t,i=(l,o,d)=>{var u=-(l-o)*r,f=d*a,p=d+(u-f)*s/1e3,x=d*s/1e3+l;return Math.abs(x-o)<ig&&Math.abs(p)<ig?[o,0]:[x,p]};return i.isStepper=!0,i.dt=s,i},qJ=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return $F(e);case"spring":return KJ();default:if(e.split("(")[0]==="cubic-bezier")return $F(e)}return typeof e=="function"?e:null};function WJ(e){var t,r=()=>null,a=!1,s=null,i=l=>{if(!a){if(Array.isArray(l)){if(!l.length)return;var o=l,[d,...u]=o;if(typeof d=="number"){s=e.setTimeout(i.bind(null,u),d);return}i(d),s=e.setTimeout(i.bind(null,u));return}typeof l=="string"&&(t=l,r(t)),typeof l=="object"&&(t=l,r(t)),typeof l=="function"&&l()}};return{stop:()=>{a=!0},start:l=>{a=!1,s&&(s(),s=null),i(l)},subscribe:l=>(r=l,()=>{r=()=>null}),getTimeoutController:()=>e}}class YJ{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=performance.now(),s=null,i=l=>{l-a>=r?t(l):typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(i))};return s=requestAnimationFrame(i),()=>{s!=null&&cancelAnimationFrame(s)}}}function XJ(){return WJ(new YJ)}var JJ=j.createContext(XJ);function ZJ(e,t){var r=j.useContext(JJ);return j.useMemo(()=>t??r(e),[e,t,r])}var eZ=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Op={isSsr:eZ()},tZ={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},VF={t:0},zw={t:1};function cO(e){var t=zs(e,tZ),{isActive:r,canBegin:a,duration:s,easing:i,begin:l,onAnimationEnd:o,onAnimationStart:d,children:u}=t,f=r==="auto"?!Op.isSsr:r,p=ZJ(t.animationId,t.animationManager),[x,m]=j.useState(f?VF:zw),b=j.useRef(null);return j.useEffect(()=>{f||m(zw)},[f]),j.useEffect(()=>{if(!f||!a)return LA;var v=HJ(VF,zw,qJ(i),s,m,p.getTimeoutController()),y=()=>{b.current=v()};return p.start([d,l,y,s,o]),()=>{p.stop(),b.current&&b.current(),o()}},[f,a,s,i,l,d,o,p]),u(x.t)}function dO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=j.useRef(Wf(t)),a=j.useRef(e);return a.current!==e&&(r.current=Wf(t),a.current=e),r.current}var rZ=["radius"],aZ=["radius"],GF,KF,qF,WF,YF,XF,JF,ZF,eI,tI;function rI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function aI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rI(Object(r),!0).forEach(function(a){nZ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function nZ(e,t,r){return(t=sZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sZ(e){var t=iZ(e,"string");return typeof t=="symbol"?t:t+""}function iZ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},lg.apply(null,arguments)}function nI(e,t){if(e==null)return{};var r,a,s=lZ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lZ(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function il(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var sI=(e,t,r,a,s)=>{var i=gc(r),l=gc(a),o=Math.min(Math.abs(i)/2,Math.abs(l)/2),d=l>=0?1:-1,u=i>=0?1:-1,f=l>=0&&i>=0||l<0&&i<0?1:0,p;if(o>0&&Array.isArray(s)){for(var x=[0,0,0,0],m=0,b=4;m<b;m++){var v,y=(v=s[m])!==null&&v!==void 0?v:0;x[m]=y>o?o:y}p=fn(GF||(GF=il(["M",",",""])),e,t+d*x[0]),x[0]>0&&(p+=fn(KF||(KF=il(["A ",",",",0,0,",",",",",""])),x[0],x[0],f,e+u*x[0],t)),p+=fn(qF||(qF=il(["L ",",",""])),e+r-u*x[1],t),x[1]>0&&(p+=fn(WF||(WF=il(["A ",",",",0,0,",`,
        `,",",""])),x[1],x[1],f,e+r,t+d*x[1])),p+=fn(YF||(YF=il(["L ",",",""])),e+r,t+a-d*x[2]),x[2]>0&&(p+=fn(XF||(XF=il(["A ",",",",0,0,",`,
        `,",",""])),x[2],x[2],f,e+r-u*x[2],t+a)),p+=fn(JF||(JF=il(["L ",",",""])),e+u*x[3],t+a),x[3]>0&&(p+=fn(ZF||(ZF=il(["A ",",",",0,0,",`,
        `,",",""])),x[3],x[3],f,e,t+a-d*x[3])),p+="Z"}else if(o>0&&s===+s&&s>0){var k=Math.min(o,s);p=fn(eI||(eI=il(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,f,e+u*k,t,e+r-u*k,t,k,k,f,e+r,t+d*k,e+r,t+a-d*k,k,k,f,e+r-u*k,t+a,e+u*k,t+a,k,k,f,e,t+a-d*k)}else p=fn(tI||(tI=il(["M ",","," h "," v "," h "," Z"])),e,t,r,a,-r);return p},iI={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},oZ=e=>{var t=zs(e,iI),r=j.useRef(null),[a,s]=j.useState(-1);j.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var z=r.current.getTotalLength();z&&s(z)}catch{}},[]);var{x:i,y:l,width:o,height:d,radius:u,className:f}=t,{animationEasing:p,animationDuration:x,animationBegin:m,isAnimationActive:b,isUpdateAnimationActive:v}=t,y=j.useRef(o),k=j.useRef(d),_=j.useRef(i),C=j.useRef(l),E=j.useMemo(()=>({x:i,y:l,width:o,height:d,radius:u}),[i,l,o,d,u]),T=dO(E,"rectangle-");if(i!==+i||l!==+l||o!==+o||d!==+d||o===0||d===0)return null;var B=Fr("recharts-rectangle",f);if(!v){var I=bi(t),{radius:M}=I,U=nI(I,rZ);return j.createElement("path",lg({},U,{x:gc(i),y:gc(l),width:gc(o),height:gc(d),radius:typeof u=="number"?u:void 0,className:B,d:sI(i,l,o,d,u)}))}var D=y.current,L=k.current,R=_.current,Q=C.current,G="0px ".concat(a===-1?1:a,"px"),K="".concat(a,"px 0px"),W=UJ(["strokeDasharray"],x,typeof p=="string"?p:iI.animationEasing);return j.createElement(cO,{animationId:T,key:T,canBegin:a>0,duration:x,easing:p,isActive:v,begin:m},z=>{var Z=pl(D,o,z),Y=pl(L,d,z),te=pl(R,i,z),O=pl(Q,l,z);r.current&&(y.current=Z,k.current=Y,_.current=te,C.current=O);var P;b?z>0?P={transition:W,strokeDasharray:K}:P={strokeDasharray:G}:P={strokeDasharray:K};var q=bi(t),{radius:H}=q,J=nI(q,aZ);return j.createElement("path",lg({},J,{radius:typeof u=="number"?u:void 0,className:B,d:sI(te,O,Z,Y,u),ref:r,style:aI(aI({},P),t.style)}))})};function lI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function oI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lI(Object(r),!0).forEach(function(a){cZ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function cZ(e,t,r){return(t=dZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dZ(e){var t=uZ(e,"string");return typeof t=="symbol"?t:t+""}function uZ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var og=Math.PI/180,AZ=e=>e*180/Math.PI,gn=(e,t,r,a)=>({x:e+Math.cos(-og*a)*r,y:t+Math.sin(-og*a)*r}),fZ=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(r-(a.top||0)-(a.bottom||0)))/2},pZ=(e,t)=>{var{x:r,y:a}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(a-i)**2)},hZ=(e,t)=>{var{x:r,y:a}=e,{cx:s,cy:i}=t,l=pZ({x:r,y:a},{x:s,y:i});if(l<=0)return{radius:l,angle:0};var o=(r-s)/l,d=Math.acos(o);return a>i&&(d=2*Math.PI-d),{radius:l,angle:AZ(d),angleInRadian:d}},xZ=e=>{var{startAngle:t,endAngle:r}=e,a=Math.floor(t/360),s=Math.floor(r/360),i=Math.min(a,s);return{startAngle:t-i*360,endAngle:r-i*360}},mZ=(e,t)=>{var{startAngle:r,endAngle:a}=t,s=Math.floor(r/360),i=Math.floor(a/360),l=Math.min(s,i);return e+l*360},gZ=(e,t)=>{var{chartX:r,chartY:a}=e,{radius:s,angle:i}=hZ({x:r,y:a},t),{innerRadius:l,outerRadius:o}=t;if(s<l||s>o||s===0)return null;var{startAngle:d,endAngle:u}=xZ(t),f=i,p;if(d<=u){for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}else{for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}return p?oI(oI({},t),{},{radius:s,angle:mZ(f,t)}):null};function uO(e){var{cx:t,cy:r,radius:a,startAngle:s,endAngle:i}=e,l=gn(t,r,a,s),o=gn(t,r,a,i);return{points:[l,o],cx:t,cy:r,radius:a,startAngle:s,endAngle:i}}var cI,dI,uI,AI,fI,pI,hI;function MN(){return MN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},MN.apply(null,arguments)}function vd(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bZ=(e,t)=>{var r=Ai(t-e),a=Math.min(Math.abs(t-e),359.999);return r*a},jx=e=>{var{cx:t,cy:r,radius:a,angle:s,sign:i,isExternal:l,cornerRadius:o,cornerIsExternal:d}=e,u=o*(l?1:-1)+a,f=Math.asin(o/u)/og,p=d?s:s+i*f,x=gn(t,r,u,p),m=gn(t,r,a,p),b=d?s-i*f:s,v=gn(t,r,u*Math.cos(f*og),b);return{center:x,circleTangency:m,lineTangency:v,theta:f}},AO=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:i,endAngle:l}=e,o=bZ(i,l),d=i+o,u=gn(t,r,s,i),f=gn(t,r,s,d),p=fn(cI||(cI=vd(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),u.x,u.y,s,s,+(Math.abs(o)>180),+(i>d),f.x,f.y);if(a>0){var x=gn(t,r,a,i),m=gn(t,r,a,d);p+=fn(dI||(dI=vd(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),m.x,m.y,a,a,+(Math.abs(o)>180),+(i<=d),x.x,x.y)}else p+=fn(uI||(uI=vd(["L ",","," Z"])),t,r);return p},vZ=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,cornerRadius:i,forceCornerRadius:l,cornerIsExternal:o,startAngle:d,endAngle:u}=e,f=Ai(u-d),{circleTangency:p,lineTangency:x,theta:m}=jx({cx:t,cy:r,radius:s,angle:d,sign:f,cornerRadius:i,cornerIsExternal:o}),{circleTangency:b,lineTangency:v,theta:y}=jx({cx:t,cy:r,radius:s,angle:u,sign:-f,cornerRadius:i,cornerIsExternal:o}),k=o?Math.abs(d-u):Math.abs(d-u)-m-y;if(k<0)return l?fn(AI||(AI=vd(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),x.x,x.y,i,i,i*2,i,i,-i*2):AO({cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:d,endAngle:u});var _=fn(fI||(fI=vd(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),x.x,x.y,i,i,+(f<0),p.x,p.y,s,s,+(k>180),+(f<0),b.x,b.y,i,i,+(f<0),v.x,v.y);if(a>0){var{circleTangency:C,lineTangency:E,theta:T}=jx({cx:t,cy:r,radius:a,angle:d,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:o}),{circleTangency:B,lineTangency:I,theta:M}=jx({cx:t,cy:r,radius:a,angle:u,sign:-f,isExternal:!0,cornerRadius:i,cornerIsExternal:o}),U=o?Math.abs(d-u):Math.abs(d-u)-T-M;if(U<0&&i===0)return"".concat(_,"L").concat(t,",").concat(r,"Z");_+=fn(pI||(pI=vd(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),I.x,I.y,i,i,+(f<0),B.x,B.y,a,a,+(U>180),+(f>0),C.x,C.y,i,i,+(f<0),E.x,E.y)}else _+=fn(hI||(hI=vd(["L",",","Z"])),t,r);return _},yZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},wZ=e=>{var t=zs(e,yZ),{cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:l,forceCornerRadius:o,cornerIsExternal:d,startAngle:u,endAngle:f,className:p}=t;if(i<s||u===f)return null;var x=Fr("recharts-sector",p),m=i-s,b=Fc(l,m,0,!0),v;return b>0&&Math.abs(u-f)<360?v=vZ({cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:Math.min(b,m/2),forceCornerRadius:o,cornerIsExternal:d,startAngle:u,endAngle:f}):v=AO({cx:r,cy:a,innerRadius:s,outerRadius:i,startAngle:u,endAngle:f}),j.createElement("path",MN({},bi(t),{className:x,d:v}))};function NZ(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(XM(t)){if(e==="centric"){var{cx:a,cy:s,innerRadius:i,outerRadius:l,angle:o}=t,d=gn(a,s,i,o),u=gn(a,s,l,o);return[{x:d.x,y:d.y},{x:u.x,y:u.y}]}return uO(t)}}var $w={},Vw={},Gw={},xI;function CZ(){return xI||(xI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lR();function r(a){return t.isSymbol(a)?NaN:Number(a)}e.toNumber=r})(Gw)),Gw}var mI;function kZ(){return mI||(mI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CZ();function r(a){return a?(a=t.toNumber(a),a===1/0||a===-1/0?(a<0?-1:1)*Number.MAX_VALUE:a===a?a:0):a===0?a:0}e.toFinite=r})(Vw)),Vw}var gI;function jZ(){return gI||(gI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oR(),r=kZ();function a(s,i,l){l&&typeof l!="number"&&t.isIterateeCall(s,i,l)&&(i=l=void 0),s=r.toFinite(s),i===void 0?(i=s,s=0):i=r.toFinite(i),l=l===void 0?s<i?1:-1:r.toFinite(l);const o=Math.max(Math.ceil((i-s)/(l||1)),0),d=new Array(o);for(let u=0;u<o;u++)d[u]=s,s+=l;return d}e.range=a})($w)),$w}var Kw,bI;function EZ(){return bI||(bI=1,Kw=jZ().range),Kw}var SZ=EZ();const fO=El(SZ);function kc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function BZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Tk(e){let t,r,a;e.length!==2?(t=kc,r=(o,d)=>kc(e(o),d),a=(o,d)=>e(o)-d):(t=e===kc||e===BZ?e:_Z,r=e,a=e);function s(o,d,u=0,f=o.length){if(u<f){if(t(d,d)!==0)return f;do{const p=u+f>>>1;r(o[p],d)<0?u=p+1:f=p}while(u<f)}return u}function i(o,d,u=0,f=o.length){if(u<f){if(t(d,d)!==0)return f;do{const p=u+f>>>1;r(o[p],d)<=0?u=p+1:f=p}while(u<f)}return u}function l(o,d,u=0,f=o.length){const p=s(o,d,u,f-1);return p>u&&a(o[p-1],d)>-a(o[p],d)?p-1:p}return{left:s,center:l,right:i}}function _Z(){return 0}function pO(e){return e===null?NaN:+e}function*TZ(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const FZ=Tk(kc),Pp=FZ.right;Tk(pO).center;class vI extends Map{constructor(t,r=UZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[a,s]of t)this.set(a,s)}get(t){return super.get(yI(this,t))}has(t){return super.has(yI(this,t))}set(t,r){return super.set(IZ(this,t),r)}delete(t){return super.delete(DZ(this,t))}}function yI({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):r}function IZ({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):(e.set(a,r),r)}function DZ({_intern:e,_key:t},r){const a=t(r);return e.has(a)&&(r=e.get(a),e.delete(a)),r}function UZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function MZ(e=kc){if(e===kc)return hO;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const a=e(t,r);return a||a===0?a:(e(r,r)===0)-(e(t,t)===0)}}function hO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const RZ=Math.sqrt(50),OZ=Math.sqrt(10),PZ=Math.sqrt(2);function cg(e,t,r){const a=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(a)),i=a/Math.pow(10,s),l=i>=RZ?10:i>=OZ?5:i>=PZ?2:1;let o,d,u;return s<0?(u=Math.pow(10,-s)/l,o=Math.round(e*u),d=Math.round(t*u),o/u<e&&++o,d/u>t&&--d,u=-u):(u=Math.pow(10,s)*l,o=Math.round(e/u),d=Math.round(t/u),o*u<e&&++o,d*u>t&&--d),d<o&&.5<=r&&r<2?cg(e,t,r*2):[o,d,u]}function RN(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const a=t<e,[s,i,l]=a?cg(t,e,r):cg(e,t,r);if(!(i>=s))return[];const o=i-s+1,d=new Array(o);if(a)if(l<0)for(let u=0;u<o;++u)d[u]=(i-u)/-l;else for(let u=0;u<o;++u)d[u]=(i-u)*l;else if(l<0)for(let u=0;u<o;++u)d[u]=(s+u)/-l;else for(let u=0;u<o;++u)d[u]=(s+u)*l;return d}function ON(e,t,r){return t=+t,e=+e,r=+r,cg(e,t,r)[2]}function PN(e,t,r){t=+t,e=+e,r=+r;const a=t<e,s=a?ON(t,e,r):ON(e,t,r);return(a?-1:1)*(s<0?1/-s:s)}function wI(e,t){let r;for(const a of e)a!=null&&(r<a||r===void 0&&a>=a)&&(r=a);return r}function NI(e,t){let r;for(const a of e)a!=null&&(r>a||r===void 0&&a>=a)&&(r=a);return r}function xO(e,t,r=0,a=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),a=Math.floor(Math.min(e.length-1,a)),!(r<=t&&t<=a))return e;for(s=s===void 0?hO:MZ(s);a>r;){if(a-r>600){const d=a-r+1,u=t-r+1,f=Math.log(d),p=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*p*(d-p)/d)*(u-d/2<0?-1:1),m=Math.max(r,Math.floor(t-u*p/d+x)),b=Math.min(a,Math.floor(t+(d-u)*p/d+x));xO(e,t,m,b,s)}const i=e[t];let l=r,o=a;for(Z0(e,r,t),s(e[a],i)>0&&Z0(e,r,a);l<o;){for(Z0(e,l,o),++l,--o;s(e[l],i)<0;)++l;for(;s(e[o],i)>0;)--o}s(e[r],i)===0?Z0(e,r,o):(++o,Z0(e,o,a)),o<=t&&(r=o+1),t<=o&&(a=o-1)}return e}function Z0(e,t,r){const a=e[t];e[t]=e[r],e[r]=a}function LZ(e,t,r){if(e=Float64Array.from(TZ(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return NI(e);if(t>=1)return wI(e);var a,s=(a-1)*t,i=Math.floor(s),l=wI(xO(e,i).subarray(0,i+1)),o=NI(e.subarray(i+1));return l+(o-l)*(s-i)}}function QZ(e,t,r=pO){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+r(e[0],0,e);if(t>=1)return+r(e[a-1],a-1,e);var a,s=(a-1)*t,i=Math.floor(s),l=+r(e[i],i,e),o=+r(e[i+1],i+1,e);return l+(o-l)*(s-i)}}function HZ(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var a=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++a<s;)i[a]=e+a*r;return i}function Ci(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function So(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}const LN=Symbol("implicit");function Fk(){var e=new vI,t=[],r=[],a=LN;function s(i){let l=e.get(i);if(l===void 0){if(a!==LN)return a;e.set(i,l=t.push(i)-1)}return r[l%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new vI;for(const l of i)e.has(l)||e.set(l,t.push(l)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return Fk(t,r).unknown(a)},Ci.apply(s,arguments),s}function Ik(){var e=Fk().unknown(void 0),t=e.domain,r=e.range,a=0,s=1,i,l,o=!1,d=0,u=0,f=.5;delete e.unknown;function p(){var x=t().length,m=s<a,b=m?s:a,v=m?a:s;i=(v-b)/Math.max(1,x-d+u*2),o&&(i=Math.floor(i)),b+=(v-b-i*(x-d))*f,l=i*(1-d),o&&(b=Math.round(b),l=Math.round(l));var y=HZ(x).map(function(k){return b+i*k});return r(m?y.reverse():y)}return e.domain=function(x){return arguments.length?(t(x),p()):t()},e.range=function(x){return arguments.length?([a,s]=x,a=+a,s=+s,p()):[a,s]},e.rangeRound=function(x){return[a,s]=x,a=+a,s=+s,o=!0,p()},e.bandwidth=function(){return l},e.step=function(){return i},e.round=function(x){return arguments.length?(o=!!x,p()):o},e.padding=function(x){return arguments.length?(d=Math.min(1,u=+x),p()):d},e.paddingInner=function(x){return arguments.length?(d=Math.min(1,x),p()):d},e.paddingOuter=function(x){return arguments.length?(u=+x,p()):u},e.align=function(x){return arguments.length?(f=Math.max(0,Math.min(1,x)),p()):f},e.copy=function(){return Ik(t(),[a,s]).round(o).paddingInner(d).paddingOuter(u).align(f)},Ci.apply(p(),arguments)}function mO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return mO(t())},e}function zZ(){return mO(Ik.apply(null,arguments).paddingInner(1))}function Dk(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function gO(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function Lp(){}var ap=.7,dg=1/ap,mA="\\s*([+-]?\\d+)\\s*",np="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$Z=/^#([0-9a-f]{3,8})$/,VZ=new RegExp(`^rgb\\(${mA},${mA},${mA}\\)$`),GZ=new RegExp(`^rgb\\(${bl},${bl},${bl}\\)$`),KZ=new RegExp(`^rgba\\(${mA},${mA},${mA},${np}\\)$`),qZ=new RegExp(`^rgba\\(${bl},${bl},${bl},${np}\\)$`),WZ=new RegExp(`^hsl\\(${np},${bl},${bl}\\)$`),YZ=new RegExp(`^hsla\\(${np},${bl},${bl},${np}\\)$`),CI={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};Dk(Lp,sp,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kI,formatHex:kI,formatHex8:XZ,formatHsl:JZ,formatRgb:jI,toString:jI});function kI(){return this.rgb().formatHex()}function XZ(){return this.rgb().formatHex8()}function JZ(){return bO(this).formatHsl()}function jI(){return this.rgb().formatRgb()}function sp(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=$Z.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?EI(t):r===3?new us(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ex(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ex(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=VZ.exec(e))?new us(t[1],t[2],t[3],1):(t=GZ.exec(e))?new us(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KZ.exec(e))?Ex(t[1],t[2],t[3],t[4]):(t=qZ.exec(e))?Ex(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=WZ.exec(e))?_I(t[1],t[2]/100,t[3]/100,1):(t=YZ.exec(e))?_I(t[1],t[2]/100,t[3]/100,t[4]):CI.hasOwnProperty(e)?EI(CI[e]):e==="transparent"?new us(NaN,NaN,NaN,0):null}function EI(e){return new us(e>>16&255,e>>8&255,e&255,1)}function Ex(e,t,r,a){return a<=0&&(e=t=r=NaN),new us(e,t,r,a)}function ZZ(e){return e instanceof Lp||(e=sp(e)),e?(e=e.rgb(),new us(e.r,e.g,e.b,e.opacity)):new us}function QN(e,t,r,a){return arguments.length===1?ZZ(e):new us(e,t,r,a??1)}function us(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}Dk(us,QN,gO(Lp,{brighter(e){return e=e==null?dg:Math.pow(dg,e),new us(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ap:Math.pow(ap,e),new us(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new us(Ed(this.r),Ed(this.g),Ed(this.b),ug(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:SI,formatHex:SI,formatHex8:eee,formatRgb:BI,toString:BI}));function SI(){return`#${yd(this.r)}${yd(this.g)}${yd(this.b)}`}function eee(){return`#${yd(this.r)}${yd(this.g)}${yd(this.b)}${yd((isNaN(this.opacity)?1:this.opacity)*255)}`}function BI(){const e=ug(this.opacity);return`${e===1?"rgb(":"rgba("}${Ed(this.r)}, ${Ed(this.g)}, ${Ed(this.b)}${e===1?")":`, ${e})`}`}function ug(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ed(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yd(e){return e=Ed(e),(e<16?"0":"")+e.toString(16)}function _I(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ui(e,t,r,a)}function bO(e){if(e instanceof Ui)return new Ui(e.h,e.s,e.l,e.opacity);if(e instanceof Lp||(e=sp(e)),!e)return new Ui;if(e instanceof Ui)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,s=Math.min(t,r,a),i=Math.max(t,r,a),l=NaN,o=i-s,d=(i+s)/2;return o?(t===i?l=(r-a)/o+(r<a)*6:r===i?l=(a-t)/o+2:l=(t-r)/o+4,o/=d<.5?i+s:2-i-s,l*=60):o=d>0&&d<1?0:l,new Ui(l,o,d,e.opacity)}function tee(e,t,r,a){return arguments.length===1?bO(e):new Ui(e,t,r,a??1)}function Ui(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}Dk(Ui,tee,gO(Lp,{brighter(e){return e=e==null?dg:Math.pow(dg,e),new Ui(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ap:Math.pow(ap,e),new Ui(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,r=this.l,a=r+(r<.5?r:1-r)*t,s=2*r-a;return new us(qw(e>=240?e-240:e+120,s,a),qw(e,s,a),qw(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new Ui(TI(this.h),Sx(this.s),Sx(this.l),ug(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(){const e=ug(this.opacity);return`${e===1?"hsl(":"hsla("}${TI(this.h)}, ${Sx(this.s)*100}%, ${Sx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function TI(e){return e=(e||0)%360,e<0?e+360:e}function Sx(e){return Math.max(0,Math.min(1,e||0))}function qw(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Uk=e=>()=>e;function ree(e,t){return function(r){return e+r*t}}function aee(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function nee(e){return(e=+e)==1?vO:function(t,r){return r-t?aee(t,r,e):Uk(isNaN(t)?r:t)}}function vO(e,t){var r=t-e;return r?ree(e,r):Uk(isNaN(e)?t:e)}const FI=(function e(t){var r=nee(t);function a(s,i){var l=r((s=QN(s)).r,(i=QN(i)).r),o=r(s.g,i.g),d=r(s.b,i.b),u=vO(s.opacity,i.opacity);return function(f){return s.r=l(f),s.g=o(f),s.b=d(f),s.opacity=u(f),s+""}}return a.gamma=e,a})(1);function see(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,a=t.slice(),s;return function(i){for(s=0;s<r;++s)a[s]=e[s]*(1-i)+t[s]*i;return a}}function iee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lee(e,t){var r=t?t.length:0,a=e?Math.min(r,e.length):0,s=new Array(a),i=new Array(r),l;for(l=0;l<a;++l)s[l]=HA(e[l],t[l]);for(;l<r;++l)i[l]=t[l];return function(o){for(l=0;l<a;++l)i[l]=s[l](o);return i}}function oee(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function Ag(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function cee(e,t){var r={},a={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=HA(e[s],t[s]):a[s]=t[s];return function(i){for(s in r)a[s]=r[s](i);return a}}var HN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ww=new RegExp(HN.source,"g");function dee(e){return function(){return e}}function uee(e){return function(t){return e(t)+""}}function Aee(e,t){var r=HN.lastIndex=Ww.lastIndex=0,a,s,i,l=-1,o=[],d=[];for(e=e+"",t=t+"";(a=HN.exec(e))&&(s=Ww.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),o[l]?o[l]+=i:o[++l]=i),(a=a[0])===(s=s[0])?o[l]?o[l]+=s:o[++l]=s:(o[++l]=null,d.push({i:l,x:Ag(a,s)})),r=Ww.lastIndex;return r<t.length&&(i=t.slice(r),o[l]?o[l]+=i:o[++l]=i),o.length<2?d[0]?uee(d[0].x):dee(t):(t=d.length,function(u){for(var f=0,p;f<t;++f)o[(p=d[f]).i]=p.x(u);return o.join("")})}function HA(e,t){var r=typeof t,a;return t==null||r==="boolean"?Uk(t):(r==="number"?Ag:r==="string"?(a=sp(t))?(t=a,FI):Aee:t instanceof sp?FI:t instanceof Date?oee:iee(t)?see:Array.isArray(t)?lee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?cee:Ag)(e,t)}function Mk(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function fee(e,t){t===void 0&&(t=e,e=HA);for(var r=0,a=t.length-1,s=t[0],i=new Array(a<0?0:a);r<a;)i[r]=e(s,s=t[++r]);return function(l){var o=Math.max(0,Math.min(a-1,Math.floor(l*=a)));return i[o](l-o)}}function pee(e){return function(){return e}}function fg(e){return+e}var II=[0,1];function Vn(e){return e}function zN(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:pee(isNaN(t)?NaN:.5)}function hee(e,t){var r;return e>t&&(r=e,e=t,t=r),function(a){return Math.max(e,Math.min(t,a))}}function xee(e,t,r){var a=e[0],s=e[1],i=t[0],l=t[1];return s<a?(a=zN(s,a),i=r(l,i)):(a=zN(a,s),i=r(i,l)),function(o){return i(a(o))}}function mee(e,t,r){var a=Math.min(e.length,t.length)-1,s=new Array(a),i=new Array(a),l=-1;for(e[a]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<a;)s[l]=zN(e[l],e[l+1]),i[l]=r(t[l],t[l+1]);return function(o){var d=Pp(e,o,1,a)-1;return i[d](s[d](o))}}function Qp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Db(){var e=II,t=II,r=HA,a,s,i,l=Vn,o,d,u;function f(){var x=Math.min(e.length,t.length);return l!==Vn&&(l=hee(e[0],e[x-1])),o=x>2?mee:xee,d=u=null,p}function p(x){return x==null||isNaN(x=+x)?i:(d||(d=o(e.map(a),t,r)))(a(l(x)))}return p.invert=function(x){return l(s((u||(u=o(t,e.map(a),Ag)))(x)))},p.domain=function(x){return arguments.length?(e=Array.from(x,fg),f()):e.slice()},p.range=function(x){return arguments.length?(t=Array.from(x),f()):t.slice()},p.rangeRound=function(x){return t=Array.from(x),r=Mk,f()},p.clamp=function(x){return arguments.length?(l=x?!0:Vn,f()):l!==Vn},p.interpolate=function(x){return arguments.length?(r=x,f()):r},p.unknown=function(x){return arguments.length?(i=x,p):i},function(x,m){return a=x,s=m,f()}}function Rk(){return Db()(Vn,Vn)}function gee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function pg(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,r);return[a.length>1?a[0]+a.slice(2):a,+e.slice(r+1)]}function BA(e){return e=pg(Math.abs(e)),e?e[1]:NaN}function bee(e,t){return function(r,a){for(var s=r.length,i=[],l=0,o=e[0],d=0;s>0&&o>0&&(d+o+1>a&&(o=Math.max(1,a-d)),i.push(r.substring(s-=o,s+o)),!((d+=o+1)>a));)o=e[l=(l+1)%e.length];return i.reverse().join(t)}}function vee(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var yee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ip(e){if(!(t=yee.exec(e)))throw new Error("invalid format: "+e);var t;return new Ok({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]})}ip.prototype=Ok.prototype;function Ok(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+""}Ok.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 wee(e){e:for(var t=e.length,r=1,a=-1,s;r<t;++r)switch(e[r]){case".":a=s=r;break;case"0":a===0&&(a=r),s=r;break;default:if(!+e[r])break e;a>0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(s+1):e}var hg;function Nee(e,t){var r=pg(e,t);if(!r)return hg=void 0,e.toPrecision(t);var a=r[0],s=r[1],i=s-(hg=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,l=a.length;return i===l?a:i>l?a+new Array(i-l+1).join("0"):i>0?a.slice(0,i)+"."+a.slice(i):"0."+new Array(1-i).join("0")+pg(e,Math.max(0,t+i-1))[0]}function DI(e,t){var r=pg(e,t);if(!r)return e+"";var a=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+a:a.length>s+1?a.slice(0,s+1)+"."+a.slice(s+1):a+new Array(s-a.length+2).join("0")}const UI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:gee,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>DI(e*100,t),r:DI,s:Nee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function MI(e){return e}var RI=Array.prototype.map,OI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Cee(e){var t=e.grouping===void 0||e.thousands===void 0?MI:bee(RI.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?MI:vee(RI.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function u(p,x){p=ip(p);var m=p.fill,b=p.align,v=p.sign,y=p.symbol,k=p.zero,_=p.width,C=p.comma,E=p.precision,T=p.trim,B=p.type;B==="n"?(C=!0,B="g"):UI[B]||(E===void 0&&(E=12),T=!0,B="g"),(k||m==="0"&&b==="=")&&(k=!0,m="0",b="=");var I=(x&&x.prefix!==void 0?x.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(B)?"0"+B.toLowerCase():""),M=(y==="$"?a:/[%p]/.test(B)?l:"")+(x&&x.suffix!==void 0?x.suffix:""),U=UI[B],D=/[defgprs%]/.test(B);E=E===void 0?6:/[gprs]/.test(B)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function L(R){var Q=I,G=M,K,W,z;if(B==="c")G=U(R)+G,R="";else{R=+R;var Z=R<0||1/R<0;if(R=isNaN(R)?d:U(Math.abs(R),E),T&&(R=wee(R)),Z&&+R==0&&v!=="+"&&(Z=!1),Q=(Z?v==="("?v:o:v==="-"||v==="("?"":v)+Q,G=(B==="s"&&!isNaN(R)&&hg!==void 0?OI[8+hg/3]:"")+G+(Z&&v==="("?")":""),D){for(K=-1,W=R.length;++K<W;)if(z=R.charCodeAt(K),48>z||z>57){G=(z===46?s+R.slice(K+1):R.slice(K))+G,R=R.slice(0,K);break}}}C&&!k&&(R=t(R,1/0));var Y=Q.length+R.length+G.length,te=Y<_?new Array(_-Y+1).join(m):"";switch(C&&k&&(R=t(te+R,te.length?_-G.length:1/0),te=""),b){case"<":R=Q+R+G+te;break;case"=":R=Q+te+R+G;break;case"^":R=te.slice(0,Y=te.length>>1)+Q+R+G+te.slice(Y);break;default:R=te+Q+R+G;break}return i(R)}return L.toString=function(){return p+""},L}function f(p,x){var m=Math.max(-8,Math.min(8,Math.floor(BA(x)/3)))*3,b=Math.pow(10,-m),v=u((p=ip(p),p.type="f",p),{suffix:OI[8+m/3]});return function(y){return v(b*y)}}return{format:u,formatPrefix:f}}var Bx,Pk,yO;kee({thousands:",",grouping:[3],currency:["$",""]});function kee(e){return Bx=Cee(e),Pk=Bx.format,yO=Bx.formatPrefix,Bx}function jee(e){return Math.max(0,-BA(Math.abs(e)))}function Eee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(BA(t)/3)))*3-BA(Math.abs(e)))}function See(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,BA(t)-BA(e))+1}function wO(e,t,r,a){var s=PN(e,t,r),i;switch(a=ip(a??",f"),a.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(i=Eee(s,l))&&(a.precision=i),yO(a,l)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(i=See(s,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=i-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(i=jee(s))&&(a.precision=i-(a.type==="%")*2);break}}return Pk(a)}function Qc(e){var t=e.domain;return e.ticks=function(r){var a=t();return RN(a[0],a[a.length-1],r??10)},e.tickFormat=function(r,a){var s=t();return wO(s[0],s[s.length-1],r??10,a)},e.nice=function(r){r==null&&(r=10);var a=t(),s=0,i=a.length-1,l=a[s],o=a[i],d,u,f=10;for(o<l&&(u=l,l=o,o=u,u=s,s=i,i=u);f-- >0;){if(u=ON(l,o,r),u===d)return a[s]=l,a[i]=o,t(a);if(u>0)l=Math.floor(l/u)*u,o=Math.ceil(o/u)*u;else if(u<0)l=Math.ceil(l*u)/u,o=Math.floor(o*u)/u;else break;d=u}return e},e}function NO(){var e=Rk();return e.copy=function(){return Qp(e,NO())},Ci.apply(e,arguments),Qc(e)}function CO(e){var t;function r(a){return a==null||isNaN(a=+a)?t:a}return r.invert=r,r.domain=r.range=function(a){return arguments.length?(e=Array.from(a,fg),r):e.slice()},r.unknown=function(a){return arguments.length?(t=a,r):t},r.copy=function(){return CO(e).unknown(t)},e=arguments.length?Array.from(e,fg):[0,1],Qc(r)}function kO(e,t){e=e.slice();var r=0,a=e.length-1,s=e[r],i=e[a],l;return i<s&&(l=r,r=a,a=l,l=s,s=i,i=l),e[r]=t.floor(s),e[a]=t.ceil(i),e}function PI(e){return Math.log(e)}function LI(e){return Math.exp(e)}function Bee(e){return-Math.log(-e)}function _ee(e){return-Math.exp(-e)}function Tee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Fee(e){return e===10?Tee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Iee(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 QI(e){return(t,r)=>-e(-t,r)}function Lk(e){const t=e(PI,LI),r=t.domain;let a=10,s,i;function l(){return s=Iee(a),i=Fee(a),r()[0]<0?(s=QI(s),i=QI(i),e(Bee,_ee)):e(PI,LI),t}return t.base=function(o){return arguments.length?(a=+o,l()):a},t.domain=function(o){return arguments.length?(r(o),l()):r()},t.ticks=o=>{const d=r();let u=d[0],f=d[d.length-1];const p=f<u;p&&([u,f]=[f,u]);let x=s(u),m=s(f),b,v;const y=o==null?10:+o;let k=[];if(!(a%1)&&m-x<y){if(x=Math.floor(x),m=Math.ceil(m),u>0){for(;x<=m;++x)for(b=1;b<a;++b)if(v=x<0?b/i(-x):b*i(x),!(v<u)){if(v>f)break;k.push(v)}}else for(;x<=m;++x)for(b=a-1;b>=1;--b)if(v=x>0?b/i(-x):b*i(x),!(v<u)){if(v>f)break;k.push(v)}k.length*2<y&&(k=RN(u,f,y))}else k=RN(x,m,Math.min(m-x,y)).map(i);return p?k.reverse():k},t.tickFormat=(o,d)=>{if(o==null&&(o=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=ip(d)).precision==null&&(d.trim=!0),d=Pk(d)),o===1/0)return d;const u=Math.max(1,a*o/t.ticks().length);return f=>{let p=f/i(Math.round(s(f)));return p*a<a-.5&&(p*=a),p<=u?d(f):""}},t.nice=()=>r(kO(r(),{floor:o=>i(Math.floor(s(o))),ceil:o=>i(Math.ceil(s(o)))})),t}function jO(){const e=Lk(Db()).domain([1,10]);return e.copy=()=>Qp(e,jO()).base(e.base()),Ci.apply(e,arguments),e}function HI(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zI(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Qk(e){var t=1,r=e(HI(t),zI(t));return r.constant=function(a){return arguments.length?e(HI(t=+a),zI(t)):t},Qc(r)}function EO(){var e=Qk(Db());return e.copy=function(){return Qp(e,EO()).constant(e.constant())},Ci.apply(e,arguments)}function $I(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Dee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Uee(e){return e<0?-e*e:e*e}function Hk(e){var t=e(Vn,Vn),r=1;function a(){return r===1?e(Vn,Vn):r===.5?e(Dee,Uee):e($I(r),$I(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,a()):r},Qc(t)}function zk(){var e=Hk(Db());return e.copy=function(){return Qp(e,zk()).exponent(e.exponent())},Ci.apply(e,arguments),e}function Mee(){return zk.apply(null,arguments).exponent(.5)}function VI(e){return Math.sign(e)*e*e}function Ree(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function SO(){var e=Rk(),t=[0,1],r=!1,a;function s(i){var l=Ree(e(i));return isNaN(l)?a:r?Math.round(l):l}return s.invert=function(i){return e.invert(VI(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,fg)).map(VI)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return SO(e.domain(),t).round(r).clamp(e.clamp()).unknown(a)},Ci.apply(s,arguments),Qc(s)}function BO(){var e=[],t=[],r=[],a;function s(){var l=0,o=Math.max(1,t.length);for(r=new Array(o-1);++l<o;)r[l-1]=QZ(e,l/o);return i}function i(l){return l==null||isNaN(l=+l)?a:t[Pp(r,l)]}return i.invertExtent=function(l){var o=t.indexOf(l);return o<0?[NaN,NaN]:[o>0?r[o-1]:e[0],o<r.length?r[o]:e[e.length-1]]},i.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let o of l)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(kc),s()},i.range=function(l){return arguments.length?(t=Array.from(l),s()):t.slice()},i.unknown=function(l){return arguments.length?(a=l,i):a},i.quantiles=function(){return r.slice()},i.copy=function(){return BO().domain(e).range(t).unknown(a)},Ci.apply(i,arguments)}function _O(){var e=0,t=1,r=1,a=[.5],s=[0,1],i;function l(d){return d!=null&&d<=d?s[Pp(a,d,0,r)]:i}function o(){var d=-1;for(a=new Array(r);++d<r;)a[d]=((d+1)*t-(d-r)*e)/(r+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,o()):[e,t]},l.range=function(d){return arguments.length?(r=(s=Array.from(d)).length-1,o()):s.slice()},l.invertExtent=function(d){var u=s.indexOf(d);return u<0?[NaN,NaN]:u<1?[e,a[0]]:u>=r?[a[r-1],t]:[a[u-1],a[u]]},l.unknown=function(d){return arguments.length&&(i=d),l},l.thresholds=function(){return a.slice()},l.copy=function(){return _O().domain([e,t]).range(s).unknown(i)},Ci.apply(Qc(l),arguments)}function TO(){var e=[.5],t=[0,1],r,a=1;function s(i){return i!=null&&i<=i?t[Pp(e,i,0,a)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),a=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),a=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var l=t.indexOf(i);return[e[l-1],e[l]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return TO().domain(e).range(t).unknown(r)},Ci.apply(s,arguments)}const Yw=new Date,Xw=new Date;function Ha(e,t,r,a){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const l=s(i),o=s.ceil(i);return i-l<o-i?l:o},s.offset=(i,l)=>(t(i=new Date(+i),l==null?1:Math.floor(l)),i),s.range=(i,l,o)=>{const d=[];if(i=s.ceil(i),o=o==null?1:Math.floor(o),!(i<l)||!(o>0))return d;let u;do d.push(u=new Date(+i)),t(i,o),e(i);while(u<i&&i<l);return d},s.filter=i=>Ha(l=>{if(l>=l)for(;e(l),!i(l);)l.setTime(l-1)},(l,o)=>{if(l>=l)if(o<0)for(;++o<=0;)for(;t(l,-1),!i(l););else for(;--o>=0;)for(;t(l,1),!i(l););}),r&&(s.count=(i,l)=>(Yw.setTime(+i),Xw.setTime(+l),e(Yw),e(Xw),Math.floor(r(Yw,Xw))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(a?l=>a(l)%i===0:l=>s.count(0,l)%i===0):s)),s}const xg=Ha(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ha(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):xg);xg.range;const no=1e3,fi=no*60,so=fi*60,mo=so*24,$k=mo*7,GI=mo*30,Jw=mo*365,wd=Ha(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*no)},(e,t)=>(t-e)/no,e=>e.getUTCSeconds());wd.range;const Vk=Ha(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no)},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getMinutes());Vk.range;const Gk=Ha(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getUTCMinutes());Gk.range;const Kk=Ha(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no-e.getMinutes()*fi)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getHours());Kk.range;const qk=Ha(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getUTCHours());qk.range;const Hp=Ha(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fi)/mo,e=>e.getDate()-1);Hp.range;const Ub=Ha(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>e.getUTCDate()-1);Ub.range;const FO=Ha(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>Math.floor(e/mo));FO.range;function tu(e){return Ha(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*fi)/$k)}const Mb=tu(0),mg=tu(1),Oee=tu(2),Pee=tu(3),_A=tu(4),Lee=tu(5),Qee=tu(6);Mb.range;mg.range;Oee.range;Pee.range;_A.range;Lee.range;Qee.range;function ru(e){return Ha(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/$k)}const Rb=ru(0),gg=ru(1),Hee=ru(2),zee=ru(3),TA=ru(4),$ee=ru(5),Vee=ru(6);Rb.range;gg.range;Hee.range;zee.range;TA.range;$ee.range;Vee.range;const Wk=Ha(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());Wk.range;const Yk=Ha(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());Yk.range;const go=Ha(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());go.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ha(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});go.range;const bo=Ha(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());bo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ha(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});bo.range;function IO(e,t,r,a,s,i){const l=[[wd,1,no],[wd,5,5*no],[wd,15,15*no],[wd,30,30*no],[i,1,fi],[i,5,5*fi],[i,15,15*fi],[i,30,30*fi],[s,1,so],[s,3,3*so],[s,6,6*so],[s,12,12*so],[a,1,mo],[a,2,2*mo],[r,1,$k],[t,1,GI],[t,3,3*GI],[e,1,Jw]];function o(u,f,p){const x=f<u;x&&([u,f]=[f,u]);const m=p&&typeof p.range=="function"?p:d(u,f,p),b=m?m.range(u,+f+1):[];return x?b.reverse():b}function d(u,f,p){const x=Math.abs(f-u)/p,m=Tk(([,,y])=>y).right(l,x);if(m===l.length)return e.every(PN(u/Jw,f/Jw,p));if(m===0)return xg.every(Math.max(PN(u,f,p),1));const[b,v]=l[x/l[m-1][2]<l[m][2]/x?m-1:m];return b.every(v)}return[o,d]}const[Gee,Kee]=IO(bo,Yk,Rb,FO,qk,Gk),[qee,Wee]=IO(go,Wk,Mb,Hp,Kk,Vk);function Zw(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 e2(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 ef(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Yee(e){var t=e.dateTime,r=e.date,a=e.time,s=e.periods,i=e.days,l=e.shortDays,o=e.months,d=e.shortMonths,u=tf(s),f=rf(s),p=tf(i),x=rf(i),m=tf(l),b=rf(l),v=tf(o),y=rf(o),k=tf(d),_=rf(d),C={a:z,A:Z,b:Y,B:te,c:null,d:JI,e:JI,f:bte,g:Bte,G:Tte,H:xte,I:mte,j:gte,L:DO,m:vte,M:yte,p:O,q:P,Q:t6,s:r6,S:wte,u:Nte,U:Cte,V:kte,w:jte,W:Ete,x:null,X:null,y:Ste,Y:_te,Z:Fte,"%":e6},E={a:q,A:H,b:J,B:ae,c:null,d:ZI,e:ZI,f:Mte,g:Gte,G:qte,H:Ite,I:Dte,j:Ute,L:MO,m:Rte,M:Ote,p:oe,q:ce,Q:t6,s:r6,S:Pte,u:Lte,U:Qte,V:Hte,w:zte,W:$te,x:null,X:null,y:Vte,Y:Kte,Z:Wte,"%":e6},T={a:D,A:L,b:R,B:Q,c:G,d:YI,e:YI,f:Ate,g:WI,G:qI,H:XI,I:XI,j:ote,L:ute,m:lte,M:cte,p:U,q:ite,Q:pte,s:hte,S:dte,u:tte,U:rte,V:ate,w:ete,W:nte,x:K,X:W,y:WI,Y:qI,Z:ste,"%":fte};C.x=B(r,C),C.X=B(a,C),C.c=B(t,C),E.x=B(r,E),E.X=B(a,E),E.c=B(t,E);function B(ne,le){return function(ge){var X=[],pe=-1,be=0,me=ne.length,_e,Te,Xe;for(ge instanceof Date||(ge=new Date(+ge));++pe<me;)ne.charCodeAt(pe)===37&&(X.push(ne.slice(be,pe)),(Te=KI[_e=ne.charAt(++pe)])!=null?_e=ne.charAt(++pe):Te=_e==="e"?" ":"0",(Xe=le[_e])&&(_e=Xe(ge,Te)),X.push(_e),be=pe+1);return X.push(ne.slice(be,pe)),X.join("")}}function I(ne,le){return function(ge){var X=ef(1900,void 0,1),pe=M(X,ne,ge+="",0),be,me;if(pe!=ge.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(le&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(be=e2(ef(X.y,0,1)),me=be.getUTCDay(),be=me>4||me===0?gg.ceil(be):gg(be),be=Ub.offset(be,(X.V-1)*7),X.y=be.getUTCFullYear(),X.m=be.getUTCMonth(),X.d=be.getUTCDate()+(X.w+6)%7):(be=Zw(ef(X.y,0,1)),me=be.getDay(),be=me>4||me===0?mg.ceil(be):mg(be),be=Hp.offset(be,(X.V-1)*7),X.y=be.getFullYear(),X.m=be.getMonth(),X.d=be.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),me="Z"in X?e2(ef(X.y,0,1)).getUTCDay():Zw(ef(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(me+5)%7:X.w+X.U*7-(me+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,e2(X)):Zw(X)}}function M(ne,le,ge,X){for(var pe=0,be=le.length,me=ge.length,_e,Te;pe<be;){if(X>=me)return-1;if(_e=le.charCodeAt(pe++),_e===37){if(_e=le.charAt(pe++),Te=T[_e in KI?le.charAt(pe++):_e],!Te||(X=Te(ne,ge,X))<0)return-1}else if(_e!=ge.charCodeAt(X++))return-1}return X}function U(ne,le,ge){var X=u.exec(le.slice(ge));return X?(ne.p=f.get(X[0].toLowerCase()),ge+X[0].length):-1}function D(ne,le,ge){var X=m.exec(le.slice(ge));return X?(ne.w=b.get(X[0].toLowerCase()),ge+X[0].length):-1}function L(ne,le,ge){var X=p.exec(le.slice(ge));return X?(ne.w=x.get(X[0].toLowerCase()),ge+X[0].length):-1}function R(ne,le,ge){var X=k.exec(le.slice(ge));return X?(ne.m=_.get(X[0].toLowerCase()),ge+X[0].length):-1}function Q(ne,le,ge){var X=v.exec(le.slice(ge));return X?(ne.m=y.get(X[0].toLowerCase()),ge+X[0].length):-1}function G(ne,le,ge){return M(ne,t,le,ge)}function K(ne,le,ge){return M(ne,r,le,ge)}function W(ne,le,ge){return M(ne,a,le,ge)}function z(ne){return l[ne.getDay()]}function Z(ne){return i[ne.getDay()]}function Y(ne){return d[ne.getMonth()]}function te(ne){return o[ne.getMonth()]}function O(ne){return s[+(ne.getHours()>=12)]}function P(ne){return 1+~~(ne.getMonth()/3)}function q(ne){return l[ne.getUTCDay()]}function H(ne){return i[ne.getUTCDay()]}function J(ne){return d[ne.getUTCMonth()]}function ae(ne){return o[ne.getUTCMonth()]}function oe(ne){return s[+(ne.getUTCHours()>=12)]}function ce(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var le=B(ne+="",C);return le.toString=function(){return ne},le},parse:function(ne){var le=I(ne+="",!1);return le.toString=function(){return ne},le},utcFormat:function(ne){var le=B(ne+="",E);return le.toString=function(){return ne},le},utcParse:function(ne){var le=I(ne+="",!0);return le.toString=function(){return ne},le}}}var KI={"-":"",_:" ",0:"0"},tn=/^\s*\d+/,Xee=/^%/,Jee=/[\\^$*+?|[\]().{}]/g;function Jt(e,t,r){var a=e<0?"-":"",s=(a?-e:e)+"",i=s.length;return a+(i<r?new Array(r-i+1).join(t)+s:s)}function Zee(e){return e.replace(Jee,"\\$&")}function tf(e){return new RegExp("^(?:"+e.map(Zee).join("|")+")","i")}function rf(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function ete(e,t,r){var a=tn.exec(t.slice(r,r+1));return a?(e.w=+a[0],r+a[0].length):-1}function tte(e,t,r){var a=tn.exec(t.slice(r,r+1));return a?(e.u=+a[0],r+a[0].length):-1}function rte(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.U=+a[0],r+a[0].length):-1}function ate(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.V=+a[0],r+a[0].length):-1}function nte(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.W=+a[0],r+a[0].length):-1}function qI(e,t,r){var a=tn.exec(t.slice(r,r+4));return a?(e.y=+a[0],r+a[0].length):-1}function WI(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),r+a[0].length):-1}function ste(e,t,r){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),r+a[0].length):-1}function ite(e,t,r){var a=tn.exec(t.slice(r,r+1));return a?(e.q=a[0]*3-3,r+a[0].length):-1}function lte(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.m=a[0]-1,r+a[0].length):-1}function YI(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.d=+a[0],r+a[0].length):-1}function ote(e,t,r){var a=tn.exec(t.slice(r,r+3));return a?(e.m=0,e.d=+a[0],r+a[0].length):-1}function XI(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.H=+a[0],r+a[0].length):-1}function cte(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.M=+a[0],r+a[0].length):-1}function dte(e,t,r){var a=tn.exec(t.slice(r,r+2));return a?(e.S=+a[0],r+a[0].length):-1}function ute(e,t,r){var a=tn.exec(t.slice(r,r+3));return a?(e.L=+a[0],r+a[0].length):-1}function Ate(e,t,r){var a=tn.exec(t.slice(r,r+6));return a?(e.L=Math.floor(a[0]/1e3),r+a[0].length):-1}function fte(e,t,r){var a=Xee.exec(t.slice(r,r+1));return a?r+a[0].length:-1}function pte(e,t,r){var a=tn.exec(t.slice(r));return a?(e.Q=+a[0],r+a[0].length):-1}function hte(e,t,r){var a=tn.exec(t.slice(r));return a?(e.s=+a[0],r+a[0].length):-1}function JI(e,t){return Jt(e.getDate(),t,2)}function xte(e,t){return Jt(e.getHours(),t,2)}function mte(e,t){return Jt(e.getHours()%12||12,t,2)}function gte(e,t){return Jt(1+Hp.count(go(e),e),t,3)}function DO(e,t){return Jt(e.getMilliseconds(),t,3)}function bte(e,t){return DO(e,t)+"000"}function vte(e,t){return Jt(e.getMonth()+1,t,2)}function yte(e,t){return Jt(e.getMinutes(),t,2)}function wte(e,t){return Jt(e.getSeconds(),t,2)}function Nte(e){var t=e.getDay();return t===0?7:t}function Cte(e,t){return Jt(Mb.count(go(e)-1,e),t,2)}function UO(e){var t=e.getDay();return t>=4||t===0?_A(e):_A.ceil(e)}function kte(e,t){return e=UO(e),Jt(_A.count(go(e),e)+(go(e).getDay()===4),t,2)}function jte(e){return e.getDay()}function Ete(e,t){return Jt(mg.count(go(e)-1,e),t,2)}function Ste(e,t){return Jt(e.getFullYear()%100,t,2)}function Bte(e,t){return e=UO(e),Jt(e.getFullYear()%100,t,2)}function _te(e,t){return Jt(e.getFullYear()%1e4,t,4)}function Tte(e,t){var r=e.getDay();return e=r>=4||r===0?_A(e):_A.ceil(e),Jt(e.getFullYear()%1e4,t,4)}function Fte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Jt(t/60|0,"0",2)+Jt(t%60,"0",2)}function ZI(e,t){return Jt(e.getUTCDate(),t,2)}function Ite(e,t){return Jt(e.getUTCHours(),t,2)}function Dte(e,t){return Jt(e.getUTCHours()%12||12,t,2)}function Ute(e,t){return Jt(1+Ub.count(bo(e),e),t,3)}function MO(e,t){return Jt(e.getUTCMilliseconds(),t,3)}function Mte(e,t){return MO(e,t)+"000"}function Rte(e,t){return Jt(e.getUTCMonth()+1,t,2)}function Ote(e,t){return Jt(e.getUTCMinutes(),t,2)}function Pte(e,t){return Jt(e.getUTCSeconds(),t,2)}function Lte(e){var t=e.getUTCDay();return t===0?7:t}function Qte(e,t){return Jt(Rb.count(bo(e)-1,e),t,2)}function RO(e){var t=e.getUTCDay();return t>=4||t===0?TA(e):TA.ceil(e)}function Hte(e,t){return e=RO(e),Jt(TA.count(bo(e),e)+(bo(e).getUTCDay()===4),t,2)}function zte(e){return e.getUTCDay()}function $te(e,t){return Jt(gg.count(bo(e)-1,e),t,2)}function Vte(e,t){return Jt(e.getUTCFullYear()%100,t,2)}function Gte(e,t){return e=RO(e),Jt(e.getUTCFullYear()%100,t,2)}function Kte(e,t){return Jt(e.getUTCFullYear()%1e4,t,4)}function qte(e,t){var r=e.getUTCDay();return e=r>=4||r===0?TA(e):TA.ceil(e),Jt(e.getUTCFullYear()%1e4,t,4)}function Wte(){return"+0000"}function e6(){return"%"}function t6(e){return+e}function r6(e){return Math.floor(+e/1e3)}var $u,OO,PO;Yte({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 Yte(e){return $u=Yee(e),OO=$u.format,$u.parse,PO=$u.utcFormat,$u.utcParse,$u}function Xte(e){return new Date(e)}function Jte(e){return e instanceof Date?+e:+new Date(+e)}function Xk(e,t,r,a,s,i,l,o,d,u){var f=Rk(),p=f.invert,x=f.domain,m=u(".%L"),b=u(":%S"),v=u("%I:%M"),y=u("%I %p"),k=u("%a %d"),_=u("%b %d"),C=u("%B"),E=u("%Y");function T(B){return(d(B)<B?m:o(B)<B?b:l(B)<B?v:i(B)<B?y:a(B)<B?s(B)<B?k:_:r(B)<B?C:E)(B)}return f.invert=function(B){return new Date(p(B))},f.domain=function(B){return arguments.length?x(Array.from(B,Jte)):x().map(Xte)},f.ticks=function(B){var I=x();return e(I[0],I[I.length-1],B??10)},f.tickFormat=function(B,I){return I==null?T:u(I)},f.nice=function(B){var I=x();return(!B||typeof B.range!="function")&&(B=t(I[0],I[I.length-1],B??10)),B?x(kO(I,B)):f},f.copy=function(){return Qp(f,Xk(e,t,r,a,s,i,l,o,d,u))},f}function Zte(){return Ci.apply(Xk(qee,Wee,go,Wk,Mb,Hp,Kk,Vk,wd,OO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ere(){return Ci.apply(Xk(Gee,Kee,bo,Yk,Rb,Ub,qk,Gk,wd,PO).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ob(){var e=0,t=1,r,a,s,i,l=Vn,o=!1,d;function u(p){return p==null||isNaN(p=+p)?d:l(s===0?.5:(p=(i(p)-r)*s,o?Math.max(0,Math.min(1,p)):p))}u.domain=function(p){return arguments.length?([e,t]=p,r=i(e=+e),a=i(t=+t),s=r===a?0:1/(a-r),u):[e,t]},u.clamp=function(p){return arguments.length?(o=!!p,u):o},u.interpolator=function(p){return arguments.length?(l=p,u):l};function f(p){return function(x){var m,b;return arguments.length?([m,b]=x,l=p(m,b),u):[l(0),l(1)]}}return u.range=f(HA),u.rangeRound=f(Mk),u.unknown=function(p){return arguments.length?(d=p,u):d},function(p){return i=p,r=p(e),a=p(t),s=r===a?0:1/(a-r),u}}function Hc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function LO(){var e=Qc(Ob()(Vn));return e.copy=function(){return Hc(e,LO())},So.apply(e,arguments)}function QO(){var e=Lk(Ob()).domain([1,10]);return e.copy=function(){return Hc(e,QO()).base(e.base())},So.apply(e,arguments)}function HO(){var e=Qk(Ob());return e.copy=function(){return Hc(e,HO()).constant(e.constant())},So.apply(e,arguments)}function Jk(){var e=Hk(Ob());return e.copy=function(){return Hc(e,Jk()).exponent(e.exponent())},So.apply(e,arguments)}function tre(){return Jk.apply(null,arguments).exponent(.5)}function zO(){var e=[],t=Vn;function r(a){if(a!=null&&!isNaN(a=+a))return t((Pp(e,a,1)-1)/(e.length-1))}return r.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(kc),r},r.interpolator=function(a){return arguments.length?(t=a,r):t},r.range=function(){return e.map((a,s)=>t(s/(e.length-1)))},r.quantiles=function(a){return Array.from({length:a+1},(s,i)=>LZ(e,i/a))},r.copy=function(){return zO(t).domain(e)},So.apply(r,arguments)}function Pb(){var e=0,t=.5,r=1,a=1,s,i,l,o,d,u=Vn,f,p=!1,x;function m(v){return isNaN(v=+v)?x:(v=.5+((v=+f(v))-i)*(a*v<a*i?o:d),u(p?Math.max(0,Math.min(1,v)):v))}m.domain=function(v){return arguments.length?([e,t,r]=v,s=f(e=+e),i=f(t=+t),l=f(r=+r),o=s===i?0:.5/(i-s),d=i===l?0:.5/(l-i),a=i<s?-1:1,m):[e,t,r]},m.clamp=function(v){return arguments.length?(p=!!v,m):p},m.interpolator=function(v){return arguments.length?(u=v,m):u};function b(v){return function(y){var k,_,C;return arguments.length?([k,_,C]=y,u=fee(v,[k,_,C]),m):[u(0),u(.5),u(1)]}}return m.range=b(HA),m.rangeRound=b(Mk),m.unknown=function(v){return arguments.length?(x=v,m):x},function(v){return f=v,s=v(e),i=v(t),l=v(r),o=s===i?0:.5/(i-s),d=i===l?0:.5/(l-i),a=i<s?-1:1,m}}function $O(){var e=Qc(Pb()(Vn));return e.copy=function(){return Hc(e,$O())},So.apply(e,arguments)}function VO(){var e=Lk(Pb()).domain([.1,1,10]);return e.copy=function(){return Hc(e,VO()).base(e.base())},So.apply(e,arguments)}function GO(){var e=Qk(Pb());return e.copy=function(){return Hc(e,GO()).constant(e.constant())},So.apply(e,arguments)}function Zk(){var e=Hk(Pb());return e.copy=function(){return Hc(e,Zk()).exponent(e.exponent())},So.apply(e,arguments)}function rre(){return Zk.apply(null,arguments).exponent(.5)}const mf=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ik,scaleDiverging:$O,scaleDivergingLog:VO,scaleDivergingPow:Zk,scaleDivergingSqrt:rre,scaleDivergingSymlog:GO,scaleIdentity:CO,scaleImplicit:LN,scaleLinear:NO,scaleLog:jO,scaleOrdinal:Fk,scalePoint:zZ,scalePow:zk,scaleQuantile:BO,scaleQuantize:_O,scaleRadial:SO,scaleSequential:LO,scaleSequentialLog:QO,scaleSequentialPow:Jk,scaleSequentialQuantile:zO,scaleSequentialSqrt:tre,scaleSequentialSymlog:HO,scaleSqrt:Mee,scaleSymlog:EO,scaleThreshold:TO,scaleTime:Zte,scaleUtc:ere,tickFormat:wO},Symbol.toStringTag,{value:"Module"}));var Bo=e=>e.chartData,KO=De([Bo],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),qO=(e,t,r,a)=>a?KO(e):Bo(e),are=(e,t,r)=>r?KO(e):Bo(e);function vo(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Ht(t)&&Ht(r))return!0}return!1}function a6(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function WO(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,a]=e,s,i;if(Ht(r))s=r;else if(typeof r=="function")return;if(Ht(a))i=a;else if(typeof a=="function")return;var l=[s,i];if(vo(l))return l}}function nre(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,r);if(vo(a))return a6(a,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,i]=e,l,o;if(s==="auto")t!=null&&(l=Math.min(...t));else if(ct(s))l=s;else if(typeof s=="function")try{t!=null&&(l=s(t==null?void 0:t[0]))}catch{}else if(typeof s=="string"&&hF.test(s)){var d=hF.exec(s);if(d==null||d[1]==null||t==null)l=void 0;else{var u=+d[1];l=t[0]-u}}else l=t==null?void 0:t[0];if(i==="auto")t!=null&&(o=Math.max(...t));else if(ct(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&xF.test(i)){var f=xF.exec(i);if(f==null||f[1]==null||t==null)o=void 0;else{var p=+f[1];o=t[1]+p}}else o=t==null?void 0:t[1];var x=[l,o];if(vo(x))return t==null?x:a6(x,t,r)}}}var zA=1e9,sre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},tj,Pr=!0,yi="[DecimalError] ",Sd=yi+"Invalid argument: ",ej=yi+"Exponent out of range: ",$A=Math.floor,xd=Math.pow,ire=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Fs,Wa=1e7,Sr=7,YO=9007199254740991,bg=$A(YO/Sr),nt={};nt.absoluteValue=nt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};nt.comparedTo=nt.cmp=function(e){var t,r,a,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(a=i.d.length,s=e.d.length,t=0,r=a<s?a:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return a===s?0:a>s^i.s<0?1:-1};nt.decimalPlaces=nt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Sr;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};nt.dividedBy=nt.div=function(e){return lo(this,new this.constructor(e))};nt.dividedToIntegerBy=nt.idiv=function(e){var t=this,r=t.constructor;return br(lo(t,new r(e),0,1),r.precision)};nt.equals=nt.eq=function(e){return!this.cmp(e)};nt.exponent=function(){return Sa(this)};nt.greaterThan=nt.gt=function(e){return this.cmp(e)>0};nt.greaterThanOrEqualTo=nt.gte=function(e){return this.cmp(e)>=0};nt.isInteger=nt.isint=function(){return this.e>this.d.length-2};nt.isNegative=nt.isneg=function(){return this.s<0};nt.isPositive=nt.ispos=function(){return this.s>0};nt.isZero=function(){return this.s===0};nt.lessThan=nt.lt=function(e){return this.cmp(e)<0};nt.lessThanOrEqualTo=nt.lte=function(e){return this.cmp(e)<1};nt.logarithm=nt.log=function(e){var t,r=this,a=r.constructor,s=a.precision,i=s+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(Fs))throw Error(yi+"NaN");if(r.s<1)throw Error(yi+(r.s?"NaN":"-Infinity"));return r.eq(Fs)?new a(0):(Pr=!1,t=lo(lp(r,i),lp(e,i),i),Pr=!0,br(t,s))};nt.minus=nt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ZO(t,e):XO(t,(e.s=-e.s,e))};nt.modulo=nt.mod=function(e){var t,r=this,a=r.constructor,s=a.precision;if(e=new a(e),!e.s)throw Error(yi+"NaN");return r.s?(Pr=!1,t=lo(r,e,0,1).times(e),Pr=!0,r.minus(t)):br(new a(r),s)};nt.naturalExponential=nt.exp=function(){return JO(this)};nt.naturalLogarithm=nt.ln=function(){return lp(this)};nt.negated=nt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};nt.plus=nt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?XO(t,e):ZO(t,(e.s=-e.s,e))};nt.precision=nt.sd=function(e){var t,r,a,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Sd+e);if(t=Sa(s)+1,a=s.d.length-1,r=a*Sr+1,a=s.d[a],a){for(;a%10==0;a/=10)r--;for(a=s.d[0];a>=10;a/=10)r++}return e&&t>r?t:r};nt.squareRoot=nt.sqrt=function(){var e,t,r,a,s,i,l,o=this,d=o.constructor;if(o.s<1){if(!o.s)return new d(0);throw Error(yi+"NaN")}for(e=Sa(o),Pr=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=xl(o.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=$A((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(s.toString()),r=d.precision,s=l=r+3;;)if(i=a,a=i.plus(lo(o,i,l+2)).times(.5),xl(i.d).slice(0,l)===(t=xl(a.d)).slice(0,l)){if(t=t.slice(l-3,l+1),s==l&&t=="4999"){if(br(i,r+1,0),i.times(i).eq(o)){a=i;break}}else if(t!="9999")break;l+=4}return Pr=!0,br(a,r)};nt.times=nt.mul=function(e){var t,r,a,s,i,l,o,d,u,f=this,p=f.constructor,x=f.d,m=(e=new p(e)).d;if(!f.s||!e.s)return new p(0);for(e.s*=f.s,r=f.e+e.e,d=x.length,u=m.length,d<u&&(i=x,x=m,m=i,l=d,d=u,u=l),i=[],l=d+u,a=l;a--;)i.push(0);for(a=u;--a>=0;){for(t=0,s=d+a;s>a;)o=i[s]+m[a]*x[s-a-1]+t,i[s--]=o%Wa|0,t=o/Wa|0;i[s]=(i[s]+t)%Wa|0}for(;!i[--l];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Pr?br(e,p.precision):e};nt.toDecimalPlaces=nt.todp=function(e,t){var r=this,a=r.constructor;return r=new a(r),e===void 0?r:(jl(e,0,zA),t===void 0?t=a.rounding:jl(t,0,8),br(r,e+Sa(r)+1,t))};nt.toExponential=function(e,t){var r,a=this,s=a.constructor;return e===void 0?r=zd(a,!0):(jl(e,0,zA),t===void 0?t=s.rounding:jl(t,0,8),a=br(new s(a),e+1,t),r=zd(a,!0,e+1)),r};nt.toFixed=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?zd(s):(jl(e,0,zA),t===void 0?t=i.rounding:jl(t,0,8),a=br(new i(s),e+Sa(s)+1,t),r=zd(a.abs(),!1,e+Sa(a)+1),s.isneg()&&!s.isZero()?"-"+r:r)};nt.toInteger=nt.toint=function(){var e=this,t=e.constructor;return br(new t(e),Sa(e)+1,t.rounding)};nt.toNumber=function(){return+this};nt.toPower=nt.pow=function(e){var t,r,a,s,i,l,o=this,d=o.constructor,u=12,f=+(e=new d(e));if(!e.s)return new d(Fs);if(o=new d(o),!o.s){if(e.s<1)throw Error(yi+"Infinity");return o}if(o.eq(Fs))return o;if(a=d.precision,e.eq(Fs))return br(o,a);if(t=e.e,r=e.d.length-1,l=t>=r,i=o.s,l){if((r=f<0?-f:f)<=YO){for(s=new d(Fs),t=Math.ceil(a/Sr+4),Pr=!1;r%2&&(s=s.times(o),s6(s.d,t)),r=$A(r/2),r!==0;)o=o.times(o),s6(o.d,t);return Pr=!0,e.s<0?new d(Fs).div(s):br(s,a)}}else if(i<0)throw Error(yi+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,Pr=!1,s=e.times(lp(o,a+u)),Pr=!0,s=JO(s),s.s=i,s};nt.toPrecision=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?(r=Sa(s),a=zd(s,r<=i.toExpNeg||r>=i.toExpPos)):(jl(e,1,zA),t===void 0?t=i.rounding:jl(t,0,8),s=br(new i(s),e,t),r=Sa(s),a=zd(s,e<=r||r<=i.toExpNeg,e)),a};nt.toSignificantDigits=nt.tosd=function(e,t){var r=this,a=r.constructor;return e===void 0?(e=a.precision,t=a.rounding):(jl(e,1,zA),t===void 0?t=a.rounding:jl(t,0,8)),br(new a(r),e,t)};nt.toString=nt.valueOf=nt.val=nt.toJSON=nt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Sa(e),r=e.constructor;return zd(e,t<=r.toExpNeg||t>=r.toExpPos)};function XO(e,t){var r,a,s,i,l,o,d,u,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Pr?br(t,p):t;if(d=e.d,u=t.d,l=e.e,s=t.e,d=d.slice(),i=l-s,i){for(i<0?(a=d,i=-i,o=u.length):(a=u,s=l,o=d.length),l=Math.ceil(p/Sr),o=l>o?l+1:o+1,i>o&&(i=o,a.length=1),a.reverse();i--;)a.push(0);a.reverse()}for(o=d.length,i=u.length,o-i<0&&(i=o,a=u,u=d,d=a),r=0;i;)r=(d[--i]=d[i]+u[i]+r)/Wa|0,d[i]%=Wa;for(r&&(d.unshift(r),++s),o=d.length;d[--o]==0;)d.pop();return t.d=d,t.e=s,Pr?br(t,p):t}function jl(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Sd+e)}function xl(e){var t,r,a,s=e.length-1,i="",l=e[0];if(s>0){for(i+=l,t=1;t<s;t++)a=e[t]+"",r=Sr-a.length,r&&(i+=pc(r)),i+=a;l=e[t],a=l+"",r=Sr-a.length,r&&(i+=pc(r))}else if(l===0)return"0";for(;l%10===0;)l/=10;return i+l}var lo=(function(){function e(a,s){var i,l=0,o=a.length;for(a=a.slice();o--;)i=a[o]*s+l,a[o]=i%Wa|0,l=i/Wa|0;return l&&a.unshift(l),a}function t(a,s,i,l){var o,d;if(i!=l)d=i>l?1:-1;else for(o=d=0;o<i;o++)if(a[o]!=s[o]){d=a[o]>s[o]?1:-1;break}return d}function r(a,s,i){for(var l=0;i--;)a[i]-=l,l=a[i]<s[i]?1:0,a[i]=l*Wa+a[i]-s[i];for(;!a[0]&&a.length>1;)a.shift()}return function(a,s,i,l){var o,d,u,f,p,x,m,b,v,y,k,_,C,E,T,B,I,M,U=a.constructor,D=a.s==s.s?1:-1,L=a.d,R=s.d;if(!a.s)return new U(a);if(!s.s)throw Error(yi+"Division by zero");for(d=a.e-s.e,I=R.length,T=L.length,m=new U(D),b=m.d=[],u=0;R[u]==(L[u]||0);)++u;if(R[u]>(L[u]||0)&&--d,i==null?_=i=U.precision:l?_=i+(Sa(a)-Sa(s))+1:_=i,_<0)return new U(0);if(_=_/Sr+2|0,u=0,I==1)for(f=0,R=R[0],_++;(u<T||f)&&_--;u++)C=f*Wa+(L[u]||0),b[u]=C/R|0,f=C%R|0;else{for(f=Wa/(R[0]+1)|0,f>1&&(R=e(R,f),L=e(L,f),I=R.length,T=L.length),E=I,v=L.slice(0,I),y=v.length;y<I;)v[y++]=0;M=R.slice(),M.unshift(0),B=R[0],R[1]>=Wa/2&&++B;do f=0,o=t(R,v,I,y),o<0?(k=v[0],I!=y&&(k=k*Wa+(v[1]||0)),f=k/B|0,f>1?(f>=Wa&&(f=Wa-1),p=e(R,f),x=p.length,y=v.length,o=t(p,v,x,y),o==1&&(f--,r(p,I<x?M:R,x))):(f==0&&(o=f=1),p=R.slice()),x=p.length,x<y&&p.unshift(0),r(v,p,y),o==-1&&(y=v.length,o=t(R,v,I,y),o<1&&(f++,r(v,I<y?M:R,y))),y=v.length):o===0&&(f++,v=[0]),b[u++]=f,o&&v[0]?v[y++]=L[E]||0:(v=[L[E]],y=1);while((E++<T||v[0]!==void 0)&&_--)}return b[0]||b.shift(),m.e=d,br(m,l?i+Sa(m)+1:i)}})();function JO(e,t){var r,a,s,i,l,o,d=0,u=0,f=e.constructor,p=f.precision;if(Sa(e)>16)throw Error(ej+Sa(e));if(!e.s)return new f(Fs);for(Pr=!1,o=p,l=new f(.03125);e.abs().gte(.1);)e=e.times(l),u+=5;for(a=Math.log(xd(2,u))/Math.LN10*2+5|0,o+=a,r=s=i=new f(Fs),f.precision=o;;){if(s=br(s.times(e),o),r=r.times(++d),l=i.plus(lo(s,r,o)),xl(l.d).slice(0,o)===xl(i.d).slice(0,o)){for(;u--;)i=br(i.times(i),o);return f.precision=p,t==null?(Pr=!0,br(i,p)):i}i=l}}function Sa(e){for(var t=e.e*Sr,r=e.d[0];r>=10;r/=10)t++;return t}function t2(e,t,r){if(t>e.LN10.sd())throw Pr=!0,r&&(e.precision=r),Error(yi+"LN10 precision limit exceeded");return br(new e(e.LN10),t)}function pc(e){for(var t="";e--;)t+="0";return t}function lp(e,t){var r,a,s,i,l,o,d,u,f,p=1,x=10,m=e,b=m.d,v=m.constructor,y=v.precision;if(m.s<1)throw Error(yi+(m.s?"NaN":"-Infinity"));if(m.eq(Fs))return new v(0);if(t==null?(Pr=!1,u=y):u=t,m.eq(10))return t==null&&(Pr=!0),t2(v,u);if(u+=x,v.precision=u,r=xl(b),a=r.charAt(0),i=Sa(m),Math.abs(i)<15e14){for(;a<7&&a!=1||a==1&&r.charAt(1)>3;)m=m.times(e),r=xl(m.d),a=r.charAt(0),p++;i=Sa(m),a>1?(m=new v("0."+r),i++):m=new v(a+"."+r.slice(1))}else return d=t2(v,u+2,y).times(i+""),m=lp(new v(a+"."+r.slice(1)),u-x).plus(d),v.precision=y,t==null?(Pr=!0,br(m,y)):m;for(o=l=m=lo(m.minus(Fs),m.plus(Fs),u),f=br(m.times(m),u),s=3;;){if(l=br(l.times(f),u),d=o.plus(lo(l,new v(s),u)),xl(d.d).slice(0,u)===xl(o.d).slice(0,u))return o=o.times(2),i!==0&&(o=o.plus(t2(v,u+2,y).times(i+""))),o=lo(o,new v(p),u),v.precision=y,t==null?(Pr=!0,br(o,y)):o;o=d,s+=2}}function n6(e,t){var r,a,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(r<0&&(r=a),r+=+t.slice(a+1),t=t.substring(0,a)):r<0&&(r=t.length),a=0;t.charCodeAt(a)===48;)++a;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(a,s),t){if(s-=a,r=r-a-1,e.e=$A(r/Sr),e.d=[],a=(r+1)%Sr,r<0&&(a+=Sr),a<s){for(a&&e.d.push(+t.slice(0,a)),s-=Sr;a<s;)e.d.push(+t.slice(a,a+=Sr));t=t.slice(a),a=Sr-t.length}else a-=s;for(;a--;)t+="0";if(e.d.push(+t),Pr&&(e.e>bg||e.e<-bg))throw Error(ej+r)}else e.s=0,e.e=0,e.d=[0];return e}function br(e,t,r){var a,s,i,l,o,d,u,f,p=e.d;for(l=1,i=p[0];i>=10;i/=10)l++;if(a=t-l,a<0)a+=Sr,s=t,u=p[f=0];else{if(f=Math.ceil((a+1)/Sr),i=p.length,f>=i)return e;for(u=i=p[f],l=1;i>=10;i/=10)l++;a%=Sr,s=a-Sr+l}if(r!==void 0&&(i=xd(10,l-s-1),o=u/i%10|0,d=t<0||p[f+1]!==void 0||u%i,d=r<4?(o||d)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||d||r==6&&(a>0?s>0?u/xd(10,l-s):0:p[f-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return d?(i=Sa(e),p.length=1,t=t-i-1,p[0]=xd(10,(Sr-t%Sr)%Sr),e.e=$A(-t/Sr)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(a==0?(p.length=f,i=1,f--):(p.length=f+1,i=xd(10,Sr-a),p[f]=s>0?(u/xd(10,l-s)%xd(10,s)|0)*i:0),d)for(;;)if(f==0){(p[0]+=i)==Wa&&(p[0]=1,++e.e);break}else{if(p[f]+=i,p[f]!=Wa)break;p[f--]=0,i=1}for(a=p.length;p[--a]===0;)p.pop();if(Pr&&(e.e>bg||e.e<-bg))throw Error(ej+Sa(e));return e}function ZO(e,t){var r,a,s,i,l,o,d,u,f,p,x=e.constructor,m=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),Pr?br(t,m):t;if(d=e.d,p=t.d,a=t.e,u=e.e,d=d.slice(),l=u-a,l){for(f=l<0,f?(r=d,l=-l,o=p.length):(r=p,a=u,o=d.length),s=Math.max(Math.ceil(m/Sr),o)+2,l>s&&(l=s,r.length=1),r.reverse(),s=l;s--;)r.push(0);r.reverse()}else{for(s=d.length,o=p.length,f=s<o,f&&(o=s),s=0;s<o;s++)if(d[s]!=p[s]){f=d[s]<p[s];break}l=0}for(f&&(r=d,d=p,p=r,t.s=-t.s),o=d.length,s=p.length-o;s>0;--s)d[o++]=0;for(s=p.length;s>l;){if(d[--s]<p[s]){for(i=s;i&&d[--i]===0;)d[i]=Wa-1;--d[i],d[s]+=Wa}d[s]-=p[s]}for(;d[--o]===0;)d.pop();for(;d[0]===0;d.shift())--a;return d[0]?(t.d=d,t.e=a,Pr?br(t,m):t):new x(0)}function zd(e,t,r){var a,s=Sa(e),i=xl(e.d),l=i.length;return t?(r&&(a=r-l)>0?i=i.charAt(0)+"."+i.slice(1)+pc(a):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+pc(-s-1)+i,r&&(a=r-l)>0&&(i+=pc(a))):s>=l?(i+=pc(s+1-l),r&&(a=r-s-1)>0&&(i=i+"."+pc(a))):((a=s+1)<l&&(i=i.slice(0,a)+"."+i.slice(a)),r&&(a=r-l)>0&&(s+1===l&&(i+="."),i+=pc(a))),e.s<0?"-"+i:i}function s6(e,t){if(e.length>t)return e.length=t,!0}function e8(e){var t,r,a;function s(i){var l=this;if(!(l instanceof s))return new s(i);if(l.constructor=s,i instanceof s){l.s=i.s,l.e=i.e,l.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Sd+i);if(i>0)l.s=1;else if(i<0)i=-i,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(i===~~i&&i<1e7){l.e=0,l.d=[i];return}return n6(l,i.toString())}else if(typeof i!="string")throw Error(Sd+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,ire.test(i))n6(l,i);else throw Error(Sd+i)}if(s.prototype=nt,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=e8,s.config=s.set=lre,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<a.length;)e.hasOwnProperty(r=a[t++])||(e[r]=this[r]);return s.config(e),s}function lre(e){if(!e||typeof e!="object")throw Error(yi+"Object expected");var t,r,a,s=["precision",1,zA,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((a=e[r=s[t]])!==void 0)if($A(a)===a&&a>=s[t+1]&&a<=s[t+2])this[r]=a;else throw Error(Sd+r+": "+a);if((a=e[r="LN10"])!==void 0)if(a==Math.LN10)this[r]=new this(a);else throw Error(Sd+r+": "+a);return this}var tj=e8(sre);Fs=new tj(1);const or=tj;function t8(e){var t;return e===0?t=1:t=Math.floor(new or(e).abs().log(10).toNumber())+1,t}function r8(e,t,r){for(var a=new or(e),s=0,i=[];a.lt(t)&&s<1e5;)i.push(a.toNumber()),a=a.add(r),s++;return i}var a8=e=>{var[t,r]=e,[a,s]=[t,r];return t>r&&([a,s]=[r,t]),[a,s]},n8=(e,t,r)=>{if(e.lte(0))return new or(0);var a=t8(e.toNumber()),s=new or(10).pow(a),i=e.div(s),l=a!==1?.05:.1,o=new or(Math.ceil(i.div(l).toNumber())).add(r).mul(l),d=o.mul(s);return t?new or(d.toNumber()):new or(Math.ceil(d.toNumber()))},ore=(e,t,r)=>{var a=new or(1),s=new or(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(a=new or(10).pow(t8(e)-1),s=new or(Math.floor(s.div(a).toNumber())).mul(a)):i>1&&(s=new or(Math.floor(e)))}else e===0?s=new or(Math.floor((t-1)/2)):r||(s=new or(Math.floor(e)));for(var l=Math.floor((t-1)/2),o=[],d=0;d<t;d++)o.push(s.add(new or(d-l).mul(a)).toNumber());return o},s8=function(t,r,a,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(a-1)))return{step:new or(0),tickMin:new or(0),tickMax:new or(0)};var l=n8(new or(r).sub(t).div(a-1),s,i),o;t<=0&&r>=0?o=new or(0):(o=new or(t).add(r).div(2),o=o.sub(new or(o).mod(l)));var d=Math.ceil(o.sub(t).div(l).toNumber()),u=Math.ceil(new or(r).sub(o).div(l).toNumber()),f=d+u+1;return f>a?s8(t,r,a,s,i+1):(f<a&&(u=r>0?u+(a-f):u,d=r>0?d:d+(a-f)),{step:l,tickMin:o.sub(new or(d).mul(l)),tickMax:o.add(new or(u).mul(l))})},cre=function(t){var[r,a]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(s,2),[o,d]=a8([r,a]);if(o===-1/0||d===1/0){var u=d===1/0?[o,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),d];return r>a?u.reverse():u}if(o===d)return ore(o,s,i);var{step:f,tickMin:p,tickMax:x}=s8(o,d,l,i,0),m=r8(p,x.add(new or(.1).mul(f)),f);return r>a?m.reverse():m},dre=function(t,r){var[a,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[l,o]=a8([a,s]);if(l===-1/0||o===1/0)return[a,s];if(l===o)return[l];var d=Math.max(r,2),u=n8(new or(o).sub(l).div(d-1),i,0),f=[...r8(new or(l),new or(o),u),o];return i===!1&&(f=f.map(p=>Math.round(p))),a>s?f.reverse():f},ure=e=>e.rootProps.barCategoryGap,Lb=e=>e.rootProps.stackOffset,i8=e=>e.rootProps.reverseStackOrder,rj=e=>e.options.chartName,aj=e=>e.rootProps.syncId,l8=e=>e.rootProps.syncMethod,nj=e=>e.options.eventEmitter,Are=e=>e.rootProps.baseValue,Gn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ad={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ll={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Qb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Hb(e,t,r){if(r!=="auto")return r;if(e!=null)return Bl(e,t)?"category":"number"}function i6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function vg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?i6(Object(r),!0).forEach(function(a){fre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function fre(e,t,r){return(t=pre(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pre(e){var t=hre(e,"string");return typeof t=="symbol"?t:t+""}function hre(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l6={allowDataOverflow:Ad.allowDataOverflow,allowDecimals:Ad.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ad.angleAxisId,includeHidden:!1,name:void 0,reversed:Ad.reversed,scale:Ad.scale,tick:Ad.tick,tickCount:void 0,ticks:void 0,type:Ad.type,unit:void 0},o6={allowDataOverflow:ll.allowDataOverflow,allowDecimals:ll.allowDecimals,allowDuplicatedCategory:ll.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ll.radiusAxisId,includeHidden:ll.includeHidden,name:void 0,reversed:ll.reversed,scale:ll.scale,tick:ll.tick,tickCount:ll.tickCount,ticks:void 0,type:ll.type,unit:void 0},xre=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},sj=De([xre,XR],(e,t)=>{var r;if(e!=null)return e;var a=(r=Hb(t,"angleAxis",l6.type))!==null&&r!==void 0?r:"category";return vg(vg({},l6),{},{type:a})}),mre=(e,t)=>e.polarAxis.radiusAxis[t],ij=De([mre,XR],(e,t)=>{var r;if(e!=null)return e;var a=(r=Hb(t,"radiusAxis",o6.type))!==null&&r!==void 0?r:"category";return vg(vg({},o6),{},{type:a})}),zb=e=>e.polarOptions,lj=De([jo,Eo,kn],fZ),o8=De([zb,lj],(e,t)=>{if(e!=null)return Fc(e.innerRadius,t,0)}),c8=De([zb,lj],(e,t)=>{if(e!=null)return Fc(e.outerRadius,t,t*.8)}),gre=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},d8=De([zb],gre);De([sj,d8],Qb);var u8=De([lj,o8,c8],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});De([ij,u8],Qb);var A8=De([Hr,zb,o8,c8,jo,Eo],(e,t,r,a,s,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||a==null)){var{cx:l,cy:o,startAngle:d,endAngle:u}=t;return{cx:Fc(l,s,s/2),cy:Fc(o,i,i/2),innerRadius:r,outerRadius:a,startAngle:d,endAngle:u,clockWise:!1}}}),rn=(e,t)=>t,$b=(e,t,r)=>r;function oj(e){return e==null?void 0:e.id}function f8(e,t,r){var{chartData:a=[]}=t,{allowDuplicatedCategory:s,dataKey:i}=r,l=new Map;return e.forEach(o=>{var d,u=(d=o.data)!==null&&d!==void 0?d:a;if(!(u==null||u.length===0)){var f=oj(o);u.forEach((p,x)=>{var m=i==null||s?x:String(yn(p,i,null)),b=yn(p,o.dataKey,0),v;l.has(m)?v=l.get(m):v={},Object.assign(v,{[f]:b}),l.set(m,v)})}}),Array.from(l.values())}function cj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Vb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Gb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function bre(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var an=e=>{var t=Hr(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},VA=e=>e.tooltip.settings.axisId;function vre(e){if(e in mf)return mf[e]();var t="scale".concat(pk(e));if(t in mf)return mf[t]()}function c6(e){var t=e.ticks,r=e.bandwidth,a=e.range(),s=[Math.min(...a),Math.max(...a)];return{domain:()=>e.domain(),range:(function(i){function l(){return i.apply(this,arguments)}return l.toString=function(){return i.toString()},l})(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(i){var l=s[0],o=s[1];return l<=o?i>=l&&i<=o:i>=o&&i<=l},bandwidth:r?()=>r.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,l)=>{var o=e(i);if(o!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":o+=d/2;break;case"end":o+=d;break}}return o}}}}function d6(e,t,r){if(typeof e=="function")return c6(e.copy().domain(t).range(r));if(e!=null){var a=vre(e);if(a!=null)return a.domain(t).range(r),c6(a)}}var yre=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!vo(t)){for(var r,a,s=0;s<t.length;s++){var i=t[s];Ht(i)&&((r===void 0||i<r)&&(r=i),(a===void 0||i>a)&&(a=i))}return r!==void 0&&a!==void 0?[r,a]:void 0}return t}default:return t}};function u6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function yg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u6(Object(r),!0).forEach(function(a){wre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function wre(e,t,r){return(t=Nre(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nre(e){var t=Cre(e,"string");return typeof t=="symbol"?t:t+""}function Cre(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $N=[0,"auto"],Ka={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},p8=(e,t)=>e.cartesianAxis.xAxis[t],_o=(e,t)=>{var r=p8(e,t);return r??Ka},qa={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:$N,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,width:Up},h8=(e,t)=>e.cartesianAxis.yAxis[t],To=(e,t)=>{var r=h8(e,t);return r??qa},kre={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:""},dj=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??kre},Xn=(e,t,r)=>{switch(t){case"xAxis":return _o(e,r);case"yAxis":return To(e,r);case"zAxis":return dj(e,r);case"angleAxis":return sj(e,r);case"radiusAxis":return ij(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},jre=(e,t,r)=>{switch(t){case"xAxis":return _o(e,r);case"yAxis":return To(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},zp=(e,t,r)=>{switch(t){case"xAxis":return _o(e,r);case"yAxis":return To(e,r);case"angleAxis":return sj(e,r);case"radiusAxis":return ij(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},x8=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function m8(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var g8=e=>e.graphicalItems.cartesianItems,Ere=De([rn,$b],m8),b8=(e,t,r)=>e.filter(r).filter(a=>(t==null?void 0:t.includeHidden)===!0?!0:!a.hide),$p=De([g8,Xn,Ere],b8,{memoizeOptions:{resultEqualityCheck:Gb}}),v8=De([$p],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(cj)),y8=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Sre=De([$p],y8),w8=e=>e.map(t=>t.data).filter(Boolean).flat(1),Bre=De([$p],w8,{memoizeOptions:{resultEqualityCheck:Gb}}),N8=(e,t)=>{var{chartData:r=[],dataStartIndex:a,dataEndIndex:s}=t;return e.length>0?e:r.slice(a,s+1)},uj=De([Bre,qO],N8),C8=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(a=>({value:yn(a,t.dataKey)})):r.length>0?r.map(a=>a.dataKey).flatMap(a=>e.map(s=>({value:yn(s,a)}))):e.map(a=>({value:a})),Kb=De([uj,Xn,$p],C8);function k8(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Sm(e){if(Cl(e)||e instanceof Date){var t=Number(e);if(Ht(t))return t}}function A6(e){if(Array.isArray(e)){var t=[Sm(e[0]),Sm(e[1])];return vo(t)?t:void 0}var r=Sm(e);if(r!=null)return[r,r]}function yo(e){return e.map(Sm).filter(ds)}function _re(e,t,r){return!r||typeof t!="number"||Nl(t)?[]:r.length?yo(r.flatMap(a=>{var s=yn(e,a.dataKey),i,l;if(Array.isArray(s)?[i,l]=s:i=l=s,!(!Ht(i)||!Ht(l)))return[t-i,t+l]})):[]}var za=e=>{var t=an(e),r=VA(e);return zp(e,t,r)},Vp=De([za],e=>e==null?void 0:e.dataKey),Tre=De([v8,qO,za],f8),j8=(e,t,r,a)=>{var s={},i=t.reduce((l,o)=>{if(o.stackId==null)return l;var d=l[o.stackId];return d==null&&(d=[]),d.push(o),l[o.stackId]=d,l},s);return Object.fromEntries(Object.entries(i).map(l=>{var[o,d]=l,u=a?[...d].reverse():d,f=u.map(oj);return[o,{stackedData:aX(e,f,r),graphicalItems:u}]}))},E8=De([Tre,v8,Lb,i8],j8),S8=(e,t,r,a)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(a==null&&r!=="zAxis"){var l=lX(e,s,i);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},Fre=De([Xn],e=>e.allowDataOverflow),Aj=e=>{var t;if(e==null||!("domain"in e))return $N;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=yo(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:$N},B8=De([Xn],Aj),_8=De([B8,Fre],WO),Ire=De([E8,Bo,rn,_8],S8,{memoizeOptions:{resultEqualityCheck:Vb}}),fj=e=>e.errorBars,Dre=(e,t,r)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>k8(r,a)),wg=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var s=r.filter(Boolean);if(s.length!==0){var i=s.flat(),l=Math.min(...i),o=Math.max(...i);return[l,o]}},T8=(e,t,r,a,s)=>{var i,l;if(r.length>0&&e.forEach(o=>{r.forEach(d=>{var u,f,p=(u=a[d.id])===null||u===void 0?void 0:u.filter(k=>k8(s,k)),x=yn(o,(f=t.dataKey)!==null&&f!==void 0?f:d.dataKey),m=_re(o,x,p);if(m.length>=2){var b=Math.min(...m),v=Math.max(...m);(i==null||b<i)&&(i=b),(l==null||v>l)&&(l=v)}var y=A6(x);y!=null&&(i=i==null?y[0]:Math.min(i,y[0]),l=l==null?y[1]:Math.max(l,y[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(o=>{var d=A6(yn(o,t.dataKey));d!=null&&(i=i==null?d[0]:Math.min(i,d[0]),l=l==null?d[1]:Math.max(l,d[1]))}),Ht(i)&&Ht(l))return[i,l]},Ure=De([uj,Xn,Sre,fj,rn],T8,{memoizeOptions:{resultEqualityCheck:Vb}});function Mre(e){var{value:t}=e;if(Cl(t)||t instanceof Date)return t}var Rre=(e,t,r)=>{var a=e.map(Mre).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&WM(a))?fO(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},F8=e=>e.referenceElements.dots,GA=(e,t,r)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===r:a.yAxisId===r),Ore=De([F8,rn,$b],GA),I8=e=>e.referenceElements.areas,Pre=De([I8,rn,$b],GA),D8=e=>e.referenceElements.lines,Lre=De([D8,rn,$b],GA),U8=(e,t)=>{if(e!=null){var r=yo(e.map(a=>t==="xAxis"?a.x:a.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Qre=De(Ore,rn,U8),M8=(e,t)=>{if(e!=null){var r=yo(e.flatMap(a=>[t==="xAxis"?a.x1:a.y1,t==="xAxis"?a.x2:a.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Hre=De([Pre,rn],M8);function zre(e){var t;if(e.x!=null)return yo([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return r==null||r.length===0?[]:yo(r)}function $re(e){var t;if(e.y!=null)return yo([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return r==null||r.length===0?[]:yo(r)}var R8=(e,t)=>{if(e!=null){var r=e.flatMap(a=>t==="xAxis"?zre(a):$re(a));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Vre=De([Lre,rn],R8),Gre=De(Qre,Vre,Hre,(e,t,r)=>wg(e,r,t)),O8=(e,t,r,a,s,i,l,o)=>{if(r!=null)return r;var d=l==="vertical"&&o==="xAxis"||l==="horizontal"&&o==="yAxis",u=d?wg(a,i,s):wg(i,s);return nre(t,u,e.allowDataOverflow)},Kre=De([Xn,B8,_8,Ire,Ure,Gre,Hr,rn],O8,{memoizeOptions:{resultEqualityCheck:Vb}}),qre=[0,1],P8=(e,t,r,a,s,i,l)=>{if(!((e==null||r==null||r.length===0)&&l===void 0)){var{dataKey:o,type:d}=e,u=Bl(t,i);if(u&&o==null){var f;return fO(0,(f=r==null?void 0:r.length)!==null&&f!==void 0?f:0)}return d==="category"?Rre(a,e,u):s==="expand"?qre:l}},pj=De([Xn,Hr,uj,Kb,Lb,rn,Kre],P8);function Wre(e){return e in mf}var L8=(e,t,r)=>{if(e!=null){var{scale:a,type:s}=e;if(a==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof a=="string"){var i="scale".concat(pk(a));return Wre(i)?i:"point"}}},KA=De([Xn,x8,rj],L8);function hj(e,t,r,a){if(!(r==null||a==null))return typeof e.scale=="function"?d6(e.scale,r,a):d6(t,r,a)}var Q8=(e,t,r)=>{var a=Aj(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto")&&vo(e))return cre(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&vo(e))return dre(e,t.tickCount,t.allowDecimals)}},xj=De([pj,zp,KA],Q8),H8=(e,t,r,a)=>{if(a!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&vo(t)&&Array.isArray(r)&&r.length>0){var s,i,l=t[0],o=(s=r[0])!==null&&s!==void 0?s:0,d=t[1],u=(i=r[r.length-1])!==null&&i!==void 0?i:0;return[Math.min(l,o),Math.max(d,u)]}return t},Yre=De([Xn,pj,xj,rn],H8),Xre=De(Kb,Xn,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,a=Array.from(yo(e.map(p=>p.value))).sort((p,x)=>p-x),s=a[0],i=a[a.length-1];if(s==null||i==null)return 1/0;var l=i-s;if(l===0)return 1/0;for(var o=0;o<a.length-1;o++){var d=a[o],u=a[o+1];if(!(d==null||u==null)){var f=u-d;r=Math.min(r,f)}}return r/l}}),z8=De(Xre,Hr,ure,kn,(e,t,r,a,s)=>s,(e,t,r,a,s)=>{if(!Ht(e))return 0;var i=t==="vertical"?a.height:a.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var l=Fc(r,e*i),o=e*i/2;return o-l-(o-l)/i*l}return 0}),Jre=(e,t,r)=>{var a=_o(e,t);return a==null||typeof a.padding!="string"?0:z8(e,"xAxis",t,r,a.padding)},Zre=(e,t,r)=>{var a=To(e,t);return a==null||typeof a.padding!="string"?0:z8(e,"yAxis",t,r,a.padding)},eae=De(_o,Jre,(e,t)=>{var r,a;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((a=s.right)!==null&&a!==void 0?a:0)+t}}),tae=De(To,Zre,(e,t)=>{var r,a;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((a=s.bottom)!==null&&a!==void 0?a:0)+t}}),rae=De([kn,eae,Bb,Sb,(e,t,r)=>r],(e,t,r,a,s)=>{var{padding:i}=a;return s?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),aae=De([kn,Hr,tae,Bb,Sb,(e,t,r)=>r],(e,t,r,a,s,i)=>{var{padding:l}=s;return i?[a.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Gp=(e,t,r,a)=>{var s;switch(t){case"xAxis":return rae(e,r,a);case"yAxis":return aae(e,r,a);case"zAxis":return(s=dj(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return d8(e);case"radiusAxis":return u8(e,r);default:return}},$8=De([Xn,Gp],Qb),nae=De([KA,Yre],yre),qb=De([Xn,KA,nae,$8],hj);De([$p,fj,rn],Dre);function V8(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Wb=(e,t)=>t,Yb=(e,t,r)=>r,sae=De(jb,Wb,Yb,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(V8)),iae=De(Eb,Wb,Yb,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(V8)),G8=(e,t)=>({width:e.width,height:t.height}),lae=(e,t)=>{var r=typeof t.width=="number"?t.width:Up;return{width:r,height:e.height}},oae=De(kn,_o,G8),cae=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},dae=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},uae=De(Eo,kn,sae,Wb,Yb,(e,t,r,a,s)=>{var i={},l;return r.forEach(o=>{var d=G8(t,o);l==null&&(l=cae(t,a,e));var u=a==="top"&&!s||a==="bottom"&&s;i[o.id]=l-Number(u)*d.height,l+=(u?-1:1)*d.height}),i}),Aae=De(jo,kn,iae,Wb,Yb,(e,t,r,a,s)=>{var i={},l;return r.forEach(o=>{var d=lae(t,o);l==null&&(l=dae(t,a,e));var u=a==="left"&&!s||a==="right"&&s;i[o.id]=l-Number(u)*d.width,l+=(u?-1:1)*d.width}),i}),fae=(e,t)=>{var r=_o(e,t);if(r!=null)return uae(e,r.orientation,r.mirror)},pae=De([kn,_o,fae,(e,t)=>t],(e,t,r,a)=>{if(t!=null){var s=r==null?void 0:r[a];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),hae=(e,t)=>{var r=To(e,t);if(r!=null)return Aae(e,r.orientation,r.mirror)},xae=De([kn,To,hae,(e,t)=>t],(e,t,r,a)=>{if(t!=null){var s=r==null?void 0:r[a];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),mae=De(kn,To,(e,t)=>{var r=typeof t.width=="number"?t.width:Up;return{width:r,height:e.height}}),K8=(e,t,r,a)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:l}=r,o=Bl(e,a),d=t.map(u=>u.value);if(l&&o&&i==="category"&&s&&WM(d))return d}},mj=De([Hr,Kb,Xn,rn],K8),q8=(e,t,r,a)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,l=Bl(e,a);if(l&&(s==="number"||i!=="auto"))return t.map(o=>o.value)}},gj=De([Hr,Kb,zp,rn],q8),f6=De([Hr,jre,KA,qb,mj,gj,Gp,xj,rn],(e,t,r,a,s,i,l,o,d)=>{if(t!=null){var u=Bl(e,d);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:d,categoricalDomain:i,duplicateDomain:s,isCategorical:u,niceTicks:o,range:l,realScaleType:r,scale:a}}}),gae=(e,t,r,a,s,i,l,o,d)=>{if(!(t==null||a==null)){var u=Bl(e,d),{type:f,ticks:p,tickCount:x}=t,m=r==="scaleBand"&&typeof a.bandwidth=="function"?a.bandwidth()/2:2,b=f==="category"&&a.bandwidth?a.bandwidth()/m:0;b=d==="angleAxis"&&i!=null&&i.length>=2?Ai(i[0]-i[1])*2*b:b;var v=p||s;return v?v.map((y,k)=>{var _=l?l.indexOf(y):y,C=a.map(_);return Ht(C)?{index:k,coordinate:C+b,value:y,offset:b}:null}).filter(ds):u&&o?o.map((y,k)=>{var _=a.map(y);return Ht(_)?{coordinate:_+b,value:y,index:k,offset:b}:null}).filter(ds):a.ticks?a.ticks(x).map((y,k)=>{var _=a.map(y);return Ht(_)?{coordinate:_+b,value:y,index:k,offset:b}:null}).filter(ds):a.domain().map((y,k)=>{var _=a.map(y);return Ht(_)?{coordinate:_+b,value:l?l[y]:y,index:k,offset:b}:null}).filter(ds)}},W8=De([Hr,zp,KA,qb,xj,Gp,mj,gj,rn],gae),bae=(e,t,r,a,s,i,l)=>{if(!(t==null||r==null||a==null||a[0]===a[1])){var o=Bl(e,l),{tickCount:d}=t,u=0;return u=l==="angleAxis"&&(a==null?void 0:a.length)>=2?Ai(a[0]-a[1])*2*u:u,o&&i?i.map((f,p)=>{var x=r.map(f);return Ht(x)?{coordinate:x+u,value:f,index:p,offset:u}:null}).filter(ds):r.ticks?r.ticks(d).map((f,p)=>{var x=r.map(f);return Ht(x)?{coordinate:x+u,value:f,index:p,offset:u}:null}).filter(ds):r.domain().map((f,p)=>{var x=r.map(f);return Ht(x)?{coordinate:x+u,value:s?s[f]:f,index:p,offset:u}:null}).filter(ds)}},Y8=De([Hr,zp,qb,Gp,mj,gj,rn],bae),X8=De(Xn,qb,(e,t)=>{if(!(e==null||t==null))return yg(yg({},e),{},{scale:t})}),vae=De([Xn,KA,pj,$8],hj);De((e,t,r)=>dj(e,r),vae,(e,t)=>{if(!(e==null||t==null))return yg(yg({},e),{},{scale:t})});var yae=De([Hr,jb,Eb],(e,t,r)=>{switch(e){case"horizontal":return t.some(a=>a.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(a=>a.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),J8=e=>e.options.defaultTooltipEventType,Z8=e=>e.options.validateTooltipEventTypes;function eP(e,t,r){if(e==null)return t;var a=e?"axis":"item";return r==null?t:r.includes(a)?a:t}function bj(e,t){var r=J8(e),a=Z8(e);return eP(t,r,a)}function wae(e){return pt(t=>bj(t,e))}var tP=(e,t)=>{var r,a=Number(t);if(!(Nl(a)||t==null))return a>=0?e==null||(r=e[a])===null||r===void 0?void 0:r.value:void 0},Nae=e=>e.tooltip.settings,mc={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Cae={itemInteraction:{click:mc,hover:mc},axisInteraction:{click:mc,hover:mc},keyboardInteraction:mc,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}},rP=ms({name:"tooltip",initialState:Cae,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Or()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:a}=t.payload,s=Pi(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=a)},prepare:Or()},removeTooltipEntrySettings:{reducer(e,t){var r=Pi(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Or()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,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.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.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.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:kae,replaceTooltipEntrySettings:jae,removeTooltipEntrySettings:Eae,setTooltipSettingsState:Sae,setActiveMouseOverItemIndex:Bae,mouseLeaveItem:dIe,mouseLeaveChart:aP,setActiveClickItemIndex:uIe,setMouseOverAxisIndex:nP,setMouseClickAxisIndex:_ae,setSyncInteraction:VN,setKeyboardInteraction:GN}=rP.actions,Tae=rP.reducer;function p6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function _x(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p6(Object(r),!0).forEach(function(a){Fae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Fae(e,t,r){return(t=Iae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Iae(e){var t=Dae(e,"string");return typeof t=="symbol"?t:t+""}function Dae(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uae(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Mae(e){return e.index!=null}var sP=(e,t,r,a)=>{if(t==null)return mc;var s=Uae(e,t,r);if(s==null)return mc;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(Mae(s)){if(i)return _x(_x({},s),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return _x(_x({},mc),{},{coordinate:s.coordinate})};function Rae(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 r=Number(e);return Number.isFinite(r)?r:void 0}function Oae(e,t){var r=Rae(e),a=t[0],s=t[1];if(r===void 0)return!1;var i=Math.min(a,s),l=Math.max(a,s);return r>=i&&r<=l}function Pae(e,t,r){if(r==null||t==null)return!0;var a=yn(e,t);return a==null||!vo(r)?!0:Oae(a,r)}var vj=(e,t,r,a)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!Ht(i))return s;var l=0,o=1/0;t.length>0&&(o=t.length-1);var d=Math.max(l,Math.min(i,o)),u=t[d];return u==null||Pae(u,r,a)?String(d):null},iP=(e,t,r,a,s,i,l)=>{if(i!=null){var o=l[0],d=o==null?void 0:o.getPosition(i);if(d!=null)return d;var u=s==null?void 0:s[Number(i)];if(u)switch(r){case"horizontal":return{x:u.coordinate,y:(a.top+t)/2};default:return{x:(a.left+e)/2,y:u.coordinate}}}},lP=(e,t,r,a)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,s==null&&a!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(l=>{var o;return((o=l.settings)===null||o===void 0?void 0:o.graphicalItemId)===s})},oP=e=>e.options.tooltipPayloadSearcher,qA=e=>e.tooltip;function h6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function x6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h6(Object(r),!0).forEach(function(a){Lae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Lae(e,t,r){return(t=Qae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qae(e){var t=Hae(e,"string");return typeof t=="symbol"?t:t+""}function Hae(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zae(e,t){return e??t}var cP=(e,t,r,a,s,i,l)=>{if(!(t==null||i==null)){var{chartData:o,computedData:d,dataStartIndex:u,dataEndIndex:f}=r,p=[];return e.reduce((x,m)=>{var b,{dataDefinedOnItem:v,settings:y}=m,k=zae(v,o),_=Array.isArray(k)?PR(k,u,f):k,C=(b=y==null?void 0:y.dataKey)!==null&&b!==void 0?b:a,E=y==null?void 0:y.nameKey,T;if(a&&Array.isArray(_)&&!Array.isArray(_[0])&&l==="axis"?T=YM(_,a,s):T=i(_,t,d,E),Array.isArray(T))T.forEach(I=>{var M=x6(x6({},y),{},{name:I.name,unit:I.unit,color:void 0,fill:void 0});x.push(mF({tooltipEntrySettings:M,dataKey:I.dataKey,payload:I.payload,value:yn(I.payload,I.dataKey),name:I.name}))});else{var B;x.push(mF({tooltipEntrySettings:y,dataKey:C,payload:T,value:yn(T,C),name:(B=yn(T,E))!==null&&B!==void 0?B:y==null?void 0:y.name}))}return x},p)}},yj=De([za,x8,rj],L8),$ae=De([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Vae=De([an,VA],m8),WA=De([$ae,za,Vae],b8,{memoizeOptions:{resultEqualityCheck:Gb}}),Gae=De([WA],e=>e.filter(cj)),Kae=De([WA],w8,{memoizeOptions:{resultEqualityCheck:Gb}}),YA=De([Kae,Bo],N8),qae=De([Gae,Bo,za],f8),wj=De([YA,za,WA],C8),dP=De([za],Aj),Wae=De([za],e=>e.allowDataOverflow),uP=De([dP,Wae],WO),Yae=De([WA],e=>e.filter(cj)),Xae=De([qae,Yae,Lb,i8],j8),Jae=De([Xae,Bo,an,uP],S8),Zae=De([WA],y8),ene=De([YA,za,Zae,fj,an],T8,{memoizeOptions:{resultEqualityCheck:Vb}}),tne=De([F8,an,VA],GA),rne=De([tne,an],U8),ane=De([I8,an,VA],GA),nne=De([ane,an],M8),sne=De([D8,an,VA],GA),ine=De([sne,an],R8),lne=De([rne,ine,nne],wg),one=De([za,dP,uP,Jae,ene,lne,Hr,an],O8),Kp=De([za,Hr,YA,wj,Lb,an,one],P8),cne=De([Kp,za,yj],Q8),dne=De([za,Kp,cne,an],H8),AP=e=>{var t=an(e),r=VA(e),a=!1;return Gp(e,t,r,a)},fP=De([za,AP],Qb),pP=De([za,yj,dne,fP],hj),une=De([Hr,wj,za,an],K8),Ane=De([Hr,wj,za,an],q8),fne=(e,t,r,a,s,i,l,o)=>{if(t){var{type:d}=t,u=Bl(e,o);if(a){var f=r==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,p=d==="category"&&a.bandwidth?a.bandwidth()/f:0;return p=o==="angleAxis"&&s!=null&&(s==null?void 0:s.length)>=2?Ai(s[0]-s[1])*2*p:p,u&&l?l.map((x,m)=>{var b=a.map(x);return Ht(b)?{coordinate:b+p,value:x,index:m,offset:p}:null}).filter(ds):a.domain().map((x,m)=>{var b=a.map(x);return Ht(b)?{coordinate:b+p,value:i?i[x]:x,index:m,offset:p}:null}).filter(ds)}}},Fo=De([Hr,za,yj,pP,AP,une,Ane,an],fne),Nj=De([J8,Z8,Nae],(e,t,r)=>eP(r.shared,e,t)),hP=e=>e.tooltip.settings.trigger,Cj=e=>e.tooltip.settings.defaultIndex,qp=De([qA,Nj,hP,Cj],sP),op=De([qp,YA,Vp,Kp],vj),xP=De([Fo,op],tP),pne=De([qp],e=>{if(e)return e.dataKey});De([qp],e=>{if(e)return e.graphicalItemId});var mP=De([qA,Nj,hP,Cj],lP),hne=De([jo,Eo,Hr,kn,Fo,Cj,mP],iP),xne=De([qp,hne],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),mne=De([qp],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),gne=De([mP,op,Bo,Vp,xP,oP,Nj],cP),bne=De([gne],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function m6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function g6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?m6(Object(r),!0).forEach(function(a){vne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function vne(e,t,r){return(t=yne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yne(e){var t=wne(e,"string");return typeof t=="symbol"?t:t+""}function wne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nne=()=>pt(za),Cne=()=>{var e=Nne(),t=pt(Fo),r=pt(pP);return Zm(!e||!r?void 0:g6(g6({},e),{},{scale:r}),t)};function b6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Vu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b6(Object(r),!0).forEach(function(a){kne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function kne(e,t,r){return(t=jne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jne(e){var t=Ene(e,"string");return typeof t=="symbol"?t:t+""}function Ene(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sne=(e,t,r,a)=>{var s=t.find(i=>i&&i.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:a.chartY};if(e==="vertical")return{x:a.chartX,y:s.coordinate}}return{x:0,y:0}},Bne=(e,t,r,a)=>{var s=t.find(u=>u&&u.index===r);if(s){if(e==="centric"){var i=s.coordinate,{radius:l}=a;return Vu(Vu(Vu({},a),gn(a.cx,a.cy,l,i)),{},{angle:i,radius:l})}var o=s.coordinate,{angle:d}=a;return Vu(Vu(Vu({},a),gn(a.cx,a.cy,o,d)),{},{angle:d,radius:o})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function _ne(e,t){var{chartX:r,chartY:a}=e;return r>=t.left&&r<=t.left+t.width&&a>=t.top&&a<=t.top+t.height}var gP=(e,t,r,a,s)=>{var i,l=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(l<=1||e==null)return 0;if(a==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var o=0;o<l;o++){var d,u,f,p,x,m=o>0?(d=r[o-1])===null||d===void 0?void 0:d.coordinate:(u=r[l-1])===null||u===void 0?void 0:u.coordinate,b=(f=r[o])===null||f===void 0?void 0:f.coordinate,v=o>=l-1?(p=r[0])===null||p===void 0?void 0:p.coordinate:(x=r[o+1])===null||x===void 0?void 0:x.coordinate,y=void 0;if(!(m==null||b==null||v==null))if(Ai(b-m)!==Ai(v-b)){var k=[];if(Ai(v-b)===Ai(s[1]-s[0])){y=v;var _=b+s[1]-s[0];k[0]=Math.min(_,(_+m)/2),k[1]=Math.max(_,(_+m)/2)}else{y=m;var C=v+s[1]-s[0];k[0]=Math.min(b,(C+b)/2),k[1]=Math.max(b,(C+b)/2)}var E=[Math.min(b,(y+b)/2),Math.max(b,(y+b)/2)];if(e>E[0]&&e<=E[1]||e>=k[0]&&e<=k[1]){var T;return(T=r[o])===null||T===void 0?void 0:T.index}}else{var B=Math.min(m,v),I=Math.max(m,v);if(e>(B+b)/2&&e<=(I+b)/2){var M;return(M=r[o])===null||M===void 0?void 0:M.index}}}else if(t)for(var U=0;U<l;U++){var D=t[U];if(D!=null){var L=t[U+1],R=t[U-1];if(U===0&&L!=null&&e<=(D.coordinate+L.coordinate)/2||U===l-1&&R!=null&&e>(D.coordinate+R.coordinate)/2||U>0&&U<l-1&&R!=null&&L!=null&&e>(D.coordinate+R.coordinate)/2&&e<=(D.coordinate+L.coordinate)/2)return D.index}}return-1},bP=()=>pt(rj),kj=(e,t)=>t,vP=(e,t,r)=>r,jj=(e,t,r,a)=>a,Tne=De(Fo,e=>xb(e,t=>t.coordinate)),Ej=De([qA,kj,vP,jj],sP),Sj=De([Ej,YA,Vp,Kp],vj),Fne=(e,t,r)=>{if(t!=null){var a=qA(e);return t==="axis"?r==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:r==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},yP=De([qA,kj,vP,jj],lP),Ng=De([jo,Eo,Hr,kn,Fo,jj,yP],iP),Ine=De([Ej,Ng],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),wP=De([Fo,Sj],tP),Dne=De([yP,Sj,Bo,Vp,wP,oP,kj],cP),Une=De([Ej,Sj],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Mne=(e,t,r,a,s,i,l)=>{if(!(!e||!r||!a||!s)&&_ne(e,l)){var o=oX(e,t),d=gP(o,i,s,r,a),u=Sne(t,s,d,e);return{activeIndex:String(d),activeCoordinate:u}}},Rne=(e,t,r,a,s,i,l)=>{if(!(!e||!a||!s||!i||!r)){var o=gZ(e,r);if(o){var d=cX(o,t),u=gP(d,l,i,a,s),f=Bne(t,i,u,o);return{activeIndex:String(u),activeCoordinate:f}}}},One=(e,t,r,a,s,i,l,o)=>{if(!(!e||!t||!a||!s||!i))return t==="horizontal"||t==="vertical"?Mne(e,t,a,s,i,l,o):Rne(e,t,r,a,s,i,l)},Pne=De(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var a=e[t];if(a!=null)return r?a.panoramaElement:a.element}}),Lne=De(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(a=>parseInt(a,10)).concat(Object.values(Gn)),r=Array.from(new Set(t));return r.sort((a,s)=>a-s)},{memoizeOptions:{resultEqualityCheck:bre}});function v6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function y6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?v6(Object(r),!0).forEach(function(a){Qne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Qne(e,t,r){return(t=Hne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hne(e){var t=zne(e,"string");return typeof t=="symbol"?t:t+""}function zne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $ne={},Vne={zIndexMap:Object.values(Gn).reduce((e,t)=>y6(y6({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),$ne)},Gne=new Set(Object.values(Gn));function Kne(e){return Gne.has(e)}var NP=ms({name:"zIndex",initialState:Vne,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Or()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!Kne(r)&&delete e.zIndexMap[r])},prepare:Or()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:a,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=a:e.zIndexMap[r].element=a:e.zIndexMap[r]={consumers:0,element:s?void 0:a,panoramaElement:s?a:void 0}},prepare:Or()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:Or()}}}),{registerZIndexPortal:qne,unregisterZIndexPortal:Wne,registerZIndexPortalElement:Yne,unregisterZIndexPortalElement:Xne}=NP.actions,Jne=NP.reducer;function Io(e){var{zIndex:t,children:r}=e,a=QX(),s=a&&t!==void 0&&t!==0,i=gs(),l=en();j.useLayoutEffect(()=>s?(l(qne({zIndex:t})),()=>{l(Wne({zIndex:t}))}):LA,[l,t,s]);var o=pt(d=>Pne(d,t,i));return s?o?IM.createPortal(r,o):null:r}function KN(){return KN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},KN.apply(null,arguments)}function w6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Tx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w6(Object(r),!0).forEach(function(a){Zne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Zne(e,t,r){return(t=ese(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ese(e){var t=tse(e,"string");return typeof t=="symbol"?t:t+""}function tse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rse(e){var{cursor:t,cursorComp:r,cursorProps:a}=e;return j.isValidElement(t)?j.cloneElement(t,a):j.createElement(r,a)}function ase(e){var t,{coordinate:r,payload:a,index:s,offset:i,tooltipAxisBandSize:l,layout:o,cursor:d,tooltipEventType:u,chartName:f}=e,p=r,x=a,m=s;if(!d||!p||f!=="ScatterChart"&&u!=="axis")return null;var b,v,y;if(f==="ScatterChart")b=p,v=BJ,y=Gn.cursorLine;else if(f==="BarChart")b=_J(o,p,i,l),v=oZ,y=Gn.cursorRectangle;else if(o==="radial"&&XM(p)){var{cx:k,cy:_,radius:C,startAngle:E,endAngle:T}=uO(p);b={cx:k,cy:_,startAngle:E,endAngle:T,innerRadius:C,outerRadius:C},v=wZ,y=Gn.cursorLine}else b={points:NZ(o,p,i)},v=Em,y=Gn.cursorLine;var B=typeof d=="object"&&"className"in d?d.className:void 0,I=Tx(Tx(Tx(Tx({stroke:"#ccc",pointerEvents:"none"},i),b),Ab(d)),{},{payload:x,payloadIndex:m,className:Fr("recharts-tooltip-cursor",B)});return j.createElement(Io,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:y},j.createElement(rse,{cursor:d,cursorComp:v,cursorProps:I}))}function nse(e){var t=Cne(),r=qR(),a=QA(),s=bP();return t==null||r==null||a==null||s==null?null:j.createElement(ase,KN({},e,{offset:r,layout:a,tooltipAxisBandSize:t,chartName:s}))}var CP=j.createContext(null),sse=()=>j.useContext(CP),r2={exports:{}},N6;function ise(){return N6||(N6=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function s(d,u,f){this.fn=d,this.context=u,this.once=f||!1}function i(d,u,f,p,x){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new s(f,p||d,x),b=r?r+u:u;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],m]:d._events[b].push(m):(d._events[b]=m,d._eventsCount++),d}function l(d,u){--d._eventsCount===0?d._events=new a:delete d._events[u]}function o(){this._events=new a,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,p;if(this._eventsCount===0)return u;for(p in f=this._events)t.call(f,p)&&u.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=r?r+u:u,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var x=0,m=p.length,b=new Array(m);x<m;x++)b[x]=p[x].fn;return b},o.prototype.listenerCount=function(u){var f=r?r+u:u,p=this._events[f];return p?p.fn?1:p.length:0},o.prototype.emit=function(u,f,p,x,m,b){var v=r?r+u:u;if(!this._events[v])return!1;var y=this._events[v],k=arguments.length,_,C;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),k){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,f),!0;case 3:return y.fn.call(y.context,f,p),!0;case 4:return y.fn.call(y.context,f,p,x),!0;case 5:return y.fn.call(y.context,f,p,x,m),!0;case 6:return y.fn.call(y.context,f,p,x,m,b),!0}for(C=1,_=new Array(k-1);C<k;C++)_[C-1]=arguments[C];y.fn.apply(y.context,_)}else{var E=y.length,T;for(C=0;C<E;C++)switch(y[C].once&&this.removeListener(u,y[C].fn,void 0,!0),k){case 1:y[C].fn.call(y[C].context);break;case 2:y[C].fn.call(y[C].context,f);break;case 3:y[C].fn.call(y[C].context,f,p);break;case 4:y[C].fn.call(y[C].context,f,p,x);break;default:if(!_)for(T=1,_=new Array(k-1);T<k;T++)_[T-1]=arguments[T];y[C].fn.apply(y[C].context,_)}}return!0},o.prototype.on=function(u,f,p){return i(this,u,f,p,!1)},o.prototype.once=function(u,f,p){return i(this,u,f,p,!0)},o.prototype.removeListener=function(u,f,p,x){var m=r?r+u:u;if(!this._events[m])return this;if(!f)return l(this,m),this;var b=this._events[m];if(b.fn)b.fn===f&&(!x||b.once)&&(!p||b.context===p)&&l(this,m);else{for(var v=0,y=[],k=b.length;v<k;v++)(b[v].fn!==f||x&&!b[v].once||p&&b[v].context!==p)&&y.push(b[v]);y.length?this._events[m]=y.length===1?y[0]:y:l(this,m)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&l(this,f)):(this._events=new a,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(r2)),r2.exports}var lse=ise();const ose=El(lse);var cp=new ose,qN="recharts.syncEvent.tooltip",C6="recharts.syncEvent.brush",cse=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Nl(r))return e[r]}},dse={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},kP=ms({name:"options",initialState:dse,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),use=kP.reducer,{createEventEmitter:Ase}=kP.actions;function fse(e){return e.tooltip.syncInteraction}var pse={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},jP=ms({name:"chartData",initialState:pse,reducers:{setChartData(e,t){if(e.chartData=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:r,endIndex:a}=t.payload;r!=null&&(e.dataStartIndex=r),a!=null&&(e.dataEndIndex=a)}}}),{setChartData:k6,setDataStartEndIndexes:hse,setComputedData:AIe}=jP.actions,xse=jP.reducer,mse=["x","y"];function j6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Gu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j6(Object(r),!0).forEach(function(a){gse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function gse(e,t,r){return(t=bse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bse(e){var t=vse(e,"string");return typeof t=="symbol"?t:t+""}function vse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yse(e,t){if(e==null)return{};var r,a,s=wse(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wse(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Nse(){var e=pt(aj),t=pt(nj),r=en(),a=pt(l8),s=pt(Fo),i=QA(),l=_b(),o=pt(d=>d.rootProps.className);j.useEffect(()=>{if(e==null)return LA;var d=(u,f,p)=>{if(t!==p&&e===u){if(a==="index"){var x;if(l&&f!==null&&f!==void 0&&(x=f.payload)!==null&&x!==void 0&&x.coordinate&&f.payload.sourceViewBox){var m=f.payload.coordinate,{x:b,y:v}=m,y=yse(m,mse),{x:k,y:_,width:C,height:E}=f.payload.sourceViewBox,T=Gu(Gu({},y),{},{x:l.x+(C?(b-k)/C:0)*l.width,y:l.y+(E?(v-_)/E:0)*l.height});r(Gu(Gu({},f),{},{payload:Gu(Gu({},f.payload),{},{coordinate:T})}))}else r(f);return}if(s!=null){var B;if(typeof a=="function"){var I={activeTooltipIndex:f.payload.index==null?void 0:Number(f.payload.index),isTooltipActive:f.payload.active,activeIndex:f.payload.index==null?void 0:Number(f.payload.index),activeLabel:f.payload.label,activeDataKey:f.payload.dataKey,activeCoordinate:f.payload.coordinate},M=a(s,I);B=s[M]}else a==="value"&&(B=s.find(W=>String(W.value)===f.payload.label));var{coordinate:U}=f.payload;if(B==null||f.payload.active===!1||U==null||l==null){r(VN({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:D,y:L}=U,R=Math.min(D,l.x+l.width),Q=Math.min(L,l.y+l.height),G={x:i==="horizontal"?B.coordinate:R,y:i==="horizontal"?Q:B.coordinate},K=VN({active:f.payload.active,coordinate:G,dataKey:f.payload.dataKey,index:String(B.index),label:f.payload.label,sourceViewBox:f.payload.sourceViewBox,graphicalItemId:f.payload.graphicalItemId});r(K)}}};return cp.on(qN,d),()=>{cp.off(qN,d)}},[o,r,t,e,a,s,i,l])}function Cse(){var e=pt(aj),t=pt(nj),r=en();j.useEffect(()=>{if(e==null)return LA;var a=(s,i,l)=>{t!==l&&e===s&&r(hse(i))};return cp.on(C6,a),()=>{cp.off(C6,a)}},[r,t,e])}function kse(){var e=en();j.useEffect(()=>{e(Ase())},[e]),Nse(),Cse()}function jse(e,t,r,a,s,i){var l=pt(m=>Fne(m,e,t)),o=pt(nj),d=pt(aj),u=pt(l8),f=pt(fse),p=f==null?void 0:f.active,x=_b();j.useEffect(()=>{if(!p&&d!=null&&o!=null){var m=VN({active:i,coordinate:r,dataKey:l,index:s,label:typeof a=="number"?String(a):a,sourceViewBox:x,graphicalItemId:void 0});cp.emit(qN,d,m,o)}},[p,r,l,s,a,o,d,u,i,x])}function E6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function S6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E6(Object(r),!0).forEach(function(a){Ese(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Ese(e,t,r){return(t=Sse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sse(e){var t=Bse(e,"string");return typeof t=="symbol"?t:t+""}function Bse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _se(e){return e.dataKey}function Tse(e,t){return j.isValidElement(e)?j.cloneElement(e,t):typeof e=="function"?j.createElement(e,t):j.createElement(oJ,t)}var B6=[],Fse={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 Bj(e){var t,r,a=zs(e,Fse),{active:s,allowEscapeViewBox:i,animationDuration:l,animationEasing:o,content:d,filterNull:u,isAnimationActive:f,offset:p,payloadUniqBy:x,position:m,reverseDirection:b,useTranslate3d:v,wrapperStyle:y,cursor:k,shared:_,trigger:C,defaultIndex:E,portal:T,axisId:B}=a,I=en(),M=typeof E=="number"?String(E):E;j.useEffect(()=>{I(Sae({shared:_,trigger:C,axisId:B,active:s,defaultIndex:M}))},[I,_,C,B,s,M]);var U=_b(),D=sO(),L=wae(_),{activeIndex:R,isActive:Q}=(t=pt(oe=>Une(oe,L,C,M)))!==null&&t!==void 0?t:{},G=pt(oe=>Dne(oe,L,C,M)),K=pt(oe=>wP(oe,L,C,M)),W=pt(oe=>Ine(oe,L,C,M)),z=G,Z=sse(),Y=(r=s??Q)!==null&&r!==void 0?r:!1,[te,O]=WW([z,Y]),P=L==="axis"?K:void 0;jse(L,C,W,P,R,Y);var q=T??Z;if(q==null||U==null||L==null)return null;var H=z??B6;Y||(H=B6),u&&H.length&&(H=yW(H.filter(oe=>oe.value!=null&&(oe.hide!==!0||a.includeHidden)),x,_se));var J=H.length>0,ae=j.createElement(hJ,{allowEscapeViewBox:i,animationDuration:l,animationEasing:o,isAnimationActive:f,active:Y,coordinate:W,hasPayload:J,offset:p,position:m,reverseDirection:b,useTranslate3d:v,viewBox:U,wrapperStyle:y,lastBoundingBox:te,innerRef:O,hasPortalFromProps:!!T},Tse(d,S6(S6({},a),{},{payload:H,label:P,active:Y,activeIndex:R,coordinate:W,accessibilityLayer:D})));return j.createElement(j.Fragment,null,IM.createPortal(ae,q),Y&&j.createElement(nse,{cursor:k,tooltipEventType:L,coordinate:W,payload:H,index:R}))}function Ise(e,t,r){return(t=Dse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dse(e){var t=Use(e,"string");return typeof t=="symbol"?t:t+""}function Use(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Mse{constructor(t){Ise(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var a=this.cache.keys().next().value;a!=null&&this.cache.delete(a)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function _6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Rse(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_6(Object(r),!0).forEach(function(a){Ose(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Ose(e,t,r){return(t=Pse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pse(e){var t=Lse(e,"string");return typeof t=="symbol"?t:t+""}function Lse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qse={cacheSize:2e3,enableCache:!0},EP=Rse({},Qse),T6=new Mse(EP.cacheSize),Hse={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},F6="recharts_measurement_span";function zse(e,t){var r=t.fontSize||"",a=t.fontFamily||"",s=t.fontWeight||"",i=t.fontStyle||"",l=t.letterSpacing||"",o=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(a,"|").concat(s,"|").concat(i,"|").concat(l,"|").concat(o)}var I6=(e,t)=>{try{var r=document.getElementById(F6);r||(r=document.createElement("span"),r.setAttribute("id",F6),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,Hse,t),r.textContent="".concat(e);var a=r.getBoundingClientRect();return{width:a.width,height:a.height}}catch{return{width:0,height:0}}},_f=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Op.isSsr)return{width:0,height:0};if(!EP.enableCache)return I6(t,r);var a=zse(t,r),s=T6.get(a);if(s)return s;var i=I6(t,r);return T6.set(a,i),i},SP;function $se(e,t,r){return(t=Vse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vse(e){var t=Gse(e,"string");return typeof t=="symbol"?t:t+""}function Gse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var D6=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,U6=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Kse=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,qse=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Wse={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Yse=["cm","mm","pt","pc","in","Q","px"];function Xse(e){return Yse.includes(e)}var dA="NaN";function Jse(e,t){return e*Wse[t]}class pn{static parse(t){var r,[,a,s]=(r=qse.exec(t))!==null&&r!==void 0?r:[];return a==null?pn.NaN:new pn(parseFloat(a),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Nl(t)&&(this.unit=""),r!==""&&!Kse.test(r)&&(this.num=NaN,this.unit=""),Xse(r)&&(this.num=Jse(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new pn(NaN,""):new pn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new pn(NaN,""):new pn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new pn(NaN,""):new pn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new pn(NaN,""):new pn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Nl(this.num)}}SP=pn;$se(pn,"NaN",new SP(NaN,""));function BP(e){if(e==null||e.includes(dA))return dA;for(var t=e;t.includes("*")||t.includes("/");){var r,[,a,s,i]=(r=D6.exec(t))!==null&&r!==void 0?r:[],l=pn.parse(a??""),o=pn.parse(i??""),d=s==="*"?l.multiply(o):l.divide(o);if(d.isNaN())return dA;t=t.replace(D6,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,f,p,x]=(u=U6.exec(t))!==null&&u!==void 0?u:[],m=pn.parse(f??""),b=pn.parse(x??""),v=p==="+"?m.add(b):m.subtract(b);if(v.isNaN())return dA;t=t.replace(U6,v.toString())}return t}var M6=/\(([^()]*)\)/;function Zse(e){for(var t=e,r;(r=M6.exec(t))!=null;){var[,a]=r;t=t.replace(M6,BP(a))}return t}function eie(e){var t=e.replace(/\s+/g,"");return t=Zse(t),t=BP(t),t}function tie(e){try{return eie(e)}catch{return dA}}function a2(e){var t=tie(e.slice(5,-1));return t===dA?"":t}var rie=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],aie=["dx","dy","angle","className","breakAll"];function WN(){return WN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},WN.apply(null,arguments)}function R6(e,t){if(e==null)return{};var r,a,s=nie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function nie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var _P=/[ \f\n\r\t\v\u2028\u2029]+/,TP=e=>{var{children:t,breakAll:r,style:a}=e;try{var s=[];Rn(t)||(r?s=t.toString().split(""):s=t.toString().split(_P));var i=s.map(o=>({word:o,width:_f(o,a).width})),l=r?0:_f(" ",a).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch{return null}};function sie(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var FP=(e,t,r,a)=>e.reduce((s,i)=>{var{word:l,width:o}=i,d=s[s.length-1];if(d&&o!=null&&(t==null||a||d.width+o+r<Number(t)))d.words.push(l),d.width+=o+r;else{var u={words:[l],width:o};s.push(u)}return s},[]),IP=e=>e.reduce((t,r)=>t.width>r.width?t:r),iie="…",O6=(e,t,r,a,s,i,l,o)=>{var d=e.slice(0,t),u=TP({breakAll:r,style:a,children:d+iie});if(!u)return[!1,[]];var f=FP(u.wordsWithComputedWidth,i,l,o),p=f.length>s||IP(f).width>Number(i);return[p,f]},lie=(e,t,r,a,s)=>{var{maxLines:i,children:l,style:o,breakAll:d}=e,u=ct(i),f=String(l),p=FP(t,a,r,s);if(!u||s)return p;var x=p.length>i||IP(p).width>Number(a);if(!x)return p;for(var m=0,b=f.length-1,v=0,y;m<=b&&v<=f.length-1;){var k=Math.floor((m+b)/2),_=k-1,[C,E]=O6(f,_,d,o,i,a,r,s),[T]=O6(f,k,d,o,i,a,r,s);if(!C&&!T&&(m=k+1),C&&T&&(b=k-1),!C&&T){y=E;break}v++}return y||p},P6=e=>{var t=Rn(e)?[]:e.toString().split(_P);return[{words:t,width:void 0}]},oie=e=>{var{width:t,scaleToFit:r,children:a,style:s,breakAll:i,maxLines:l}=e;if((t||r)&&!Op.isSsr){var o,d,u=TP({breakAll:i,children:a,style:s});if(u){var{wordsWithComputedWidth:f,spaceWidth:p}=u;o=f,d=p}else return P6(a);return lie({breakAll:i,children:a,maxLines:l,style:s},o,d,t,!!r)}return P6(a)},DP="#808080",cie={angle:0,breakAll:!1,capHeight:"0.71em",fill:DP,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},_j=j.forwardRef((e,t)=>{var r=zs(e,cie),{x:a,y:s,lineHeight:i,capHeight:l,fill:o,scaleToFit:d,textAnchor:u,verticalAnchor:f}=r,p=R6(r,rie),x=j.useMemo(()=>oie({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:d,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,d,p.style,p.width]),{dx:m,dy:b,angle:v,className:y,breakAll:k}=p,_=R6(p,aie);if(!Cl(a)||!Cl(s)||x.length===0)return null;var C=Number(a)+(ct(m)?m:0),E=Number(s)+(ct(b)?b:0);if(!Ht(C)||!Ht(E))return null;var T;switch(f){case"start":T=a2("calc(".concat(l,")"));break;case"middle":T=a2("calc(".concat((x.length-1)/2," * -").concat(i," + (").concat(l," / 2))"));break;default:T=a2("calc(".concat(x.length-1," * -").concat(i,")"));break}var B=[],I=x[0];if(d&&I!=null){var M=I.width,{width:U}=p;B.push("scale(".concat(ct(U)&&ct(M)?U/M:1,")"))}return v&&B.push("rotate(".concat(v,", ").concat(C,", ").concat(E,")")),B.length&&(_.transform=B.join(" ")),j.createElement("text",WN({},bi(_),{ref:t,x:C,y:E,className:Fr("recharts-text",y),textAnchor:u,fill:o.includes("url")?DP:o}),x.map((D,L)=>{var R=D.words.join(k?"":" ");return j.createElement("tspan",{x:C,dy:L===0?T:i,key:"".concat(R,"-").concat(L)},R)}))});_j.displayName="Text";function L6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ol(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L6(Object(r),!0).forEach(function(a){die(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function die(e,t,r){return(t=uie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uie(e){var t=Aie(e,"string");return typeof t=="symbol"?t:t+""}function Aie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fie=e=>{var{viewBox:t,position:r,offset:a=0,parentViewBox:s}=e,{x:i,y:l,height:o,upperWidth:d,lowerWidth:u}=Ek(t),f=i,p=i+(d-u)/2,x=(f+p)/2,m=(d+u)/2,b=f+d/2,v=o>=0?1:-1,y=v*a,k=v>0?"end":"start",_=v>0?"start":"end",C=d>=0?1:-1,E=C*a,T=C>0?"end":"start",B=C>0?"start":"end",I=s;if(r==="top"){var M={x:f+d/2,y:l-y,horizontalAnchor:"middle",verticalAnchor:k};return I&&(M.height=Math.max(l-I.y,0),M.width=d),M}if(r==="bottom"){var U={x:p+u/2,y:l+o+y,horizontalAnchor:"middle",verticalAnchor:_};return I&&(U.height=Math.max(I.y+I.height-(l+o),0),U.width=u),U}if(r==="left"){var D={x:x-E,y:l+o/2,horizontalAnchor:T,verticalAnchor:"middle"};return I&&(D.width=Math.max(D.x-I.x,0),D.height=o),D}if(r==="right"){var L={x:x+m+E,y:l+o/2,horizontalAnchor:B,verticalAnchor:"middle"};return I&&(L.width=Math.max(I.x+I.width-L.x,0),L.height=o),L}var R=I?{width:m,height:o}:{};return r==="insideLeft"?ol({x:x+E,y:l+o/2,horizontalAnchor:B,verticalAnchor:"middle"},R):r==="insideRight"?ol({x:x+m-E,y:l+o/2,horizontalAnchor:T,verticalAnchor:"middle"},R):r==="insideTop"?ol({x:f+d/2,y:l+y,horizontalAnchor:"middle",verticalAnchor:_},R):r==="insideBottom"?ol({x:p+u/2,y:l+o-y,horizontalAnchor:"middle",verticalAnchor:k},R):r==="insideTopLeft"?ol({x:f+E,y:l+y,horizontalAnchor:B,verticalAnchor:_},R):r==="insideTopRight"?ol({x:f+d-E,y:l+y,horizontalAnchor:T,verticalAnchor:_},R):r==="insideBottomLeft"?ol({x:p+E,y:l+o-y,horizontalAnchor:B,verticalAnchor:k},R):r==="insideBottomRight"?ol({x:p+u-E,y:l+o-y,horizontalAnchor:T,verticalAnchor:k},R):r&&typeof r=="object"&&(ct(r.x)||Pd(r.x))&&(ct(r.y)||Pd(r.y))?ol({x:i+Fc(r.x,m),y:l+Fc(r.y,o),horizontalAnchor:"end",verticalAnchor:"end"},R):ol({x:b,y:l+o/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},pie=["labelRef"],hie=["content"];function Q6(e,t){if(e==null)return{};var r,a,s=xie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function xie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function H6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function gf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?H6(Object(r),!0).forEach(function(a){mie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function mie(e,t,r){return(t=gie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gie(e){var t=bie(e,"string");return typeof t=="symbol"?t:t+""}function bie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ao(){return ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ao.apply(null,arguments)}var UP=j.createContext(null),vie=e=>{var{x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l,children:o}=e,d=j.useMemo(()=>({x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l}),[t,r,a,s,i,l]);return j.createElement(UP.Provider,{value:d},o)},MP=()=>{var e=j.useContext(UP),t=_b();return e||(t?Ek(t):void 0)},yie=j.createContext(null),wie=()=>{var e=j.useContext(yie),t=pt(A8);return e||t},Nie=e=>{var{value:t,formatter:r}=e,a=Rn(e.children)?t:e.children;return typeof r=="function"?r(a):a},Tj=e=>e!=null&&typeof e=="function",Cie=(e,t)=>{var r=Ai(t-e),a=Math.min(Math.abs(t-e),360);return r*a},kie=(e,t,r,a,s)=>{var{offset:i,className:l}=e,{cx:o,cy:d,innerRadius:u,outerRadius:f,startAngle:p,endAngle:x,clockWise:m}=s,b=(u+f)/2,v=Cie(p,x),y=v>=0?1:-1,k,_;switch(t){case"insideStart":k=p+y*i,_=m;break;case"insideEnd":k=x-y*i,_=!m;break;case"end":k=x+y*i,_=m;break;default:throw new Error("Unsupported position ".concat(t))}_=v<=0?_:!_;var C=gn(o,d,b,k),E=gn(o,d,b,k+(_?1:-1)*359),T="M".concat(C.x,",").concat(C.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(_?0:1,`,
    `).concat(E.x,",").concat(E.y),B=Rn(e.id)?Wf("recharts-radial-line-"):e.id;return j.createElement("text",ao({},a,{dominantBaseline:"central",className:Fr("recharts-radial-bar-label",l)}),j.createElement("defs",null,j.createElement("path",{id:B,d:T})),j.createElement("textPath",{xlinkHref:"#".concat(B)},r))},jie=(e,t,r)=>{var{cx:a,cy:s,innerRadius:i,outerRadius:l,startAngle:o,endAngle:d}=e,u=(o+d)/2;if(r==="outside"){var{x:f,y:p}=gn(a,s,l+t,u);return{x:f,y:p,textAnchor:f>=a?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var x=(i+l)/2,{x:m,y:b}=gn(a,s,x,u);return{x:m,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Bm=e=>e!=null&&"cx"in e&&ct(e.cx),Eie={angle:0,offset:5,zIndex:Gn.label,position:"middle",textBreakAll:!1};function Sie(e){if(!Bm(e))return e;var{cx:t,cy:r,outerRadius:a}=e,s=a*2;return{x:t-a,y:r-a,width:s,upperWidth:s,lowerWidth:s,height:s}}function hc(e){var t=zs(e,Eie),{viewBox:r,parentViewBox:a,position:s,value:i,children:l,content:o,className:d="",textBreakAll:u,labelRef:f}=t,p=wie(),x=MP(),m=s==="center"?x:p??x,b,v,y;r==null?b=m:Bm(r)?b=r:b=Ek(r);var k=Sie(b);if(!b||Rn(i)&&Rn(l)&&!j.isValidElement(o)&&typeof o!="function")return null;var _=gf(gf({},t),{},{viewBox:b});if(j.isValidElement(o)){var{labelRef:C}=_,E=Q6(_,pie);return j.cloneElement(o,E)}if(typeof o=="function"){var{content:T}=_,B=Q6(_,hie);if(v=j.createElement(o,B),j.isValidElement(v))return v}else v=Nie(t);var I=bi(t);if(Bm(b)){if(s==="insideStart"||s==="insideEnd"||s==="end")return kie(t,s,v,I,b);y=jie(b,t.offset,t.position)}else{if(!k)return null;var M=fie({viewBox:k,position:s,offset:t.offset,parentViewBox:Bm(a)?void 0:a});y=gf(gf({x:M.x,y:M.y,textAnchor:M.horizontalAnchor,verticalAnchor:M.verticalAnchor},M.width!==void 0?{width:M.width}:{}),M.height!==void 0?{height:M.height}:{})}return j.createElement(Io,{zIndex:t.zIndex},j.createElement(_j,ao({ref:f,className:Fr("recharts-label",d)},I,y,{textAnchor:sie(I.textAnchor)?I.textAnchor:y.textAnchor,breakAll:u}),v))}hc.displayName="Label";var Bie=(e,t,r)=>{if(!e)return null;var a={viewBox:t,labelRef:r};return e===!0?j.createElement(hc,ao({key:"label-implicit"},a)):Cl(e)?j.createElement(hc,ao({key:"label-implicit",value:e},a)):j.isValidElement(e)?e.type===hc?j.cloneElement(e,gf({key:"label-implicit"},a)):j.createElement(hc,ao({key:"label-implicit",content:e},a)):Tj(e)?j.createElement(hc,ao({key:"label-implicit",content:e},a)):e&&typeof e=="object"?j.createElement(hc,ao({},e,{key:"label-implicit"},a)):null};function _ie(e){var{label:t,labelRef:r}=e,a=MP();return Bie(t,a,r)||null}var n2={},s2={},z6;function Tie(){return z6||(z6=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(s2)),s2}var i2={},$6;function Fie(){return $6||($6=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(i2)),i2}var V6;function Iie(){return V6||(V6=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tie(),r=Fie(),a=xk();function s(i){if(a.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(n2)),n2}var l2,G6;function Die(){return G6||(G6=1,l2=Iie().last),l2}var Uie=Die();const Mie=El(Uie);var Rie=["valueAccessor"],Oie=["dataKey","clockWise","id","textBreakAll","zIndex"];function Cg(){return Cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Cg.apply(null,arguments)}function K6(e,t){if(e==null)return{};var r,a,s=Pie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Pie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var Lie=e=>Array.isArray(e.value)?Mie(e.value):e.value,RP=j.createContext(void 0),Qie=RP.Provider,OP=j.createContext(void 0);OP.Provider;function Hie(){return j.useContext(RP)}function zie(){return j.useContext(OP)}function _m(e){var{valueAccessor:t=Lie}=e,r=K6(e,Rie),{dataKey:a,clockWise:s,id:i,textBreakAll:l,zIndex:o}=r,d=K6(r,Oie),u=Hie(),f=zie(),p=u||f;return!p||!p.length?null:j.createElement(Io,{zIndex:o??Gn.label},j.createElement(wl,{className:"recharts-label-list"},p.map((x,m)=>{var b,v=Rn(a)?t(x,m):yn(x.payload,a),y=Rn(i)?{}:{id:"".concat(i,"-").concat(m)};return j.createElement(hc,Cg({key:"label-".concat(m)},bi(x),d,y,{fill:(b=r.fill)!==null&&b!==void 0?b:x.fill,parentViewBox:x.parentViewBox,value:v,textBreakAll:l,viewBox:x.viewBox,index:m,zIndex:0}))})))}_m.displayName="LabelList";function $ie(e){var{label:t}=e;return t?t===!0?j.createElement(_m,{key:"labelList-implicit"}):j.isValidElement(t)||Tj(t)?j.createElement(_m,{key:"labelList-implicit",content:t}):typeof t=="object"?j.createElement(_m,Cg({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function YN(){return YN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},YN.apply(null,arguments)}var PP=e=>{var{cx:t,cy:r,r:a,className:s}=e,i=Fr("recharts-dot",s);return ct(t)&&ct(r)&&ct(a)?j.createElement("circle",YN({},Ki(e),hk(e),{className:i,cx:t,cy:r,r:a})):null},Vie={radiusAxis:{},angleAxis:{}},LP=ms({name:"polarAxis",initialState:Vie,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:fIe,removeRadiusAxis:pIe,addAngleAxis:hIe,removeAngleAxis:xIe}=LP.actions,Gie=LP.reducer;function Kie(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var QP=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function qie(e){var{tooltipEntrySettings:t}=e,r=en(),a=gs(),s=j.useRef(null);return j.useLayoutEffect(()=>{a||(s.current===null?r(kae(t)):s.current!==t&&r(jae({prev:s.current,next:t})),s.current=t)},[t,r,a]),j.useLayoutEffect(()=>()=>{s.current&&(r(Eae(s.current)),s.current=null)},[r]),null}function Wie(e){var{legendPayload:t}=e,r=en(),a=gs(),s=j.useRef(null);return j.useLayoutEffect(()=>{a||(s.current===null?r(eJ(t)):s.current!==t&&r(tJ({prev:s.current,next:t})),s.current=t)},[r,a,t]),j.useLayoutEffect(()=>()=>{s.current&&(r(rJ(s.current)),s.current=null)},[r]),null}var o2,Yie=()=>{var[e]=j.useState(()=>Wf("uid-"));return e},Xie=(o2=R7.useId)!==null&&o2!==void 0?o2:Yie;function Jie(e,t){var r=Xie();return t||(e?"".concat(e,"-").concat(r):r)}var Zie=j.createContext(void 0),ele=e=>{var{id:t,type:r,children:a}=e,s=Jie("recharts-".concat(r),t);return j.createElement(Zie.Provider,{value:s},a(s))},tle={cartesianItems:[],polarItems:[]},HP=ms({name:"graphicalItems",initialState:tle,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Or()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:a}=t.payload,s=Pi(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=a)},prepare:Or()},removeCartesianGraphicalItem:{reducer(e,t){var r=Pi(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Or()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Or()},removePolarGraphicalItem:{reducer(e,t){var r=Pi(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Or()}}}),{addCartesianGraphicalItem:rle,replaceCartesianGraphicalItem:ale,removeCartesianGraphicalItem:nle,addPolarGraphicalItem:mIe,removePolarGraphicalItem:gIe}=HP.actions,sle=HP.reducer,ile=e=>{var t=en(),r=j.useRef(null);return j.useLayoutEffect(()=>{r.current===null?t(rle(e)):r.current!==e&&t(ale({prev:r.current,next:e})),r.current=e},[t,e]),j.useLayoutEffect(()=>()=>{r.current&&(t(nle(r.current)),r.current=null)},[t]),null},lle=j.memo(ile),ole=["points"];function q6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function c2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q6(Object(r),!0).forEach(function(a){cle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function cle(e,t,r){return(t=dle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dle(e){var t=ule(e,"string");return typeof t=="symbol"?t:t+""}function ule(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kg(){return kg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},kg.apply(null,arguments)}function Ale(e,t){if(e==null)return{};var r,a,s=fle(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fle(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function ple(e){var{option:t,dotProps:r,className:a}=e;if(j.isValidElement(t))return j.cloneElement(t,r);if(typeof t=="function")return t(r);var s=Fr(a,typeof t!="boolean"?t.className:""),i=r??{},{points:l}=i,o=Ale(i,ole);return j.createElement(PP,kg({},o,{className:s}))}function hle(e,t){return e==null?!1:t?!0:e.length===1}function xle(e){var{points:t,dot:r,className:a,dotClassName:s,dataKey:i,baseProps:l,needClip:o,clipPathId:d,zIndex:u=Gn.scatter}=e;if(!hle(t,r))return null;var f=QP(r),p=pq(r),x=t.map((b,v)=>{var y,k,_=c2(c2(c2({r:3},l),p),{},{index:v,cx:(y=b.x)!==null&&y!==void 0?y:void 0,cy:(k=b.y)!==null&&k!==void 0?k:void 0,dataKey:i,value:b.value,payload:b.payload,points:t});return j.createElement(ple,{key:"dot-".concat(v),option:r,dotProps:_,className:s})}),m={};return o&&d!=null&&(m.clipPath="url(#clipPath-".concat(f?"":"dots-").concat(d,")")),j.createElement(Io,{zIndex:u},j.createElement(wl,kg({className:a},m),x))}function W6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Y6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W6(Object(r),!0).forEach(function(a){mle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function mle(e,t,r){return(t=gle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gle(e){var t=ble(e,"string");return typeof t=="symbol"?t:t+""}function ble(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zP=0,vle={xAxis:{},yAxis:{},zAxis:{}},$P=ms({name:"cartesianAxis",initialState:vle,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Or()},replaceXAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.xAxis[r.id],e.xAxis[a.id]=a)},prepare:Or()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Or()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Or()},replaceYAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.yAxis[r.id],e.yAxis[a.id]=a)},prepare:Or()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Or()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Or()},replaceZAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.zAxis[r.id],e.zAxis[a.id]=a)},prepare:Or()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Or()},updateYAxisWidth(e,t){var{id:r,width:a}=t.payload,s=e.yAxis[r];if(s){var i,l=s.widthHistory||[];if(l.length===3&&l[0]===l[2]&&a===l[1]&&a!==s.width&&Math.abs(a-((i=l[0])!==null&&i!==void 0?i:0))<=1)return;var o=[...l,a].slice(-3);e.yAxis[r]=Y6(Y6({},s),{},{width:a,widthHistory:o})}}}}),{addXAxis:yle,replaceXAxis:wle,removeXAxis:Nle,addYAxis:Cle,replaceYAxis:kle,removeYAxis:jle,addZAxis:bIe,replaceZAxis:vIe,removeZAxis:yIe,updateYAxisWidth:Ele}=$P.actions,Sle=$P.reducer,Ble=De([kn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),_le=De([Ble,jo,Eo],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Fj=()=>pt(_le),Tle=()=>pt(bne);function X6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function d2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X6(Object(r),!0).forEach(function(a){Fle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Fle(e,t,r){return(t=Ile(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ile(e){var t=Dle(e,"string");return typeof t=="symbol"?t:t+""}function Dle(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ule=e=>{var{point:t,childIndex:r,mainColor:a,activeDot:s,dataKey:i,clipPath:l}=e;if(s===!1||t.x==null||t.y==null)return null;var o={index:r,dataKey:i,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=d2(d2(d2({},o),Ab(s)),hk(s)),u;return j.isValidElement(s)?u=j.cloneElement(s,d):typeof s=="function"?u=s(d):u=j.createElement(PP,d),j.createElement(wl,{className:"recharts-active-dot",clipPath:l},u)};function J6(e){var{points:t,mainColor:r,activeDot:a,itemDataKey:s,clipPath:i,zIndex:l=Gn.activeDot}=e,o=pt(op),d=Tle();if(t==null||d==null)return null;var u=t.find(f=>d.includes(f.payload));return Rn(u)?null:j.createElement(Io,{zIndex:l},j.createElement(Ule,{point:u,childIndex:Number(o),mainColor:r,dataKey:s,activeDot:a,clipPath:i}))}var Mle=e=>{var{chartData:t}=e,r=en(),a=gs();return j.useEffect(()=>a?()=>{}:(r(k6(t)),()=>{r(k6(void 0))}),[t,r,a]),null},Z6={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},VP=ms({name:"brush",initialState:Z6,reducers:{setBrushSettings(e,t){return t.payload==null?Z6:t.payload}}}),{setBrushSettings:wIe}=VP.actions,Rle=VP.reducer;function Ole(e){return(e%180+180)%180}var Ple=function(t){var{width:r,height:a}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Ole(s),l=i*Math.PI/180,o=Math.atan(a/r),d=l>o&&l<Math.PI-o?a/Math.sin(l):r/Math.cos(l);return Math.abs(d)},Lle={dots:[],areas:[],lines:[]},GP=ms({name:"referenceElements",initialState:Lle,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Pi(e).dots.findIndex(a=>a===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Pi(e).areas.findIndex(a=>a===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Pi(e).lines.findIndex(a=>a===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:NIe,removeDot:CIe,addArea:kIe,removeArea:jIe,addLine:EIe,removeLine:SIe}=GP.actions,Qle=GP.reducer,Hle=j.createContext(void 0),zle=e=>{var{children:t}=e,[r]=j.useState("".concat(Wf("recharts"),"-clip")),a=Fj();if(a==null)return null;var{x:s,y:i,width:l,height:o}=a;return j.createElement(Hle.Provider,{value:r},j.createElement("defs",null,j.createElement("clipPath",{id:r},j.createElement("rect",{x:s,y:i,height:o,width:l}))),t)};function KP(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],a=0;a<e.length;a+=t){var s=e[a];s!==void 0&&r.push(s)}return r}function $le(e,t,r){var a={width:e.width+t.width,height:e.height+t.height};return Ple(a,r)}function Vle(e,t,r){var a=r==="width",{x:s,y:i,width:l,height:o}=e;return t===1?{start:a?s:i,end:a?s+l:i+o}:{start:a?s+l:i+o,end:a?s:i}}function dp(e,t,r,a,s){if(e*t<e*a||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-a)>=0&&e*(t+e*i/2-s)<=0}function Gle(e,t){return KP(e,t+1)}function Kle(e,t,r,a,s){for(var i=(a||[]).slice(),{start:l,end:o}=t,d=0,u=1,f=l,p=function(){var b=a==null?void 0:a[d];if(b===void 0)return{v:KP(a,u)};var v=d,y,k=()=>(y===void 0&&(y=r(b,v)),y),_=b.coordinate,C=d===0||dp(e,_,k,f,o);C||(d=0,f=l,u+=1),C&&(f=_+e*(k()/2+s),d+=u)},x;u<=i.length;)if(x=p(),x)return x.v;return[]}function qle(e,t,r,a,s){var i=(a||[]).slice(),l=i.length;if(l===0)return[];for(var{start:o,end:d}=t,u=1;u<=l;u++){for(var f=(l-1)%u,p=o,x=!0,m=function(){var E=a[v];if(E==null)return 0;var T=v,B,I=()=>(B===void 0&&(B=r(E,T)),B),M=E.coordinate,U=v===f||dp(e,M,I,p,d);if(!U)return x=!1,1;U&&(p=M+e*(I()/2+s))},b,v=f;v<l&&(b=m(),!(b!==0&&b===1));v+=u);if(x){for(var y=[],k=f;k<l;k+=u){var _=a[k];_!=null&&y.push(_)}return y}}return[]}function e5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(r),!0).forEach(function(a){Wle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Wle(e,t,r){return(t=Yle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yle(e){var t=Xle(e,"string");return typeof t=="symbol"?t:t+""}function Xle(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jle(e,t,r,a,s){for(var i=(a||[]).slice(),l=i.length,{start:o}=t,{end:d}=t,u=function(x){var m=i[x];if(m==null)return 1;var b=m,v,y=()=>(v===void 0&&(v=r(m,x)),v);if(x===l-1){var k=e*(b.coordinate+e*y()/2-d);i[x]=b=Bn(Bn({},b),{},{tickCoord:k>0?b.coordinate-k*e:b.coordinate})}else i[x]=b=Bn(Bn({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var _=dp(e,b.tickCoord,y,o,d);_&&(d=b.tickCoord-e*(y()/2+s),i[x]=Bn(Bn({},b),{},{isShow:!0}))}},f=l-1;f>=0;f--)u(f);return i}function Zle(e,t,r,a,s,i){var l=(a||[]).slice(),o=l.length,{start:d,end:u}=t;if(i){var f=a[o-1];if(f!=null){var p=r(f,o-1),x=e*(f.coordinate+e*p/2-u);if(l[o-1]=f=Bn(Bn({},f),{},{tickCoord:x>0?f.coordinate-x*e:f.coordinate}),f.tickCoord!=null){var m=dp(e,f.tickCoord,()=>p,d,u);m&&(u=f.tickCoord-e*(p/2+s),l[o-1]=Bn(Bn({},f),{},{isShow:!0}))}}}for(var b=i?o-1:o,v=function(_){var C=l[_];if(C==null)return 1;var E=C,T,B=()=>(T===void 0&&(T=r(C,_)),T);if(_===0){var I=e*(E.coordinate-e*B()/2-d);l[_]=E=Bn(Bn({},E),{},{tickCoord:I<0?E.coordinate-I*e:E.coordinate})}else l[_]=E=Bn(Bn({},E),{},{tickCoord:E.coordinate});if(E.tickCoord!=null){var M=dp(e,E.tickCoord,B,d,u);M&&(d=E.tickCoord+e*(B()/2+s),l[_]=Bn(Bn({},E),{},{isShow:!0}))}},y=0;y<b;y++)v(y);return l}function Ij(e,t,r){var{tick:a,ticks:s,viewBox:i,minTickGap:l,orientation:o,interval:d,tickFormatter:u,unit:f,angle:p}=e;if(!s||!s.length||!a)return[];if(ct(d)||Op.isSsr){var x;return(x=Gle(s,ct(d)?d:0))!==null&&x!==void 0?x:[]}var m=[],b=o==="top"||o==="bottom"?"width":"height",v=f&&b==="width"?_f(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(T,B)=>{var I=typeof u=="function"?u(T.value,B):T.value;return b==="width"?$le(_f(I,{fontSize:t,letterSpacing:r}),v,p):_f(I,{fontSize:t,letterSpacing:r})[b]},k=s[0],_=s[1],C=s.length>=2&&k!=null&&_!=null?Ai(_.coordinate-k.coordinate):1,E=Vle(i,C,b);return d==="equidistantPreserveStart"?Kle(C,E,y,s,l):d==="equidistantPreserveEnd"?qle(C,E,y,s,l):(d==="preserveStart"||d==="preserveStartEnd"?m=Zle(C,E,y,s,l,d==="preserveStartEnd"):m=Jle(C,E,y,s,l),m.filter(T=>T.isShow))}var eoe=e=>{var{ticks:t,label:r,labelGapWithTick:a=5,tickSize:s=0,tickMargin:i=0}=e,l=0;if(t){Array.from(t).forEach(f=>{if(f){var p=f.getBoundingClientRect();p.width>l&&(l=p.width)}});var o=r?r.getBoundingClientRect().width:0,d=s+i,u=l+d+o+(r?a:0);return Math.round(u)}return 0},toe=["axisLine","width","height","className","hide","ticks","axisType"];function roe(e,t){if(e==null)return{};var r,a,s=aoe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function aoe(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},$d.apply(null,arguments)}function t5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t5(Object(r),!0).forEach(function(a){noe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function noe(e,t,r){return(t=soe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function soe(e){var t=ioe(e,"string");return typeof t=="symbol"?t:t+""}function ioe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oo={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:Gn.axis};function loe(e){var{x:t,y:r,width:a,height:s,orientation:i,mirror:l,axisLine:o,otherSvgProps:d}=e;if(!o)return null;var u=ta(ta(ta({},d),Ki(o)),{},{fill:"none"});if(i==="top"||i==="bottom"){var f=+(i==="top"&&!l||i==="bottom"&&l);u=ta(ta({},u),{},{x1:t,y1:r+f*s,x2:t+a,y2:r+f*s})}else{var p=+(i==="left"&&!l||i==="right"&&l);u=ta(ta({},u),{},{x1:t+p*a,y1:r,x2:t+p*a,y2:r+s})}return j.createElement("line",$d({},u,{className:Fr("recharts-cartesian-axis-line",hb(o,"className"))}))}function ooe(e,t,r,a,s,i,l,o,d){var u,f,p,x,m,b,v=o?-1:1,y=e.tickSize||l,k=ct(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":u=f=e.coordinate,x=r+ +!o*s,p=x-v*y,b=p-v*d,m=k;break;case"left":p=x=e.coordinate,f=t+ +!o*a,u=f-v*y,m=u-v*d,b=k;break;case"right":p=x=e.coordinate,f=t+ +o*a,u=f+v*y,m=u+v*d,b=k;break;default:u=f=e.coordinate,x=r+ +o*s,p=x+v*y,b=p+v*d,m=k;break}return{line:{x1:u,y1:p,x2:f,y2:x},tick:{x:m,y:b}}}function coe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function doe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function uoe(e){var{option:t,tickProps:r,value:a}=e,s,i=Fr(r.className,"recharts-cartesian-axis-tick-value");if(j.isValidElement(t))s=j.cloneElement(t,ta(ta({},r),{},{className:i}));else if(typeof t=="function")s=t(ta(ta({},r),{},{className:i}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=Fr(l,Kie(t))),s=j.createElement(_j,$d({},r,{className:l}),a)}return s}var Aoe=j.forwardRef((e,t)=>{var{ticks:r=[],tick:a,tickLine:s,stroke:i,tickFormatter:l,unit:o,padding:d,tickTextProps:u,orientation:f,mirror:p,x,y:m,width:b,height:v,tickSize:y,tickMargin:k,fontSize:_,letterSpacing:C,getTicksConfig:E,events:T,axisType:B}=e,I=Ij(ta(ta({},E),{},{ticks:r}),_,C),M=coe(f,p),U=doe(f,p),D=Ki(E),L=Ab(a),R={};typeof s=="object"&&(R=s);var Q=ta(ta({},D),{},{fill:"none"},R),G=I.map(z=>ta({entry:z},ooe(z,x,m,b,v,f,y,p,k))),K=G.map(z=>{var{entry:Z,line:Y}=z;return j.createElement(wl,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Z.value,"-").concat(Z.coordinate,"-").concat(Z.tickCoord)},s&&j.createElement("line",$d({},Q,Y,{className:Fr("recharts-cartesian-axis-tick-line",hb(s,"className"))})))}),W=G.map((z,Z)=>{var Y,te,{entry:O,tick:P}=z,q=ta(ta(ta(ta({verticalAnchor:U},D),{},{textAnchor:M,stroke:"none",fill:i},P),{},{index:Z,payload:O,visibleTicksCount:I.length,tickFormatter:l,padding:d},u),{},{angle:(Y=(te=u==null?void 0:u.angle)!==null&&te!==void 0?te:D.angle)!==null&&Y!==void 0?Y:0}),H=ta(ta({},q),L);return j.createElement(wl,$d({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(O.value,"-").concat(O.coordinate,"-").concat(O.tickCoord)},Yq(T,O,Z)),a&&j.createElement(uoe,{option:a,tickProps:H,value:"".concat(typeof l=="function"?l(O.value,Z):O.value).concat(o||"")}))});return j.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(B,"-ticks")},W.length>0&&j.createElement(Io,{zIndex:Gn.label},j.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(B,"-tick-labels"),ref:t},W)),K.length>0&&j.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(B,"-tick-lines")},K))}),foe=j.forwardRef((e,t)=>{var{axisLine:r,width:a,height:s,className:i,hide:l,ticks:o,axisType:d}=e,u=roe(e,toe),[f,p]=j.useState(""),[x,m]=j.useState(""),b=j.useRef(null);j.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var y;return eoe({ticks:b.current,label:(y=e.labelRef)===null||y===void 0?void 0:y.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var v=j.useCallback(y=>{if(y){var k=y.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=k;var _=k[0];if(_){var C=window.getComputedStyle(_),E=C.fontSize,T=C.letterSpacing;(E!==f||T!==x)&&(p(E),m(T))}}},[f,x]);return l||a!=null&&a<=0||s!=null&&s<=0?null:j.createElement(Io,{zIndex:e.zIndex},j.createElement(wl,{className:Fr("recharts-cartesian-axis",i)},j.createElement(loe,{x:e.x,y:e.y,width:a,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Ki(e)}),j.createElement(Aoe,{ref:v,axisType:d,events:u,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:x,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:o,unit:e.unit,width:e.width,x:e.x,y:e.y}),j.createElement(vie,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},j.createElement(_ie,{label:e.label,labelRef:e.labelRef}),e.children)))}),Dj=j.forwardRef((e,t)=>{var r=zs(e,oo);return j.createElement(foe,$d({},r,{ref:t}))});Dj.displayName="CartesianAxis";var poe=["x1","y1","x2","y2","key"],hoe=["offset"],xoe=["xAxisId","yAxisId"],moe=["xAxisId","yAxisId"];function r5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function In(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r5(Object(r),!0).forEach(function(a){goe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function goe(e,t,r){return(t=boe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function boe(e){var t=voe(e,"string");return typeof t=="symbol"?t:t+""}function voe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nd(){return Nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Nd.apply(null,arguments)}function jg(e,t){if(e==null)return{};var r,a,s=yoe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function yoe(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var woe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:a,y:s,width:i,height:l,ry:o}=e;return j.createElement("rect",{x:a,y:s,ry:o,width:i,height:l,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function qP(e){var{option:t,lineItemProps:r}=e,a;if(j.isValidElement(t))a=j.cloneElement(t,r);else if(typeof t=="function")a=t(r);else{var s,{x1:i,y1:l,x2:o,y2:d,key:u}=r,f=jg(r,poe),p=(s=Ki(f))!==null&&s!==void 0?s:{},{offset:x}=p,m=jg(p,hoe);a=j.createElement("line",Nd({},m,{x1:i,y1:l,x2:o,y2:d,fill:"none",key:u}))}return a}function Noe(e){var{x:t,width:r,horizontal:a=!0,horizontalPoints:s}=e;if(!a||!s||!s.length)return null;var{xAxisId:i,yAxisId:l}=e,o=jg(e,xoe),d=s.map((u,f)=>{var p=In(In({},o),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(f),index:f});return j.createElement(qP,{key:"line-".concat(f),option:a,lineItemProps:p})});return j.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function Coe(e){var{y:t,height:r,vertical:a=!0,verticalPoints:s}=e;if(!a||!s||!s.length)return null;var{xAxisId:i,yAxisId:l}=e,o=jg(e,moe),d=s.map((u,f)=>{var p=In(In({},o),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(f),index:f});return j.createElement(qP,{option:a,lineItemProps:p,key:"line-".concat(f)})});return j.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function koe(e){var{horizontalFill:t,fillOpacity:r,x:a,y:s,width:i,height:l,horizontalPoints:o,horizontal:d=!0}=e;if(!d||!t||!t.length||o==null)return null;var u=o.map(p=>Math.round(p+s-s)).sort((p,x)=>p-x);s!==u[0]&&u.unshift(0);var f=u.map((p,x)=>{var m=u[x+1],b=m==null,v=b?s+l-p:m-p;if(v<=0)return null;var y=x%t.length;return j.createElement("rect",{key:"react-".concat(x),y:p,x:a,height:v,width:i,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return j.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function joe(e){var{vertical:t=!0,verticalFill:r,fillOpacity:a,x:s,y:i,width:l,height:o,verticalPoints:d}=e;if(!t||!r||!r.length)return null;var u=d.map(p=>Math.round(p+s-s)).sort((p,x)=>p-x);s!==u[0]&&u.unshift(0);var f=u.map((p,x)=>{var m=u[x+1],b=m==null,v=b?s+l-p:m-p;if(v<=0)return null;var y=x%r.length;return j.createElement("rect",{key:"react-".concat(x),x:p,y:i,width:v,height:o,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return j.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Eoe=(e,t)=>{var{xAxis:r,width:a,height:s,offset:i}=e;return LR(Ij(In(In(In({},oo),r),{},{ticks:QR(r),viewBox:{x:0,y:0,width:a,height:s}})),i.left,i.left+i.width,t)},Soe=(e,t)=>{var{yAxis:r,width:a,height:s,offset:i}=e;return LR(Ij(In(In(In({},oo),r),{},{ticks:QR(r),viewBox:{x:0,y:0,width:a,height:s}})),i.top,i.top+i.height,t)},Boe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Gn.grid};function Xb(e){var t=WR(),r=YR(),a=qR(),s=In(In({},zs(e,Boe)),{},{x:ct(e.x)?e.x:a.left,y:ct(e.y)?e.y:a.top,width:ct(e.width)?e.width:a.width,height:ct(e.height)?e.height:a.height}),{xAxisId:i,yAxisId:l,x:o,y:d,width:u,height:f,syncWithTicks:p,horizontalValues:x,verticalValues:m}=s,b=gs(),v=pt(U=>f6(U,"xAxis",i,b)),y=pt(U=>f6(U,"yAxis",l,b));if(!kl(u)||!kl(f)||!ct(o)||!ct(d))return null;var k=s.verticalCoordinatesGenerator||Eoe,_=s.horizontalCoordinatesGenerator||Soe,{horizontalPoints:C,verticalPoints:E}=s;if((!C||!C.length)&&typeof _=="function"){var T=x&&x.length,B=_({yAxis:y?In(In({},y),{},{ticks:T?x:y.ticks}):void 0,width:t??u,height:r??f,offset:a},T?!0:p);eg(Array.isArray(B),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof B,"]")),Array.isArray(B)&&(C=B)}if((!E||!E.length)&&typeof k=="function"){var I=m&&m.length,M=k({xAxis:v?In(In({},v),{},{ticks:I?m:v.ticks}):void 0,width:t??u,height:r??f,offset:a},I?!0:p);eg(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(E=M)}return j.createElement(Io,{zIndex:s.zIndex},j.createElement("g",{className:"recharts-cartesian-grid"},j.createElement(woe,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),j.createElement(koe,Nd({},s,{horizontalPoints:C})),j.createElement(joe,Nd({},s,{verticalPoints:E})),j.createElement(Noe,Nd({},s,{offset:a,horizontalPoints:C,xAxis:v,yAxis:y})),j.createElement(Coe,Nd({},s,{offset:a,verticalPoints:E,xAxis:v,yAxis:y}))))}Xb.displayName="CartesianGrid";var _oe={},WP=ms({name:"errorBars",initialState:_oe,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:a}=t.payload;e[r]||(e[r]=[]),e[r].push(a)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:a,next:s}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===a.dataKey&&i.direction===a.direction?s:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:a}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==a.dataKey||s.direction!==a.direction))}}}),{addErrorBar:BIe,replaceErrorBar:_Ie,removeErrorBar:TIe}=WP.actions,Toe=WP.reducer;function YP(e,t){var r,a,s=pt(u=>_o(u,e)),i=pt(u=>To(u,t)),l=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:Ka.allowDataOverflow,o=(a=i==null?void 0:i.allowDataOverflow)!==null&&a!==void 0?a:qa.allowDataOverflow,d=l||o;return{needClip:d,needClipX:l,needClipY:o}}function Foe(e){var{xAxisId:t,yAxisId:r,clipPathId:a}=e,s=Fj(),{needClipX:i,needClipY:l,needClip:o}=YP(t,r);if(!o||!s)return null;var{x:d,y:u,width:f,height:p}=s;return j.createElement("clipPath",{id:"clipPath-".concat(a)},j.createElement("rect",{x:i?d:d-f/2,y:l?u:u-p/2,width:i?f:f*2,height:l?p:p*2}))}function Ioe(e){var t=Ab(e),r=3,a=2;if(t!=null){var{r:s,strokeWidth:i}=t,l=Number(s),o=Number(i);return(Number.isNaN(l)||l<0)&&(l=r),(Number.isNaN(o)||o<0)&&(o=a),{r:l,strokeWidth:o}}return{r,strokeWidth:a}}var u2={exports:{}},A2={};/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var a5;function Doe(){if(a5)return A2;a5=1;var e=RA();function t(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var r=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,l=e.useMemo,o=e.useDebugValue;return A2.useSyncExternalStoreWithSelector=function(d,u,f,p,x){var m=s(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=l(function(){function y(T){if(!k){if(k=!0,_=T,T=p(T),x!==void 0&&b.hasValue){var B=b.value;if(x(B,T))return C=B}return C=T}if(B=C,r(_,T))return B;var I=p(T);return x!==void 0&&x(B,I)?(_=T,B):(_=T,C=I)}var k=!1,_,C,E=f===void 0?null:f;return[function(){return y(u())},E===null?void 0:function(){return y(E())}]},[u,f,p,x]);var v=a(d,m[0],m[1]);return i(function(){b.hasValue=!0,b.value=v},[v]),o(v),v},A2}var n5;function Uoe(){return n5||(n5=1,u2.exports=Doe()),u2.exports}Uoe();function Moe(e){e()}function Roe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Moe(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let a=e;for(;a;)r.push(a),a=a.next;return r},subscribe(r){let a=!0;const s=t={callback:r,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!a||e===null||(a=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var s5={notify(){},get:()=>[]};function Ooe(e,t){let r,a=s5,s=0,i=!1;function l(v){f();const y=a.subscribe(v);let k=!1;return()=>{k||(k=!0,y(),p())}}function o(){a.notify()}function d(){b.onStateChange&&b.onStateChange()}function u(){return i}function f(){s++,r||(r=e.subscribe(d),a=Roe())}function p(){s--,r&&s===0&&(r(),r=void 0,a.clear(),a=s5)}function x(){i||(i=!0,f())}function m(){i&&(i=!1,p())}const b={addNestedSub:l,notifyNestedSubs:o,handleChangeWrapper:d,isSubscribed:u,trySubscribe:x,tryUnsubscribe:m,getListeners:()=>a};return b}var Poe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Loe=Poe(),Qoe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Hoe=Qoe(),zoe=()=>Loe||Hoe?j.useLayoutEffect:j.useEffect,$oe=zoe();function i5(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Voe(e,t){if(i5(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(t,r[s])||!i5(e[r[s]],t[r[s]]))return!1;return!0}var f2=Symbol.for("react-redux-context"),p2=typeof globalThis<"u"?globalThis:{};function Goe(){if(!j.createContext)return{};const e=p2[f2]??(p2[f2]=new Map);let t=e.get(j.createContext);return t||(t=j.createContext(null),e.set(j.createContext,t)),t}var Koe=Goe();function qoe(e){const{children:t,context:r,serverState:a,store:s}=e,i=j.useMemo(()=>{const d=Ooe(s);return{store:s,subscription:d,getServerState:a?()=>a:void 0}},[s,a]),l=j.useMemo(()=>s.getState(),[s]);$oe(()=>{const{subscription:d}=i;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==s.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[i,l]);const o=r||Koe;return j.createElement(o.Provider,{value:i},t)}var Woe=qoe,Yoe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function Xoe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Uj(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of r)if(Yoe.has(a)){if(e[a]==null&&t[a]==null)continue;if(!Voe(e[a],t[a]))return!1}else if(!Xoe(e[a],t[a]))return!1;return!0}function Mj(e,t){var r,a;return(r=(a=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||a===void 0?void 0:a.xAxisId)!==null&&r!==void 0?r:zP}function Rj(e,t){var r,a;return(r=(a=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||a===void 0?void 0:a.yAxisId)!==null&&r!==void 0?r:zP}var XP=(e,t,r)=>X8(e,"xAxis",Mj(e,t),r),JP=(e,t,r)=>Y8(e,"xAxis",Mj(e,t),r),ZP=(e,t,r)=>X8(e,"yAxis",Rj(e,t),r),eL=(e,t,r)=>Y8(e,"yAxis",Rj(e,t),r),Joe=De([Hr,XP,ZP,JP,eL],(e,t,r,a,s)=>Bl(e,"xAxis")?Zm(t,a,!1):Zm(r,s,!1)),Zoe=(e,t)=>t,tL=De([g8,Zoe],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),rL=e=>{var t=Hr(e),r=Bl(t,"xAxis");return r?"yAxis":"xAxis"},ece=(e,t)=>{var r=rL(e);return r==="yAxis"?Rj(e,t):Mj(e,t)},tce=(e,t,r)=>E8(e,rL(e),ece(e,t),r),rce=De([tL,tce],(e,t)=>{var r;if(!(e==null||t==null)){var{stackId:a}=e,s=oj(e);if(!(a==null||s==null)){var i=(r=t[a])===null||r===void 0?void 0:r.stackedData,l=i==null?void 0:i.find(o=>o.key===s);if(l!=null)return l.map(o=>[o[0],o[1]])}}}),ace=De([Hr,XP,ZP,JP,eL,rce,are,Joe,tL,Are],(e,t,r,a,s,i,l,o,d,u)=>{var{chartData:f,dataStartIndex:p,dataEndIndex:x}=l;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||a==null||s==null||a.length===0||s.length===0||o==null)){var{data:m}=d,b;if(m&&m.length>0?b=m:b=f==null?void 0:f.slice(p,x+1),b!=null)return wce({layout:e,xAxis:t,yAxis:r,xAxisTicks:a,yAxisTicks:s,dataStartIndex:p,areaSettings:d,stackedData:i,displayedData:b,chartBaseValue:u,bandSize:o})}}),nce=["id"],sce=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Bd(){return Bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Bd.apply(null,arguments)}function aL(e,t){if(e==null)return{};var r,a,s=ice(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function ice(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function l5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function uA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l5(Object(r),!0).forEach(function(a){lce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function lce(e,t,r){return(t=oce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oce(e){var t=cce(e,"string");return typeof t=="symbol"?t:t+""}function cce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eg(e,t){return e&&e!=="none"?e:t}var dce=e=>{var{dataKey:t,name:r,stroke:a,fill:s,legendType:i,hide:l}=e;return[{inactive:l,dataKey:t,type:i,color:Eg(a,s),value:HR(r,t),payload:e}]},uce=j.memo(e=>{var{dataKey:t,data:r,stroke:a,strokeWidth:s,fill:i,name:l,hide:o,unit:d,tooltipType:u,id:f}=e,p={dataDefinedOnItem:r,getPosition:LA,settings:{stroke:a,strokeWidth:s,fill:i,dataKey:t,nameKey:void 0,name:HR(l,t),hide:o,type:u,color:Eg(a,i),unit:d,graphicalItemId:f}};return j.createElement(qie,{tooltipEntrySettings:p})});function Ace(e){var{clipPathId:t,points:r,props:a}=e,{needClip:s,dot:i,dataKey:l}=a,o=Ki(a);return j.createElement(xle,{points:r,dot:i,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:o,needClip:s,clipPathId:t})}function fce(e){var{showLabels:t,children:r,points:a}=e,s=a.map(i=>{var l,o,d={x:(l=i.x)!==null&&l!==void 0?l:0,y:(o=i.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return uA(uA({},d),{},{value:i.value,payload:i.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return j.createElement(Qie,{value:t?s:void 0},r)}function o5(e){var{points:t,baseLine:r,needClip:a,clipPathId:s,props:i}=e,{layout:l,type:o,stroke:d,connectNulls:u,isRange:f}=i,{id:p}=i,x=aL(i,nce),m=Ki(x),b=bi(x);return j.createElement(j.Fragment,null,(t==null?void 0:t.length)>1&&j.createElement(wl,{clipPath:a?"url(#clipPath-".concat(s,")"):void 0},j.createElement(Em,Bd({},b,{id:p,points:t,connectNulls:u,type:o,baseLine:r,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&j.createElement(Em,Bd({},m,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:t})),d!=="none"&&f&&j.createElement(Em,Bd({},m,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:r}))),j.createElement(Ace,{points:t,props:x,clipPathId:s}))}function pce(e){var t,r,{alpha:a,baseLine:s,points:i,strokeWidth:l}=e,o=(t=i[0])===null||t===void 0?void 0:t.y,d=(r=i[i.length-1])===null||r===void 0?void 0:r.y;if(!Ht(o)||!Ht(d))return null;var u=a*Math.abs(o-d),f=Math.max(...i.map(p=>p.x||0));return ct(s)?f=Math.max(s,f):s&&Array.isArray(s)&&s.length&&(f=Math.max(...s.map(p=>p.x||0),f)),ct(f)?j.createElement("rect",{x:0,y:o<d?o:o-u,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}function hce(e){var t,r,{alpha:a,baseLine:s,points:i,strokeWidth:l}=e,o=(t=i[0])===null||t===void 0?void 0:t.x,d=(r=i[i.length-1])===null||r===void 0?void 0:r.x;if(!Ht(o)||!Ht(d))return null;var u=a*Math.abs(o-d),f=Math.max(...i.map(p=>p.y||0));return ct(s)?f=Math.max(s,f):s&&Array.isArray(s)&&s.length&&(f=Math.max(...s.map(p=>p.y||0),f)),ct(f)?j.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}function xce(e){var{alpha:t,layout:r,points:a,baseLine:s,strokeWidth:i}=e;return r==="vertical"?j.createElement(pce,{alpha:t,points:a,baseLine:s,strokeWidth:i}):j.createElement(hce,{alpha:t,points:a,baseLine:s,strokeWidth:i})}function mce(e){var{needClip:t,clipPathId:r,props:a,previousPointsRef:s,previousBaselineRef:i}=e,{points:l,baseLine:o,isAnimationActive:d,animationBegin:u,animationDuration:f,animationEasing:p,onAnimationStart:x,onAnimationEnd:m}=a,b=j.useMemo(()=>({points:l,baseLine:o}),[l,o]),v=dO(b,"recharts-area-"),y=Sk(),[k,_]=j.useState(!1),C=!k,E=j.useCallback(()=>{typeof m=="function"&&m(),_(!1)},[m]),T=j.useCallback(()=>{typeof x=="function"&&x(),_(!0)},[x]);if(y==null)return null;var B=s.current,I=i.current;return j.createElement(fce,{showLabels:C,points:l},a.children,j.createElement(cO,{animationId:v,begin:u,duration:f,isActive:d,easing:p,onAnimationEnd:E,onAnimationStart:T,key:v},M=>{if(B){var U=B.length/l.length,D=M===1?l:l.map((R,Q)=>{var G=Math.floor(Q*U);if(B[G]){var K=B[G];return uA(uA({},R),{},{x:pl(K.x,R.x,M),y:pl(K.y,R.y,M)})}return R}),L;return ct(o)?L=pl(I,o,M):Rn(o)||Nl(o)?L=pl(I,0,M):L=o.map((R,Q)=>{var G=Math.floor(Q*U);if(Array.isArray(I)&&I[G]){var K=I[G];return uA(uA({},R),{},{x:pl(K.x,R.x,M),y:pl(K.y,R.y,M)})}return R}),M>0&&(s.current=D,i.current=L),j.createElement(o5,{points:D,baseLine:L,needClip:t,clipPathId:r,props:a})}return M>0&&(s.current=l,i.current=o),j.createElement(wl,null,d&&j.createElement("defs",null,j.createElement("clipPath",{id:"animationClipPath-".concat(r)},j.createElement(xce,{alpha:M,points:l,baseLine:o,layout:y,strokeWidth:a.strokeWidth}))),j.createElement(wl,{clipPath:"url(#animationClipPath-".concat(r,")")},j.createElement(o5,{points:l,baseLine:o,needClip:t,clipPathId:r,props:a})))}),j.createElement($ie,{label:a.label}))}function gce(e){var{needClip:t,clipPathId:r,props:a}=e,s=j.useRef(null),i=j.useRef();return j.createElement(mce,{needClip:t,clipPathId:r,props:a,previousPointsRef:s,previousBaselineRef:i})}class bce extends j.PureComponent{render(){var{hide:t,dot:r,points:a,className:s,top:i,left:l,needClip:o,xAxisId:d,yAxisId:u,width:f,height:p,id:x,baseLine:m,zIndex:b}=this.props;if(t)return null;var v=Fr("recharts-area",s),y=x,{r:k,strokeWidth:_}=Ioe(r),C=QP(r),E=k*2+_,T=o?"url(#clipPath-".concat(C?"":"dots-").concat(y,")"):void 0;return j.createElement(Io,{zIndex:b},j.createElement(wl,{className:v},o&&j.createElement("defs",null,j.createElement(Foe,{clipPathId:y,xAxisId:d,yAxisId:u}),!C&&j.createElement("clipPath",{id:"clipPath-dots-".concat(y)},j.createElement("rect",{x:l-E/2,y:i-E/2,width:f+E,height:p+E}))),j.createElement(gce,{needClip:o,clipPathId:y,props:this.props})),j.createElement(J6,{points:a,mainColor:Eg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(m)&&j.createElement(J6,{points:m,mainColor:Eg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var nL={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Gn.area};function vce(e){var t,r=zs(e,nL),{activeDot:a,animationBegin:s,animationDuration:i,animationEasing:l,connectNulls:o,dot:d,fill:u,fillOpacity:f,hide:p,isAnimationActive:x,legendType:m,stroke:b,xAxisId:v,yAxisId:y}=r,k=aL(r,sce),_=QA(),C=bP(),{needClip:E}=YP(v,y),T=gs(),{points:B,isRange:I,baseLine:M}=(t=pt(G=>ace(G,e.id,T)))!==null&&t!==void 0?t:{},U=Fj();if(_!=="horizontal"&&_!=="vertical"||U==null||C!=="AreaChart"&&C!=="ComposedChart")return null;var{height:D,width:L,x:R,y:Q}=U;return!B||!B.length?null:j.createElement(bce,Bd({},k,{activeDot:a,animationBegin:s,animationDuration:i,animationEasing:l,baseLine:M,connectNulls:o,dot:d,fill:u,fillOpacity:f,height:D,hide:p,layout:_,isAnimationActive:x==="auto"?!Op.isSsr:x,isRange:I,legendType:m,needClip:E,points:B,stroke:b,width:L,left:R,top:Q,xAxisId:v,yAxisId:y}))}var yce=(e,t,r,a,s)=>{var i=r??t;if(ct(i))return i;var l=e==="horizontal"?s:a,o=l.scale.domain();if(l.type==="number"){var d=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return i==="dataMin"?u:i==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return i==="dataMin"?o[0]:i==="dataMax"?o[1]:o[0]};function wce(e){var{areaSettings:{connectNulls:t,baseValue:r,dataKey:a},stackedData:s,layout:i,chartBaseValue:l,xAxis:o,yAxis:d,displayedData:u,dataStartIndex:f,xAxisTicks:p,yAxisTicks:x,bandSize:m}=e,b=s&&s.length,v=yce(i,l,r,o,d),y=i==="horizontal",k=!1,_=u.map((E,T)=>{var B,I,M,U;if(b)U=s[f+T];else{var D=yn(E,a);Array.isArray(D)?(U=D,k=!0):U=[v,D]}var L=(B=(I=U)===null||I===void 0?void 0:I[1])!==null&&B!==void 0?B:null,R=L==null||b&&!t&&yn(E,a)==null;if(y){var Q;return{x:pF({axis:o,ticks:p,bandSize:m,entry:E,index:T}),y:R?null:(Q=d.scale.map(L))!==null&&Q!==void 0?Q:null,value:U,payload:E}}return{x:R?null:(M=o.scale.map(L))!==null&&M!==void 0?M:null,y:pF({axis:d,ticks:x,bandSize:m,entry:E,index:T}),value:U,payload:E}}),C;return b||k?C=_.map(E=>{var T,B=Array.isArray(E.value)?E.value[0]:null;if(y){var I;return{x:E.x,y:B!=null&&E.y!=null&&(I=d.scale.map(B))!==null&&I!==void 0?I:null,payload:E.payload}}return{x:B!=null&&(T=o.scale.map(B))!==null&&T!==void 0?T:null,y:E.y,payload:E.payload}}):C=y?d.scale.map(v):o.scale.map(v),{points:_,baseLine:C??0,isRange:k}}function Nce(e){var t=zs(e,nL),r=gs();return j.createElement(ele,{id:t.id,type:"area"},a=>j.createElement(j.Fragment,null,j.createElement(Wie,{legendPayload:dce(t)}),j.createElement(uce,{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:a}),j.createElement(lle,{type:"area",id:a,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:nX(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),j.createElement(vce,Bd({},t,{id:a}))))}var FA=j.memo(Nce,Uj);FA.displayName="Area";var Cce=["domain","range"],kce=["domain","range"];function c5(e,t){if(e==null)return{};var r,a,s=jce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function jce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function d5(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 sL(e,t){if(e===t)return!0;var{domain:r,range:a}=e,s=c5(e,Cce),{domain:i,range:l}=t,o=c5(t,kce);return!d5(r,i)||!d5(a,l)?!1:Uj(s,o)}var Ece=["type"],Sce=["dangerouslySetInnerHTML","ticks","scale"],Bce=["id","scale"];function XN(){return XN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},XN.apply(null,arguments)}function u5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function A5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(r),!0).forEach(function(a){_ce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function _ce(e,t,r){return(t=Tce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tce(e){var t=Fce(e,"string");return typeof t=="symbol"?t:t+""}function Fce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JN(e,t){if(e==null)return{};var r,a,s=Ice(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Ice(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Dce(e){var t=en(),r=j.useRef(null),a=Sk(),{type:s}=e,i=JN(e,Ece),l=Hb(a,"xAxis",s),o=j.useMemo(()=>{if(l!=null)return A5(A5({},i),{},{type:l})},[i,l]);return j.useLayoutEffect(()=>{o!=null&&(r.current===null?t(yle(o)):r.current!==o&&t(wle({prev:r.current,next:o})),r.current=o)},[o,t]),j.useLayoutEffect(()=>()=>{r.current&&(t(Nle(r.current)),r.current=null)},[t]),null}var Uce=e=>{var{xAxisId:t,className:r}=e,a=pt($R),s=gs(),i="xAxis",l=pt(k=>W8(k,i,t,s)),o=pt(k=>oae(k,t)),d=pt(k=>pae(k,t)),u=pt(k=>p8(k,t));if(o==null||d==null||u==null)return null;var{dangerouslySetInnerHTML:f,ticks:p,scale:x}=e,m=JN(e,Sce),{id:b,scale:v}=u,y=JN(u,Bce);return j.createElement(Dj,XN({},m,y,{x:d.x,y:d.y,width:o.width,height:o.height,className:Fr("recharts-".concat(i," ").concat(i),r),viewBox:a,ticks:l,axisType:i}))},Mce={allowDataOverflow:Ka.allowDataOverflow,allowDecimals:Ka.allowDecimals,allowDuplicatedCategory:Ka.allowDuplicatedCategory,angle:Ka.angle,axisLine:oo.axisLine,height:Ka.height,hide:!1,includeHidden:Ka.includeHidden,interval:Ka.interval,label:!1,minTickGap:Ka.minTickGap,mirror:Ka.mirror,orientation:Ka.orientation,padding:Ka.padding,reversed:Ka.reversed,scale:Ka.scale,tick:Ka.tick,tickCount:Ka.tickCount,tickLine:oo.tickLine,tickSize:oo.tickSize,type:Ka.type,xAxisId:0},Rce=e=>{var t=zs(e,Mce);return j.createElement(j.Fragment,null,j.createElement(Dce,{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}),j.createElement(Uce,t))},Jb=j.memo(Rce,sL);Jb.displayName="XAxis";var Oce=["type"],Pce=["dangerouslySetInnerHTML","ticks","scale"],Lce=["id","scale"];function ZN(){return ZN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ZN.apply(null,arguments)}function f5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function p5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?f5(Object(r),!0).forEach(function(a){Qce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Qce(e,t,r){return(t=Hce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hce(e){var t=zce(e,"string");return typeof t=="symbol"?t:t+""}function zce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eC(e,t){if(e==null)return{};var r,a,s=$ce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $ce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Vce(e){var t=en(),r=j.useRef(null),a=Sk(),{type:s}=e,i=eC(e,Oce),l=Hb(a,"yAxis",s),o=j.useMemo(()=>{if(l!=null)return p5(p5({},i),{},{type:l})},[l,i]);return j.useLayoutEffect(()=>{o!=null&&(r.current===null?t(Cle(o)):r.current!==o&&t(kle({prev:r.current,next:o})),r.current=o)},[o,t]),j.useLayoutEffect(()=>()=>{r.current&&(t(jle(r.current)),r.current=null)},[t]),null}function Gce(e){var{yAxisId:t,className:r,width:a,label:s}=e,i=j.useRef(null),l=j.useRef(null),o=pt($R),d=gs(),u=en(),f="yAxis",p=pt(B=>mae(B,t)),x=pt(B=>xae(B,t)),m=pt(B=>W8(B,f,t,d)),b=pt(B=>h8(B,t));if(j.useLayoutEffect(()=>{if(!(a!=="auto"||!p||Tj(s)||j.isValidElement(s)||b==null)){var B=i.current;if(B){var I=B.getCalculatedWidth();Math.round(p.width)!==Math.round(I)&&u(Ele({id:t,width:I}))}}},[m,p,u,s,t,a,b]),p==null||x==null||b==null)return null;var{dangerouslySetInnerHTML:v,ticks:y,scale:k}=e,_=eC(e,Pce),{id:C,scale:E}=b,T=eC(b,Lce);return j.createElement(Dj,ZN({},_,T,{ref:i,labelRef:l,x:x.x,y:x.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:p.width,height:p.height,className:Fr("recharts-".concat(f," ").concat(f),r),viewBox:o,ticks:m,axisType:f}))}var Kce={allowDataOverflow:qa.allowDataOverflow,allowDecimals:qa.allowDecimals,allowDuplicatedCategory:qa.allowDuplicatedCategory,angle:qa.angle,axisLine:oo.axisLine,hide:!1,includeHidden:qa.includeHidden,interval:qa.interval,label:!1,minTickGap:qa.minTickGap,mirror:qa.mirror,orientation:qa.orientation,padding:qa.padding,reversed:qa.reversed,scale:qa.scale,tick:qa.tick,tickCount:qa.tickCount,tickLine:oo.tickLine,tickSize:oo.tickSize,type:qa.type,width:qa.width,yAxisId:0},qce=e=>{var t=zs(e,Kce);return j.createElement(j.Fragment,null,j.createElement(Vce,{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}),j.createElement(Gce,t))},Zb=j.memo(qce,sL);Zb.displayName="YAxis";var Wce=(e,t)=>t,Oj=De([Wce,Hr,A8,an,fP,Fo,Tne,kn],One),Pj=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,a=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/a)}},iL=vi("mouseClick"),lL=Dp();lL.startListening({actionCreator:iL,effect:(e,t)=>{var r=e.payload,a=Oj(t.getState(),Pj(r));(a==null?void 0:a.activeIndex)!=null&&t.dispatch(_ae({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var tC=vi("mouseMove"),oL=Dp(),Fx=null;oL.startListening({actionCreator:tC,effect:(e,t)=>{var r=e.payload;Fx!==null&&cancelAnimationFrame(Fx);var a=Pj(r);Fx=requestAnimationFrame(()=>{var s=t.getState(),i=bj(s,s.tooltip.settings.shared);if(i==="axis"){var l=Oj(s,a);(l==null?void 0:l.activeIndex)!=null?t.dispatch(nP({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate})):t.dispatch(aP())}Fx=null})}});function Yce(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var h5={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},cL=ms({name:"rootProps",initialState:h5,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:h5.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}}}),Xce=cL.reducer,{updateOptions:Jce}=cL.actions,Zce=null,ede={updatePolarOptions:(e,t)=>t.payload},dL=ms({name:"polarOptions",initialState:Zce,reducers:ede}),{updatePolarOptions:FIe}=dL.actions,tde=dL.reducer,uL=vi("keyDown"),AL=vi("focus"),Lj=Dp();Lj.startListening({actionCreator:uL,effect:(e,t)=>{var r=t.getState(),a=r.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:s}=r.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var l=vj(s,YA(r),Vp(r),Kp(r)),o=l==null?-1:Number(l);if(!(!Number.isFinite(o)||o<0)){var d=Fo(r);if(i==="Enter"){var u=Ng(r,"axis","hover",String(s.index));t.dispatch(GN({active:!s.active,activeIndex:s.index,activeCoordinate:u}));return}var f=yae(r),p=f==="left-to-right"?1:-1,x=i==="ArrowRight"?1:-1,m=o+x*p;if(!(d==null||m>=d.length||m<0)){var b=Ng(r,"axis","hover",String(m));t.dispatch(GN({active:!0,activeIndex:m.toString(),activeCoordinate:b}))}}}}}});Lj.startListening({actionCreator:AL,effect:(e,t)=>{var r=t.getState(),a=r.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var i="0",l=Ng(r,"axis","hover",String(i));t.dispatch(GN({active:!0,activeIndex:i,activeCoordinate:l}))}}}});var ni=vi("externalEvent"),fL=Dp(),h2=new Map;fL.startListening({actionCreator:ni,effect:(e,t)=>{var{handler:r,reactEvent:a}=e.payload;if(r!=null){a.persist();var s=a.type,i=h2.get(s);i!==void 0&&cancelAnimationFrame(i);var l=requestAnimationFrame(()=>{try{var o=t.getState(),d={activeCoordinate:xne(o),activeDataKey:pne(o),activeIndex:op(o),activeLabel:xP(o),activeTooltipIndex:op(o),isTooltipActive:mne(o)};r(d,a)}finally{h2.delete(s)}});h2.set(s,l)}}});var rde=De([qA],e=>e.tooltipItemPayloads),ade=De([rde,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var a=e.find(i=>i.settings.graphicalItemId===r);if(a!=null){var{getPosition:s}=a;if(s!=null)return s(t)}}}),pL=vi("touchMove"),hL=Dp();hL.startListening({actionCreator:pL,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var a=t.getState(),s=bj(a,a.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var l=Oj(a,Pj({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(l==null?void 0:l.activeIndex)!=null&&t.dispatch(nP({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate}))}else if(s==="item"){var o,d=r.touches[0];if(document.elementFromPoint==null||d==null)return;var u=document.elementFromPoint(d.clientX,d.clientY);if(!u||!u.getAttribute)return;var f=u.getAttribute(uX),p=(o=u.getAttribute(AX))!==null&&o!==void 0?o:void 0,x=WA(a).find(v=>v.id===p);if(f==null||x==null||p==null)return;var{dataKey:m}=x,b=ade(a,f,p);t.dispatch(Bae({activeDataKey:m,activeIndex:f,activeCoordinate:b,activeGraphicalItemId:p}))}}}});var nde=uR({brush:Rle,cartesianAxis:Sle,chartData:xse,errorBars:Toe,graphicalItems:sle,layout:WY,legend:aJ,options:use,polarAxis:Gie,polarOptions:tde,referenceElements:Qle,rootProps:Xce,tooltip:Tae,zIndex:Jne}),sde=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return vY({reducer:nde,preloadedState:t,middleware:a=>{var s;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([lL.middleware,oL.middleware,Lj.middleware,fL.middleware,hL.middleware])},enhancers:a=>{var s=a;return typeof a=="function"&&(s=a()),s.concat(jR({type:"raf"}))},devTools:{serialize:{replacer:Yce},name:"recharts-".concat(r)}})};function ide(e){var{preloadedState:t,children:r,reduxStoreName:a}=e,s=gs(),i=j.useRef(null);if(s)return r;i.current==null&&(i.current=sde(t,a));var l=gk;return j.createElement(Woe,{context:l,store:i.current},r)}function lde(e){var{layout:t,margin:r}=e,a=en(),s=gs();return j.useEffect(()=>{s||(a(GY(t)),a(VY(r)))},[a,s,t,r]),null}var ode=j.memo(lde,Uj);function cde(e){var t=en();return j.useEffect(()=>{t(Jce(e))},[t,e]),null}function x5(e){var{zIndex:t,isPanorama:r}=e,a=j.useRef(null),s=en();return j.useLayoutEffect(()=>(a.current&&s(Yne({zIndex:t,element:a.current,isPanorama:r})),()=>{s(Xne({zIndex:t,isPanorama:r}))}),[s,t,r]),j.createElement("g",{tabIndex:-1,ref:a})}function m5(e){var{children:t,isPanorama:r}=e,a=pt(Lne);if(!a||a.length===0)return t;var s=a.filter(l=>l<0),i=a.filter(l=>l>0);return j.createElement(j.Fragment,null,s.map(l=>j.createElement(x5,{key:l,zIndex:l,isPanorama:r})),t,i.map(l=>j.createElement(x5,{key:l,zIndex:l,isPanorama:r})))}var dde=["children"];function ude(e,t){if(e==null)return{};var r,a,s=Ade(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Ade(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Sg.apply(null,arguments)}var fde={width:"100%",height:"100%",display:"block"},pde=j.forwardRef((e,t)=>{var r=WR(),a=YR(),s=sO();if(!kl(r)||!kl(a))return null;var{children:i,otherAttributes:l,title:o,desc:d}=e,u,f;return l!=null&&(typeof l.tabIndex=="number"?u=l.tabIndex:u=s?0:void 0,typeof l.role=="string"?f=l.role:f=s?"application":void 0),j.createElement(FM,Sg({},l,{title:o,desc:d,role:f,tabIndex:u,width:r,height:a,style:fde,ref:t}),i)}),hde=e=>{var{children:t}=e,r=pt(Bb);if(!r)return null;var{width:a,height:s,y:i,x:l}=r;return j.createElement(FM,{width:a,height:s,x:l,y:i},t)},g5=j.forwardRef((e,t)=>{var{children:r}=e,a=ude(e,dde),s=gs();return s?j.createElement(hde,null,j.createElement(m5,{isPanorama:!0},r)):j.createElement(pde,Sg({ref:t},a),j.createElement(m5,{isPanorama:!1},r))});function xde(){var e=en(),[t,r]=j.useState(null),a=pt(dX);return j.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;Ht(i)&&i!==a&&e(qY(i))}},[t,e,a]),r}function b5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function mde(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b5(Object(r),!0).forEach(function(a){gde(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function gde(e,t,r){return(t=bde(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bde(e){var t=vde(e,"string");return typeof t=="symbol"?t:t+""}function vde(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},jc.apply(null,arguments)}var yde=()=>(kse(),null);function Bg(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var wde=j.forwardRef((e,t)=>{var r,a,s=j.useRef(null),[i,l]=j.useState({containerWidth:Bg((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Bg((a=e.style)===null||a===void 0?void 0:a.height)}),o=j.useCallback((u,f)=>{l(p=>{var x=Math.round(u),m=Math.round(f);return p.containerWidth===x&&p.containerHeight===m?p:{containerWidth:x,containerHeight:m}})},[]),d=j.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:f,height:p}=u.getBoundingClientRect();o(f,p);var x=b=>{var v=b[0];if(v!=null){var{width:y,height:k}=v.contentRect;o(y,k)}},m=new ResizeObserver(x);m.observe(u),s.current=m}},[t,o]);return j.useEffect(()=>()=>{var u=s.current;u!=null&&u.disconnect()},[o]),j.createElement(j.Fragment,null,j.createElement(Mp,{width:i.containerWidth,height:i.containerHeight}),j.createElement("div",jc({ref:d},e)))}),Nde=j.forwardRef((e,t)=>{var{width:r,height:a}=e,[s,i]=j.useState({containerWidth:Bg(r),containerHeight:Bg(a)}),l=j.useCallback((d,u)=>{i(f=>{var p=Math.round(d),x=Math.round(u);return f.containerWidth===p&&f.containerHeight===x?f:{containerWidth:p,containerHeight:x}})},[]),o=j.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:u,height:f}=d.getBoundingClientRect();l(u,f)}},[t,l]);return j.createElement(j.Fragment,null,j.createElement(Mp,{width:s.containerWidth,height:s.containerHeight}),j.createElement("div",jc({ref:o},e)))}),Cde=j.forwardRef((e,t)=>{var{width:r,height:a}=e;return j.createElement(j.Fragment,null,j.createElement(Mp,{width:r,height:a}),j.createElement("div",jc({ref:t},e)))}),kde=j.forwardRef((e,t)=>{var{width:r,height:a}=e;return typeof r=="string"||typeof a=="string"?j.createElement(Nde,jc({},e,{ref:t})):typeof r=="number"&&typeof a=="number"?j.createElement(Cde,jc({},e,{width:r,height:a,ref:t})):j.createElement(j.Fragment,null,j.createElement(Mp,{width:r,height:a}),j.createElement("div",jc({ref:t},e)))});function jde(e){return e?wde:kde}var Ede=j.forwardRef((e,t)=>{var{children:r,className:a,height:s,onClick:i,onContextMenu:l,onDoubleClick:o,onMouseDown:d,onMouseEnter:u,onMouseLeave:f,onMouseMove:p,onMouseUp:x,onTouchEnd:m,onTouchMove:b,onTouchStart:v,style:y,width:k,responsive:_,dispatchTouchEvents:C=!0}=e,E=j.useRef(null),T=en(),[B,I]=j.useState(null),[M,U]=j.useState(null),D=xde(),L=kk(),R=(L==null?void 0:L.width)>0?L.width:k,Q=(L==null?void 0:L.height)>0?L.height:s,G=j.useCallback(ne=>{D(ne),typeof t=="function"&&t(ne),I(ne),U(ne),ne!=null&&(E.current=ne)},[D,t,I,U]),K=j.useCallback(ne=>{T(iL(ne)),T(ni({handler:i,reactEvent:ne}))},[T,i]),W=j.useCallback(ne=>{T(tC(ne)),T(ni({handler:u,reactEvent:ne}))},[T,u]),z=j.useCallback(ne=>{T(aP()),T(ni({handler:f,reactEvent:ne}))},[T,f]),Z=j.useCallback(ne=>{T(tC(ne)),T(ni({handler:p,reactEvent:ne}))},[T,p]),Y=j.useCallback(()=>{T(AL())},[T]),te=j.useCallback(ne=>{T(uL(ne.key))},[T]),O=j.useCallback(ne=>{T(ni({handler:l,reactEvent:ne}))},[T,l]),P=j.useCallback(ne=>{T(ni({handler:o,reactEvent:ne}))},[T,o]),q=j.useCallback(ne=>{T(ni({handler:d,reactEvent:ne}))},[T,d]),H=j.useCallback(ne=>{T(ni({handler:x,reactEvent:ne}))},[T,x]),J=j.useCallback(ne=>{T(ni({handler:v,reactEvent:ne}))},[T,v]),ae=j.useCallback(ne=>{C&&T(pL(ne)),T(ni({handler:b,reactEvent:ne}))},[T,C,b]),oe=j.useCallback(ne=>{T(ni({handler:m,reactEvent:ne}))},[T,m]),ce=jde(_);return j.createElement(CP.Provider,{value:B},j.createElement(yq.Provider,{value:M},j.createElement(ce,{width:R??(y==null?void 0:y.width),height:Q??(y==null?void 0:y.height),className:Fr("recharts-wrapper",a),style:mde({position:"relative",cursor:"default",width:R,height:Q},y),onClick:K,onContextMenu:O,onDoubleClick:P,onFocus:Y,onKeyDown:te,onMouseDown:q,onMouseEnter:W,onMouseLeave:z,onMouseMove:Z,onMouseUp:H,onTouchEnd:oe,onTouchMove:ae,onTouchStart:J,ref:G},j.createElement(yde,null),r)))}),Sde=["width","height","responsive","children","className","style","compact","title","desc"];function Bde(e,t){if(e==null)return{};var r,a,s=_de(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function _de(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var Tde=j.forwardRef((e,t)=>{var{width:r,height:a,responsive:s,children:i,className:l,style:o,compact:d,title:u,desc:f}=e,p=Bde(e,Sde),x=Ki(p);return d?j.createElement(j.Fragment,null,j.createElement(Mp,{width:r,height:a}),j.createElement(g5,{otherAttributes:x,title:u,desc:f},i)):j.createElement(Ede,{className:l,style:o,width:r,height:a,responsive:s??!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},j.createElement(g5,{otherAttributes:x,title:u,desc:f,ref:t},j.createElement(zle,null,i)))});function rC(){return rC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},rC.apply(null,arguments)}var Fde={top:5,right:5,bottom:5,left:5},Ide={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Fde,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Dde=j.forwardRef(function(t,r){var a,s=zs(t.categoricalChartProps,Ide),{chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:o,tooltipPayloadSearcher:d,categoricalChartProps:u}=t,f={chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:o,tooltipPayloadSearcher:d,eventEmitter:void 0};return j.createElement(ide,{preloadedState:{options:f},reduxStoreName:(a=u.id)!==null&&a!==void 0?a:i},j.createElement(Mle,{chartData:u.data}),j.createElement(ode,{layout:s.layout,margin:s.margin}),j.createElement(cde,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),j.createElement(Tde,rC({},s,{ref:r})))}),Ude=["axis"],Qj=j.forwardRef((e,t)=>j.createElement(Dde,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ude,tooltipPayloadSearcher:cse,categoricalChartProps:e,ref:t}));const v5=({user:e,onNavigate:t})=>{var I,M;const{maintenance:r,refreshData:a,financialTotals:s}=ht(),[i,l]=j.useState(null),[o,d]=j.useState([]),[u,f]=j.useState([]),[p,x]=j.useState(!0),[m,b]=j.useState(null),[v,y]=j.useState(!1),[k,_]=j.useState({president:"",secretary:"",treasurer:"",nextAssembly:"S/A"}),C=["admin","programmer","board"].includes(e.role),E=async()=>{x(!0),b(null);try{const[U,D,L]=await Promise.all([we.getDashboardStats(),we.getAnnouncements(),we.getSystemSettings()]);if(l(U),d(D||[]),_({president:(L==null?void 0:L.board_president)||"No Asignado",secretary:(L==null?void 0:L.board_secretary)||"No Asignado",treasurer:(L==null?void 0:L.board_treasurer)||"No Asignado",nextAssembly:(L==null?void 0:L.next_assembly_date)||"S/A"}),C){const R=await we.getCriticalBills();f(R||[])}}catch(U){console.error("Error loading dashboard",U),b(U.message||"Error al cargar datos del panel.")}finally{x(!1)}};j.useEffect(()=>{E();const U=setTimeout(()=>y(!0),200);return()=>clearTimeout(U)},[e.role,C]);const T=(r==null?void 0:r.filter(U=>U.status!=="Completado"&&U.status!=="Rechazada").length)||0;if(p)return n.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-4 border-blue-100 border-t-blue-600 rounded-full animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Iniciando Motor..."})]});if(m)return n.jsxs("div",{className:"bg-red-50 border border-red-100 p-8 sm:p-10 rounded-[2rem] sm:rounded-[3rem] text-center max-w-lg mx-auto shadow-xl",children:[n.jsx(Cr,{className:"w-12 h-12 sm:w-16 sm:h-16 text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-xl sm:text-2xl font-black text-red-800 tracking-tight",children:"Error de Acceso"}),n.jsx("p",{className:"text-red-600 font-medium mb-6 text-sm sm:text-base",children:m}),n.jsxs("button",{onClick:E,className:"bg-red-600 text-white px-8 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest hover:bg-red-700 transition-all flex items-center gap-2 mx-auto",children:[n.jsx(ot,{size:14})," Reintentar Carga"]})]});const B=((M=(I=e==null?void 0:e.fullName)==null?void 0:I.split(" "))==null?void 0:M[0])||"Usuario";return n.jsxs("div",{className:"space-y-6 sm:space-y-8 animate-in fade-in duration-700",children:[C&&u.length>0&&n.jsxs("div",{className:"bg-red-50 border border-red-100 p-5 sm:p-6 rounded-2xl sm:rounded-[2rem] flex flex-col md:flex-row items-center justify-between gap-4 shadow-sm",children:[n.jsxs("div",{className:"flex items-center gap-4 text-center md:text-left flex-col md:flex-row",children:[n.jsx("div",{className:"bg-red-500 p-3 rounded-2xl text-white shadow-lg shadow-red-200",children:n.jsx(VG,{size:24})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-red-700 font-black uppercase text-[10px] tracking-widest",children:"Pagos Vencidos"}),n.jsxs("p",{className:"text-red-600/70 text-xs sm:text-sm font-medium",children:["Hay ",u.length," facturas esperando aprobación."]})]})]}),n.jsx("button",{onClick:()=>t("balance"),className:"w-full md:w-auto bg-red-600 hover:bg-red-700 text-white text-xs font-bold px-8 py-2.5 rounded-xl transition-all active:scale-95 shadow-lg shadow-red-200",children:"Gestionar"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-center gap-6 sm:gap-8 bg-white p-7 sm:p-10 lg:p-12 rounded-[2rem] sm:rounded-[3rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[["admin","programmer"].includes(e.role)&&n.jsx("button",{onClick:()=>window.location.reload(),className:"absolute top-6 right-6 p-3 bg-slate-50 hover:bg-blue-50 text-slate-400 hover:text-blue-600 rounded-xl transition-all border border-slate-100 z-20 group/refresh shadow-sm active:scale-95",title:"Recargar Sistema (F5)",children:n.jsx(ot,{size:18,className:"group-hover/refresh:rotate-180 transition-transform duration-500"})}),n.jsxs("div",{className:"relative z-10 text-center lg:text-left w-full lg:w-auto",children:[n.jsxs("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Hola, ",n.jsx("span",{className:"text-blue-600",children:B})]}),n.jsx("p",{className:"text-slate-400 mt-2 sm:mt-3 font-medium text-base sm:text-lg leading-relaxed max-w-md mx-auto lg:mx-0",children:"Bienvenido de nuevo al panel."}),n.jsxs("div",{className:"mt-6 sm:mt-8 flex items-center justify-center lg:justify-start gap-3",children:[n.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-pulse"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-blue-600 bg-blue-50 px-4 py-1.5 rounded-full border border-blue-100",children:"Estado: Online"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 w-full lg:w-auto relative z-10",children:[n.jsxs("div",{className:"bg-slate-50 p-4 sm:p-6 rounded-2xl sm:rounded-[2rem] border border-slate-100 flex flex-col items-center",children:[n.jsxs("span",{className:"text-xl sm:text-2xl font-black text-slate-800 tracking-tight",children:[(i==null?void 0:i.collectionRate)??0,"%"]}),n.jsx("span",{className:"text-[8px] sm:text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1 text-center",children:"Recaudación"})]}),n.jsxs("div",{className:"bg-slate-50 p-4 sm:p-6 rounded-2xl sm:rounded-[2rem] border border-slate-100 flex flex-col items-center",children:[n.jsxs("span",{className:"text-xl sm:text-2xl font-black text-slate-800 tracking-tight",children:[(i==null?void 0:i.occupancyRate)??0,"%"]}),n.jsx("span",{className:"text-[8px] sm:text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1 text-center",children:"Ocupación"})]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 sm:w-64 sm:h-64 bg-blue-50/50 rounded-full blur-[100px] pointer-events-none -translate-y-1/2 translate-x-1/3"})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-4 sm:gap-6",children:[n.jsx(af,{title:"Recaudado",value:`$${((i==null?void 0:i.totalCollection)??0).toLocaleString()}`,icon:wn,color:"blue",trend:"+12% mes"}),e.role==="programmer"&&n.jsx(af,{title:"Caja en Divisa",value:`$${((s==null?void 0:s.initialCashUsd)??0).toLocaleString(void 0,{minimumFractionDigits:2})}`,icon:Tc,color:"emerald",trend:"Efectivo"}),n.jsx(af,{title:"Fondo Reserva",value:`$ ${((s==null?void 0:s.reserveFundUsd)??0).toLocaleString(void 0,{maximumFractionDigits:0})}`,icon:ho,color:"indigo",trend:"Patrimonio"}),n.jsx(af,{title:"Fallas",value:T.toString(),icon:qf,color:"amber",trend:"Tickets"}),n.jsx(af,{title:"Asamblea",value:k.nextAssembly,icon:Lr,color:"slate",trend:"Fecha"})]}),n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6 sm:gap-8",children:[n.jsxs("div",{className:"xl:col-span-2 bg-white p-6 sm:p-8 lg:p-10 rounded-[2rem] sm:rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden flex flex-col min-w-0",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 sm:mb-10 gap-4",children:[n.jsxs("h3",{className:"text-lg sm:text-xl font-black flex items-center gap-3 tracking-tight text-slate-800 uppercase",children:[n.jsx(ha,{className:"text-blue-600",size:20})," FLUJO USD"]}),n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[9px] font-bold uppercase text-slate-400",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-slate-200 rounded-full"})," Proy."]}),n.jsxs("div",{className:"flex items-center gap-2 text-[9px] font-bold uppercase text-blue-600",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full"})," Real"]})]})]}),n.jsx("div",{className:"relative w-full h-[250px] sm:h-[320px] min-h-[250px]",children:n.jsx("div",{className:"absolute inset-0",children:v&&i&&n.jsx(jk,{width:"100%",height:"100%",minWidth:0,children:n.jsxs(Qj,{data:(i==null?void 0:i.monthlyTrend)||[],margin:{top:10,right:5,left:-25,bottom:0},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"colorRec",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.1}),n.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]})}),n.jsx(Xb,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(Jb,{dataKey:"label",stroke:"#94a3b8",fontSize:10,fontStyle:"bold",axisLine:!1,tickLine:!1}),n.jsx(Zb,{stroke:"#94a3b8",fontSize:10,fontStyle:"bold",axisLine:!1,tickLine:!1}),n.jsx(Bj,{cursor:{stroke:"#e2e8f0",strokeWidth:2},contentStyle:{backgroundColor:"#fff",border:"1px solid #e2e8f0",borderRadius:"15px",fontSize:"12px"}}),n.jsx(FA,{type:"monotone",dataKey:"total",stroke:"#cbd5e1",fill:"transparent",strokeWidth:2,strokeDasharray:"6 6"}),n.jsx(FA,{type:"monotone",dataKey:"collected",stroke:"#2563eb",fillOpacity:1,fill:"url(#colorRec)",strokeWidth:3})]})})})})]}),n.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[n.jsxs("div",{className:"bg-slate-900 p-7 sm:p-8 rounded-[2rem] sm:rounded-[3rem] text-white shadow-2xl relative overflow-hidden group border-r-4 border-blue-600",children:[n.jsxs("h3",{className:"text-[10px] font-black flex items-center gap-3 tracking-widest mb-6 sm:mb-8 text-blue-400 uppercase",children:[n.jsx(Ea,{size:16})," Junta Directiva"]}),n.jsxs("div",{className:"space-y-5 sm:space-y-6 relative z-10",children:[n.jsxs("div",{className:"border-l-2 border-blue-600/30 pl-4",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Presidente"}),n.jsx("p",{className:"text-xs sm:text-sm font-black text-white uppercase tracking-tight truncate",children:k.president})]}),n.jsxs("div",{className:"border-l-2 border-blue-600/30 pl-4",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Secretario(a)"}),n.jsx("p",{className:"text-xs sm:text-sm font-black text-white uppercase tracking-tight truncate",children:k.secretary})]}),n.jsxs("div",{className:"border-l-2 border-blue-600/30 pl-4",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Tesorero(a)"}),n.jsx("p",{className:"text-xs sm:text-sm font-black text-white uppercase tracking-tight truncate",children:k.treasurer})]})]}),n.jsx(Oi,{size:100,className:"absolute right-[-10px] bottom-[-10px] text-white/5 pointer-events-none group-hover:scale-110 transition-transform duration-[2s]"})]}),n.jsxs("div",{className:"bg-white p-6 sm:p-8 rounded-[2rem] sm:rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-lg sm:text-xl font-black flex items-center gap-3 tracking-tight mb-6 sm:mb-8 text-slate-800 uppercase",children:[n.jsx(Oc,{className:"text-indigo-600",size:20})," NOTICIAS"]}),n.jsxs("div",{className:"space-y-4",children:[o.slice(0,3).map((U,D)=>n.jsxs("div",{className:"flex gap-4 p-3 hover:bg-slate-50 rounded-xl transition-all group cursor-pointer border border-transparent",children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 flex-shrink-0 ${U.priority==="Alta"?"bg-red-500":"bg-blue-400"}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h4",{className:"text-[11px] font-black text-slate-700 group-hover:text-blue-600 transition-colors truncate",children:U.title}),n.jsx("p",{className:"text-[8px] text-slate-400 mt-0.5 uppercase font-black tracking-widest",children:U.date})]})]},D)),o.length===0&&n.jsx("p",{className:"text-[10px] text-slate-400 text-center italic py-4",children:"Sin noticias recientes"})]})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 sm:gap-6 pb-6",children:[n.jsx(x2,{color:"blue",icon:wn,title:"Pagar Recibo",desc:"Cargar comprobante",onClick:()=>t(e.role==="owner"?"properties":"view-fees")}),n.jsx(x2,{color:"indigo",icon:Lr,title:"Reservar Áreas",desc:"Cancha, Caney, Salón",onClick:()=>t("reservations")}),n.jsx(x2,{color:"slate",icon:Xd,title:"Reportar Falla",desc:"Tickets técnicos",onClick:()=>t("services")})]}),n.jsx("div",{className:"pt-10 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-xs sm:text-sm text-slate-700 font-black uppercase tracking-[0.2em]",children:["SISTEMA ADMINISTRATIVO • ",n.jsx("span",{className:"text-blue-600",children:"BY ANDRES MATHISON"})]})})]})},af=({title:e,value:t,icon:r,color:a,trend:s})=>{const i={blue:"text-blue-600 bg-blue-50 border-blue-100 shadow-blue-100/50",indigo:"text-indigo-600 bg-indigo-50 border-indigo-100 shadow-indigo-100/50",amber:"text-amber-600 bg-amber-50 border-amber-100 shadow-amber-100/50",emerald:"text-emerald-600 bg-emerald-50 border-emerald-100 shadow-emerald-100/50",slate:"text-slate-600 bg-slate-100 border-slate-200 shadow-slate-100/50"};return n.jsxs("div",{className:"bg-white p-4 sm:p-6 lg:p-7 rounded-2xl sm:rounded-[2.5rem] border border-slate-200 hover:border-blue-400 transition-all group shadow-sm",children:[n.jsx("div",{className:`w-10 h-10 sm:w-14 sm:h-14 rounded-xl sm:rounded-2xl flex items-center justify-center border mb-3 sm:mb-5 transition-transform group-hover:scale-110 shadow-lg ${i[a]}`,children:n.jsx(r,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),n.jsx("p",{className:"text-slate-400 text-[8px] sm:text-[10px] font-black uppercase tracking-widest leading-none truncate",children:e}),n.jsx("h3",{className:"text-lg sm:text-2xl lg:text-3xl font-black text-slate-800 mt-1 sm:mt-2 tracking-tighter truncate",children:t}),n.jsx("div",{className:"flex items-center gap-1.5 mt-2 sm:mt-3 overflow-hidden",children:n.jsxs("div",{className:"bg-slate-100 px-2 py-0.5 rounded-full flex items-center gap-1 shrink-0",children:[n.jsx(ZC,{size:10,className:"text-blue-600"}),n.jsx("span",{className:"text-[7px] sm:text-[10px] text-slate-600 font-bold whitespace-nowrap",children:s})]})})]})},x2=({color:e,icon:t,title:r,desc:a,onClick:s})=>{const i={blue:"from-blue-600 to-blue-800 shadow-blue-200",indigo:"from-indigo-600 to-indigo-800 shadow-indigo-200",slate:"from-slate-700 to-slate-900 shadow-slate-200"};return n.jsxs("button",{onClick:s,className:`p-6 sm:p-8 rounded-2xl sm:rounded-[2.5rem] bg-gradient-to-br ${i[e]} text-white text-left shadow-2xl transition-all hover:-translate-y-1 sm:hover:-translate-y-2 group overflow-hidden relative active:scale-95`,children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx(t,{className:"w-7 h-7 sm:w-8 sm:h-8 mb-3 sm:mb-4 opacity-70 group-hover:scale-110 transition-transform"}),n.jsx("h4",{className:"text-lg sm:text-xl font-black tracking-tight",children:r}),n.jsx("p",{className:"text-white/60 text-[10px] sm:text-xs font-bold mt-1 uppercase tracking-widest",children:a})]}),n.jsx("div",{className:"absolute -right-4 -bottom-4 bg-white/10 w-24 h-24 sm:w-32 sm:h-32 rounded-full blur-3xl group-hover:scale-150 transition-transform"})]})},Mde=({user:e})=>{const{fees:t,properties:r}=ht(),[a,s]=j.useState(null),[i,l]=j.useState(!0);j.useEffect(()=>{(async()=>{try{const m=await we.getMyProperty(e.propertyCode||"");s(m)}catch(m){console.error("Error fetching property status",m)}finally{l(!1)}})()},[e.propertyCode]);const o=j.useMemo(()=>{if(!a)return null;for(const x of t){const m=x.debts.find(b=>b.propertyId===a.id);if(m&&m.rejectionMessage)return{message:m.rejectionMessage,period:`${new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,x.month))} ${x.year}`}}return null},[t,a]),d=j.useMemo(()=>{const x=[];return t.forEach(m=>{const b=m.debts.find(v=>v.propertyId===(a==null?void 0:a.id));b&&b.payments&&b.payments.forEach(v=>{x.push({...v,feeName:`${new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,m.month))} ${m.year}`})})}),x.sort((m,b)=>new Date(b.date).getTime()-new Date(m.date).getTime())},[t,a]);if(i)return n.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-4 border-blue-100 border-t-blue-600 rounded-full animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Consultando estatus..."})]});const u=(a==null?void 0:a.debt)??0,f=u<0,p=Math.abs(u);return n.jsxs("div",{className:"max-w-6xl mx-auto space-y-6 sm:space-y-8 animate-in slide-in-from-bottom duration-500 pb-12 px-1",children:[o&&n.jsx("div",{className:"bg-red-600 text-white p-6 sm:p-8 rounded-2xl sm:rounded-[2.5rem] shadow-2xl shadow-red-200 flex flex-col md:flex-row items-center justify-between gap-6 animate-pulse-subtle",children:n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"bg-white/20 p-3 sm:p-4 rounded-xl sm:rounded-2xl",children:n.jsx(na,{size:28,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-black uppercase text-[11px] sm:text-sm tracking-[0.15em]",children:"Atención: Pago Anulado"}),n.jsxs("p",{className:"text-red-100 text-base sm:text-lg font-bold mt-1 leading-tight",children:['"',o.message,'"']}),n.jsxs("p",{className:"text-[9px] font-black uppercase tracking-widest opacity-70 mt-2",children:["Correspondiente a: ",o.period]})]})]})}),n.jsxs("div",{className:`rounded-[2rem] sm:rounded-[3.5rem] p-6 sm:p-10 lg:p-14 text-white relative overflow-hidden shadow-2xl transition-all duration-500 ${f?"bg-gradient-to-br from-emerald-500 to-teal-700 shadow-emerald-500/20":"bg-gradient-to-br from-blue-600 to-blue-800 shadow-blue-500/20"}`,children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-8 sm:gap-12",children:[n.jsxs("div",{className:"text-center lg:text-left flex-1 w-full",children:[n.jsxs("div",{className:"bg-white/10 w-fit px-4 py-1.5 rounded-full backdrop-blur-md border border-white/20 mb-6 sm:mb-8 mx-auto lg:mx-0 flex items-center gap-2",children:[n.jsx(Lc,{size:12,className:"text-yellow-300 fill-yellow-300"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em]",children:"Estatus de Cuenta SAC 2026"})]}),n.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-black mb-3 tracking-tighter leading-none",children:["Unidad ",n.jsx("span",{className:f?"text-emerald-100":"text-blue-200",children:a==null?void 0:a.code})]}),n.jsx("p",{className:"text-white/80 font-bold text-base sm:text-xl uppercase tracking-tight opacity-90 truncate max-w-full px-2",children:e.fullName}),n.jsxs("div",{className:"flex flex-wrap gap-3 mt-8 sm:mt-10 justify-center lg:justify-start px-2",children:[n.jsxs("div",{className:"px-4 py-3 sm:px-6 sm:py-4 bg-black/10 rounded-xl sm:rounded-2xl backdrop-blur-md flex items-center gap-3 border border-white/5",children:[n.jsx(Gr,{size:20,className:"text-white/50"}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[7px] sm:text-[8px] font-black uppercase opacity-50",children:"Tipo"}),n.jsxs("p",{className:"text-xs sm:text-sm font-black whitespace-nowrap",children:[a==null?void 0:a.type," ",a==null?void 0:a.number]})]})]}),n.jsxs("div",{className:"px-4 py-3 sm:px-6 sm:py-4 bg-black/10 rounded-xl sm:rounded-2xl backdrop-blur-md flex items-center gap-3 border border-white/5",children:[n.jsx(ha,{size:20,className:"text-white/50"}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[7px] sm:text-[8px] font-black uppercase opacity-50",children:"Alícuota"}),n.jsxs("p",{className:"text-xs sm:text-sm font-black whitespace-nowrap",children:[Number((a==null?void 0:a.aliquot)??0).toFixed(4),"%"]})]})]})]})]}),n.jsxs("div",{className:"bg-white p-7 sm:p-10 lg:p-14 rounded-[2rem] sm:rounded-[3.5rem] shadow-2xl flex flex-col items-center w-full max-w-sm sm:min-w-[320px] transform hover:scale-105 transition-transform duration-300",children:[n.jsx("span",{className:`text-[8px] sm:text-[10px] font-black uppercase tracking-widest mb-3 sm:mb-4 px-4 py-1.5 rounded-full border ${f?"text-emerald-600 border-emerald-100 bg-emerald-50":"text-slate-400 border-slate-100 bg-slate-50"}`,children:f?"PAGO EN EXCESO":"TOTAL PENDIENTE"}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("span",{className:`text-xl sm:text-2xl font-black mt-1.5 sm:mt-2 ${f?"text-emerald-600":"text-slate-900"}`,children:"$"}),n.jsx("span",{className:`text-5xl sm:text-7xl lg:text-8xl font-black tracking-tighter ${f?"text-emerald-600":"text-slate-900"}`,children:p.toLocaleString(void 0,{minimumFractionDigits:2})})]}),n.jsx("p",{className:`text-center font-bold text-[10px] sm:text-xs mt-3 sm:mt-4 uppercase tracking-tighter ${f?"text-emerald-500":"text-slate-400"}`,children:f?"Abonado a su próxima factura":"Agradecemos su pago oportuno"})]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-[300px] h-[300px] sm:w-[500px] h-[500px] bg-white/10 rounded-full -translate-y-1/2 translate-x-1/2 blur-[80px] sm:blur-[120px] pointer-events-none"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 sm:gap-8",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-6 sm:p-8 lg:p-12 rounded-[2rem] sm:rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8 sm:mb-10 gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[n.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-slate-900 text-white rounded-xl sm:rounded-2xl flex items-center justify-center",children:n.jsx(Oc,{size:20})}),n.jsx("h3",{className:"text-xl sm:text-2xl font-black text-slate-800 tracking-tight",children:"Últimos Abonos"})]}),n.jsxs("span",{className:"text-[8px] sm:text-[10px] font-black uppercase tracking-widest text-slate-400 bg-slate-50 px-3 py-1.5 rounded-full",children:[d.length," Ops"]})]}),n.jsx("div",{className:"space-y-3 sm:space-y-4",children:d.length===0?n.jsxs("div",{className:"py-16 sm:py-20 text-center border-2 border-dashed border-slate-100 rounded-2xl sm:rounded-[2.5rem]",children:[n.jsx(Cr,{className:"mx-auto mb-4 text-slate-200",size:40}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Sin pagos registrados aún."})]}):d.slice(0,5).map((x,m)=>n.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-6 bg-slate-50 rounded-xl sm:rounded-[2rem] border border-transparent hover:border-blue-200 hover:bg-white transition-all group overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-3 sm:gap-5 flex-1 min-w-0",children:[n.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-white border border-slate-200 rounded-xl sm:rounded-2xl flex items-center justify-center text-emerald-600 shadow-sm group-hover:scale-110 transition-transform shrink-0",children:n.jsx(zt,{size:20})}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-[7px] sm:text-[9px] font-black text-slate-400 uppercase tracking-widest mb-1 truncate",children:x.feeName}),n.jsx("p",{className:"text-sm sm:text-lg font-black text-slate-800 tracking-tight truncate uppercase",children:x.method}),n.jsxs("p",{className:"text-[8px] sm:text-[10px] text-slate-400 font-bold uppercase truncate",children:["REF: ",x.reference," • ",x.date]})]})]}),n.jsxs("div",{className:"text-right ml-3 shrink-0",children:[n.jsxs("p",{className:"text-lg sm:text-2xl font-black text-emerald-600 tracking-tighter",children:["$",Number(x.amount).toFixed(2)]}),n.jsx("span",{className:"text-[8px] font-black uppercase tracking-widest text-emerald-500 bg-emerald-50 px-2 py-0.5 rounded-full border border-emerald-100",children:"OK"})]})]},m))})]}),n.jsx("div",{className:"space-y-6 sm:space-y-8",children:n.jsxs("div",{className:"bg-white p-8 sm:p-10 rounded-[2rem] sm:rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col relative overflow-hidden group min-h-[220px]",children:[n.jsxs("h3",{className:"text-lg sm:text-xl font-black flex items-center gap-3 tracking-tight text-slate-800 mb-6 sm:mb-8 relative z-10",children:[n.jsx(Tc,{className:"text-blue-600",size:20})," SALDO"]}),n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center relative z-10",children:[n.jsx("div",{className:`w-16 h-16 sm:w-20 sm:h-20 rounded-[1.5rem] sm:rounded-[2rem] flex items-center justify-center mb-5 sm:mb-6 shadow-xl transition-all duration-500 ${f?"bg-emerald-600 text-white shadow-emerald-200":"bg-blue-50 text-blue-600"}`,children:n.jsx(ha,{size:32})}),n.jsxs("div",{className:`text-4xl sm:text-5xl lg:text-6xl font-black tracking-tighter mb-2 ${f?"text-emerald-600":"text-slate-300"}`,children:["$",f?p.toLocaleString(void 0,{minimumFractionDigits:2}):"0.00"]}),n.jsx("p",{className:"text-slate-400 text-[8px] sm:text-[9px] font-black uppercase tracking-widest text-center max-w-[180px] leading-relaxed",children:f?"Crédito disponible para su próximo recibo.":"No posee créditos a favor."})]}),n.jsx("div",{className:"absolute right-[-10px] bottom-[-10px] opacity-[0.03] group-hover:opacity-[0.07] transition-opacity",children:n.jsx(Tc,{size:150})})]})})]}),n.jsx("style",{children:`
        @keyframes pulse-subtle {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.95; transform: scale(0.99); }
        }
        .animate-pulse-subtle {
            animation: pulse-subtle 3s infinite ease-in-out;
        }
      `})]})},zc=(e,t,r)=>{const a=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${e}</title>
    <style>
        body { 
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
            padding: 40px; 
            color: #1e293b; 
            background-color: #f8fafc;
            line-height: 1.5;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        header {
            text-align: center;
            margin-bottom: 40px;
            border-bottom: 4px solid #3b82f6;
            padding-bottom: 20px;
        }
        h1 { 
            margin: 0;
            font-size: 28px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: -0.025em;
            color: #0f172a;
        }
        .subtitle {
            font-size: 12px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-top: 8px;
        }
        table { 
            width: 100%; 
            border-collapse: collapse; 
            margin-top: 20px; 
            font-size: 13px;
        }
        th, td { 
            border: 1px solid #e2e8f0; 
            padding: 14px; 
            text-align: left; 
        }
        th { 
            background-color: #f1f5f9; 
            font-weight: 800; 
            text-transform: uppercase; 
            font-size: 11px; 
            color: #475569; 
            letter-spacing: 0.05em;
        }
        tr:nth-child(even) { background-color: #f8fafc; }
        tr:hover { background-color: #f1f5f9; }
        .footer { 
            margin-top: 50px; 
            padding-top: 20px;
            border-top: 1px solid #e2e8f0;
            font-size: 10px; 
            color: #94a3b8; 
            text-align: center; 
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .stamp {
            margin-top: 40px;
            display: flex;
            justify-content: flex-end;
        }
        .stamp-box {
            border: 2px solid #e2e8f0;
            padding: 20px;
            width: 200px;
            text-align: center;
            border-radius: 10px;
            color: #cbd5e1;
            font-size: 9px;
            font-weight: 900;
            text-transform: uppercase;
        }
        @media print {
            body { background: white; padding: 0; }
            .container { box-shadow: none; border: none; width: 100%; max-width: none; padding: 0; }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1>${e}</h1>
            <div class="subtitle">Condominio El Tejar - Reporte Oficial de Gestión</div>
        </header>
        <table>
            <thead>
                <tr>
                    ${t.map(o=>`<th>${o}</th>`).join("")}
                </tr>
            </thead>
            <tbody>
                ${r.map(o=>`
                    <tr>
                        ${o.map(d=>`<td>${d||""}</td>`).join("")}
                    </tr>
                `).join("")}
            </tbody>
        </table>
        <div class="stamp">
            <div class="stamp-box">
                Sello de Auditoría<br>SAC 2026
            </div>
        </div>
        <div class="footer">
            Generado por SAC - Kernel V4.1.55 MC/MB - ${new Date().toLocaleString("es-VE")}
            <br>ID: ${Math.random().toString(36).substring(2,15).toUpperCase()}
        </div>
    </div>
</body>
</html>
    `,s=new Blob([a],{type:"text/html"}),i=URL.createObjectURL(s),l=document.createElement("a");l.href=i,l.download=`${e.replace(/\s+/g,"_")}_${new Date().getTime()}.html`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(i)},Rde=({user:e})=>{const{transactions:t,refreshData:r,exchangeRateHistory:a,loading:s,financialTotals:i,properties:l}=ht(),[o,d]=j.useState(new Date().getMonth()),[u,f]=j.useState(new Date().getFullYear()),[p,x]=j.useState(""),[m,b]=j.useState(!1),[v,y]=j.useState(!1),[k,_]=j.useState(!1),[C,E]=j.useState(!1),[T,B]=j.useState(null),[I,M]=j.useState({income:1.5,expense:.3}),[U,D]=j.useState(!1),[L,R]=j.useState({type:"Ingreso",category:"Ingresos",date:Er(),amountBs:0,description:"",reference:""}),[Q,G]=j.useState({propertyId:"",amountBs:0,date:Er(),reference:"",description:"ABONO DIRECTO A SALDO A FAVOR"});j.useEffect(()=>{(async()=>{const J=await we.getSystemSettings();M({income:parseFloat(J.bank_comm_income||"1.5"),expense:parseFloat(J.bank_comm_expense||"0.3")})})()},[]);const K=j.useMemo(()=>{if(!a||a.length===0)return 45;const H=a[0],J=Number(H.pmValue)>0?Number(H.pmValue):Number(H.amValue)>0?Number(H.amValue):45;return Number(J)},[a]),W=H=>{if(!a||a.length===0)return 45;const J=a.find(ne=>ne.date===H);if(J)return Number(J.pmValue)>0?Number(J.pmValue):Number(J.amValue);const ae=[...a].sort((ne,le)=>le.date.localeCompare(ne.date)),oe=ae.find(ne=>ne.date<H);if(oe)return Number(oe.pmValue)>0?Number(oe.pmValue):Number(oe.amValue);const ce=ae[ae.length-1];return Number(ce.pmValue)>0?Number(ce.pmValue):Number(ce.amValue)},z=j.useMemo(()=>t.reduce((H,J)=>{if(J.category==="Cierre/Apertura")return H;const ae=Number(J.amountBs)||0;return J.type==="Ingreso"?H+ae:H-ae},0),[t]),Z=j.useMemo(()=>t.filter(H=>{var ne;const[J,ae]=H.date.split("-").map(Number),oe=J===u&&ae-1===o,ce=!p||H.description.toLowerCase().includes(p.toLowerCase())||((ne=H.reference)==null?void 0:ne.toLowerCase().includes(p.toLowerCase()));return oe&&ce}).sort((H,J)=>new Date(J.date).getTime()-new Date(H.date).getTime()),[t,o,u,p]),Y=async H=>{H.preventDefault(),D(!0);try{const J=W(L.date||Er()),ae={...L,amount:(Number(L.amountBs)||0)/J,commissionsConfig:I},oe=await fetch(`${ye}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ae)});if(oe.ok)await r(),b(!1),R({type:"Ingreso",category:"Ingresos",date:Er(),amountBs:0,description:"",reference:""});else{const ce=await oe.json();alert(`Error: ${ce.error||"No se pudo guardar"}`)}}catch{alert("Error de conexión al registrar movimiento.")}finally{D(!1)}},te=async()=>{if(!L.amountBs||L.amountBs<=0){alert("Por favor ingrese un monto de apertura válido.");return}D(!0);try{const H=W(L.date||Er()),J={date:L.date,category:"Apertura",description:"SALDO INICIAL GESTIÓN ADMINISTRATIVA",reference:"OPENING",amountBs:L.amountBs,amount:(Number(L.amountBs)||0)/H,type:"Ingreso"},ae=await fetch(`${ye}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(ae.ok)await r(),_(!1),alert("Saldo inicial sellado correctamente.");else{const oe=await ae.json();alert(`Error del servidor: ${oe.error}`)}}catch{alert("Error al conectar con el servidor.")}finally{D(!1)}},O=async H=>{try{(await fetch(`${ye}/delete_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:H})})).ok&&(await r(),B(null))}catch{alert("Error al eliminar.")}},P=async H=>{if(H.preventDefault(),!Q.propertyId||!Q.amountBs||Q.amountBs<=0){alert("Por favor complete todos los campos correctamente.");return}D(!0);try{const J=W(Q.date||Er()),ae=l.find(ne=>ne.id===parseInt(Q.propertyId)),oe={date:Q.date,description:`${Q.description}: ${(ae==null?void 0:ae.code)||""}`,amountBs:Q.amountBs,amount:(Number(Q.amountBs)||0)/J,type:"Ingreso",category:"Ingresos",reference:Q.reference,propertyId:parseInt(Q.propertyId),isCredit:!0,commissionsConfig:I},ce=await fetch(`${ye}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(oe)});if(ce.ok)await r(),E(!1),G({propertyId:"",amountBs:0,date:Er(),reference:"",description:"ABONO DIRECTO A SALDO A FAVOR"}),alert("Saldo a favor registrado y comisión bancaria aplicada.");else{const ne=await ce.json();alert(`Error: ${ne.error||"No se pudo guardar"}`)}}catch{alert("Error de conexión al registrar saldo a favor.")}finally{D(!1)}},q=async()=>{D(!0);try{await we.updateSystemSetting("bank_comm_income",String(I.income)),await we.updateSystemSetting("bank_comm_expense",String(I.expense)),alert("Porcentajes de comisión actualizados."),y(!1)}catch{alert("Error al guardar configuración.")}finally{D(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-24 no-print",children:[n.jsxs("div",{className:"bg-[#1e293b] text-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl relative overflow-hidden group border-b-8 border-slate-900",children:[n.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row justify-between items-start gap-10",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-500/20",children:n.jsx(xr,{size:22})}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.4em] text-blue-400",children:"Estado de Cuenta Consolidado"})]}),n.jsxs("h3",{className:"text-6xl lg:text-7xl font-black tracking-tighter",children:["Bs. ",Number(z).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsxs("p",{className:"text-sm font-bold text-slate-400 uppercase tracking-widest",children:["Equivalente USD: ",n.jsxs("span",{className:"text-emerald-400 font-black",children:["$",(Number(z)/K).toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),(i==null?void 0:i.reserveFundBs)!==void 0&&n.jsxs("div",{className:"bg-indigo-900/40 border border-indigo-500/30 px-6 py-3 rounded-2xl flex items-center gap-4 shadow-xl backdrop-blur-sm animate-in zoom-in-95 duration-700",children:[n.jsx("div",{className:"p-2 bg-indigo-600 rounded-lg text-white",children:n.jsx(Ea,{size:18})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black text-indigo-300 uppercase tracking-widest mb-0.5",children:"Reserva Nominal (Estática en VES)"}),n.jsxs("p",{className:"text-sm font-black text-white leading-none",children:["Bs. ",Number(i.reserveFundBs).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("p",{className:"text-[7px] font-bold text-indigo-400 uppercase mt-1",children:["Valor Depreciado: $",i.reserveFundUsd.toFixed(2)," USD"]})]})]})]}),n.jsxs("p",{className:"text-[9px] text-slate-500 font-bold uppercase tracking-widest mt-4",children:["Tasa del día (Ref): ",Number(K).toFixed(2)," Bs/$"]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 w-full md:w-auto self-center md:self-auto",children:[n.jsxs("button",{onClick:()=>y(!0),className:"flex-1 bg-slate-800 hover:bg-slate-700 text-slate-300 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest border border-slate-700 transition-all flex items-center justify-center gap-2",children:[n.jsx(ps,{size:16})," Comisiones"]}),n.jsxs("button",{onClick:()=>_(!0),className:"flex-1 bg-white text-slate-900 px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:scale-105 active:scale-95 transition-all shadow-xl flex items-center justify-center gap-2",children:[n.jsx(Lr,{size:16})," Saldo Inicial"]})]})]}),n.jsx(La,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none group-hover:scale-110 transition-transform duration-[10s]"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-end gap-6 bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"w-full lg:w-auto space-y-4",children:[n.jsxs("h2",{className:"text-2xl font-black text-slate-900 tracking-tight flex items-center gap-3",children:[n.jsx($i,{className:"text-blue-600"})," Libro Diario Bancario (VES)"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"bg-slate-100 p-1.5 rounded-xl flex gap-1 border border-slate-200",children:[n.jsx("select",{value:o,onChange:H=>d(Number(H.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-3 py-1 cursor-pointer",children:Ue.map((H,J)=>n.jsx("option",{value:J,children:H},J))}),n.jsx("div",{className:"w-px h-4 bg-slate-300 self-center"}),n.jsx("input",{type:"number",value:u,onChange:H=>f(Number(H.target.value)),className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-16 text-center"})]}),n.jsxs("div",{className:"relative flex-1 sm:w-64",children:[n.jsx(Xt,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:14}),n.jsx("input",{type:"text",placeholder:"Buscar por concepto o ref...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-9 pr-4 py-2 text-xs font-bold text-slate-800 focus:ring-2 focus:ring-blue-100 transition-all",value:p,onChange:H=>x(H.target.value)})]})]})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsxs("button",{onClick:()=>E(!0),className:"flex-1 lg:flex-none bg-emerald-600 hover:bg-emerald-700 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl shadow-emerald-500/20 transition-all active:scale-95 flex items-center justify-center gap-2",children:[n.jsx(xr,{size:18})," Abonar Saldo a Favor"]}),n.jsxs("button",{onClick:()=>{const H=["Fecha","Referencia","Descripción","Categoría","Monto USD","Monto VES"],J=Z.map(ae=>[ae.date,ae.reference||"S/R",ae.description,ae.category,`$${Number(ae.amount).toFixed(2)}`,`Bs. ${Number(ae.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})}`]);zc("Estado de Cuenta Bancario",H,J)},className:"flex-1 lg:flex-none bg-slate-100 text-slate-500 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all flex items-center justify-center gap-2",title:"Exportar a HTML",children:[n.jsx(gr,{size:18})," Exportar HTML"]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 lg:flex-none bg-slate-100 text-slate-500 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all flex items-center justify-center gap-2",children:[n.jsx(yt,{size:18})," Imprimir Estado"]}),n.jsxs("button",{onClick:()=>b(!0),className:"flex-[2] lg:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl shadow-blue-500/20 transition-all active:scale-95 flex items-center justify-center gap-2",children:[n.jsx(Cn,{size:18})," Registrar Movimiento"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Concepto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Categoría"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:Z.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:6,className:"py-24 text-center",children:[n.jsx(xr,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"Sin movimientos registrados para este periodo"})]})}):Z.map(H=>{const J=W(H.date),ae=Number(H.amountBs)/Number(J);return n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-all group ${H.category==="Cierre/Apertura"?"bg-blue-50/20":""}`,children:[n.jsx("td",{className:"px-8 py-6 text-xs font-black text-slate-400 whitespace-nowrap",children:H.date}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${H.category==="Cierre/Apertura"?"bg-slate-900 text-white":H.type==="Ingreso"?"bg-emerald-50 text-emerald-600":"bg-red-50 text-red-600"}`,children:H.category==="Cierre/Apertura"?n.jsx(ot,{size:18}):H.type==="Ingreso"?n.jsx(ha,{size:18}):n.jsx(db,{size:18})}),n.jsxs("div",{children:[n.jsx("p",{className:`font-black text-sm leading-tight uppercase ${H.category==="Cierre/Apertura"?"text-blue-600":"text-slate-800"}`,children:H.description}),H.category==="Cierre/Apertura"&&n.jsx("p",{className:"text-[9px] text-blue-500 font-black uppercase mt-0.5 tracking-tighter",children:"Asiento Informativo de Balance"})]})]})}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest ${H.category==="Cierre/Apertura"?"bg-blue-600 text-white":"bg-slate-100 text-slate-500"}`,children:H.category})}),n.jsxs("td",{className:"px-8 py-6 text-right",children:[n.jsxs("div",{className:`font-black text-lg tracking-tighter ${H.category==="Cierre/Apertura"?"text-slate-900":H.type==="Ingreso"?"text-emerald-600":"text-rose-600"}`,children:[H.category==="Cierre/Apertura"?"":H.type==="Ingreso"?"+":"-"," Bs. ",Number(H.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("div",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-tighter",title:`Tasa aplicada de ese día: ${Number(J).toFixed(2)} Bs/$`,children:["Ref: $",ae.toLocaleString(void 0,{minimumFractionDigits:2})," USD"]})]}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsx("span",{className:`font-mono text-xs font-black bg-slate-50 px-3 py-1 rounded-lg border border-slate-100 ${H.category==="Cierre/Apertura"?"text-blue-600 border-blue-200":"text-slate-400"}`,children:H.reference||"S/R"})}),n.jsx("td",{className:"px-8 py-6 text-right",children:T===H.id?n.jsxs("div",{className:"flex justify-end gap-2 animate-in slide-in-from-right-2",children:[n.jsx("button",{onClick:()=>O(H.id),className:"bg-red-600 text-white px-4 py-2 rounded-lg text-[9px] font-black uppercase",children:"¿Seguro?"}),n.jsx("button",{onClick:()=>B(null),className:"bg-slate-200 text-slate-600 px-4 py-2 rounded-lg text-[9px] font-black uppercase",children:"No"})]}):H.category!=="Cierre/Apertura"&&n.jsx("button",{onClick:()=>B(H.id),className:"p-3 bg-slate-50 text-slate-300 hover:bg-red-50 hover:text-red-600 rounded-xl transition-all opacity-0 group-hover:opacity-100",children:n.jsx(Ta,{size:16})})})]},H.id)})})]})})}),m&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Nuevo Asiento Bancario"}),n.jsx("button",{onClick:()=>b(!1),className:"p-3 bg-slate-100 rounded-full text-slate-400 hover:text-red-500 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:Y,className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Tipo de Operación"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{type:"button",onClick:()=>R({...L,type:"Ingreso",category:"Ingresos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${L.type==="Ingreso"?"bg-emerald-600 text-white border-emerald-600 shadow-xl":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Ingreso"}),n.jsx("button",{type:"button",onClick:()=>R({...L,type:"Egreso",category:"Gastos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${L.type==="Egreso"?"bg-rose-600 text-white border-rose-600 shadow-xl":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Egreso"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción / Concepto"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none focus:ring-2 focus:ring-blue-600",value:L.description,onChange:H=>R({...L,description:H.target.value.toUpperCase()}),placeholder:"EJ: PAGO PROVEEDOR AGUA"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Fecha Valor"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-900 text-xs",value:L.date,onChange:H=>R({...L,date:H.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-900 text-xs",value:L.reference,onChange:H=>R({...L,reference:H.target.value}),placeholder:"000000"})]})]}),n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-8 rounded-[2.5rem] space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-blue-600 tracking-widest ml-1 block text-center",children:"Monto en Bolívares (VES)"}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full bg-white rounded-2xl px-6 py-5 text-3xl font-black text-slate-900 outline-none border-2 border-blue-100 focus:border-blue-500 shadow-inner",value:L.amountBs||"",onChange:H=>R({...L,amountBs:parseFloat(H.target.value)}),placeholder:"0,00"}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[10px] font-black text-blue-400 uppercase",children:"Equivalente Estimado:"}),n.jsxs("span",{className:"text-xl font-black text-blue-600",children:["$",((Number(L.amountBs)||0)/W(L.date||Er())).toFixed(2)," USD"]})]})]}),n.jsxs("button",{disabled:U,type:"submit",className:"w-full bg-slate-900 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3",children:[U?n.jsx(ot,{className:"animate-spin"}):n.jsx(qn,{size:18}),"PROCESAR ASIENTO"]})]})]})}),v&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-sm shadow-2xl animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900",children:"Parámetros Bancarios"}),n.jsx("button",{onClick:()=>y(!1),children:n.jsx(ft,{})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Comisión Ingresos (%)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-blue-600",value:I.income,onChange:H=>M({...I,income:parseFloat(H.target.value)})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Comisión Egresos (%)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-rose-600",value:I.expense,onChange:H=>M({...I,expense:parseFloat(H.target.value)})})]}),n.jsx("button",{disabled:U,onClick:q,className:"w-full bg-blue-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 active:scale-95",children:U?"GUARDANDO...":"ACTUALIZAR POLÍTICA"})]})]})}),k&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-sm shadow-2xl animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900",children:"Apertura Fiscal"}),n.jsx("button",{onClick:()=>_(!1),children:n.jsx(ft,{})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed",children:"Declare el monto en banco al momento de iniciar esta gestión. Este registro se guardará como 'APERTURA'."}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Fecha de Inicio Fiscal"}),n.jsx("input",{type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black",value:L.date,onChange:H=>R({...L,date:H.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Saldo de Apertura (Bs.)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-2xl",value:L.amountBs||"",onChange:H=>R({...L,amountBs:parseFloat(H.target.value)}),placeholder:"0,00"})]}),n.jsx("button",{disabled:U,onClick:te,className:"w-full bg-slate-900 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-slate-300 active:scale-95 transition-all",children:U?"PROCESANDO...":"SELLAR SALDO DE APERTURA"})]})]})}),C&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 overflow-y-auto max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tight",children:"Abonar Saldo a Favor"}),n.jsx("button",{onClick:()=>E(!1),className:"p-2 bg-slate-100 rounded-full text-slate-400 hover:text-red-500 transition-colors",children:n.jsx(ft,{size:20})})]}),n.jsxs("form",{onSubmit:P,className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Unidad / Inmueble"}),n.jsxs("select",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-600",value:Q.propertyId,onChange:H=>G({...Q,propertyId:H.target.value}),children:[n.jsx("option",{value:"",children:"Seleccione Unidad"}),l.sort((H,J)=>H.code.localeCompare(J.code)).map(H=>n.jsx("option",{value:H.id,children:H.code},H.id))]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Fecha"}),n.jsx("input",{type:"date",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-xs outline-none focus:ring-2 focus:ring-blue-600",value:Q.date,onChange:H=>G({...Q,date:H.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Referencia Bancaria"}),n.jsx("input",{type:"text",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-xs outline-none focus:ring-2 focus:ring-blue-600",value:Q.reference,onChange:H=>G({...Q,reference:H.target.value}),placeholder:"Nro. Ref"})]})]}),n.jsxs("div",{className:"bg-emerald-50 border border-emerald-100 p-8 rounded-[2.5rem] space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-emerald-600 tracking-widest ml-1 block text-center",children:"Monto en Bolívares (Bs.)"}),n.jsx("input",{type:"number",step:"0.01",required:!0,className:"w-full bg-white rounded-2xl px-6 py-5 text-3xl font-black text-emerald-600 outline-none border-2 border-emerald-100 focus:border-emerald-500 shadow-inner",value:Q.amountBs||"",onChange:H=>G({...Q,amountBs:parseFloat(H.target.value)}),placeholder:"0,00"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Descripción"}),n.jsx("input",{type:"text",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none focus:ring-2 focus:ring-blue-600",value:Q.description,onChange:H=>G({...Q,description:H.target.value.toUpperCase()})})]}),n.jsxs("div",{className:"flex items-start gap-3 p-4 bg-blue-50 rounded-2xl border border-blue-100",children:[n.jsx(ps,{size:16,className:"text-blue-600 mt-1 flex-shrink-0"}),n.jsxs("p",{className:"text-[10px] text-blue-700 font-bold leading-relaxed",children:["Se generará automáticamente el egreso por comisión bancaria (",I.income,"%) con la misma referencia."]})]}),n.jsx("button",{disabled:U,type:"submit",className:"w-full bg-emerald-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-emerald-500/20 active:scale-95 transition-all",children:U?"PROCESANDO...":"REGISTRAR ABONO"})]})]})})]})},ar=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},_g=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},Ode=()=>{const{properties:e,residents:t}=ht(),r=j.useMemo(()=>e.filter(a=>Number(a.initialDebt)>0).map(a=>{const s=t.find(i=>i.propertyId===a.id&&i.isOwner);return{...a,ownerName:(s==null?void 0:s.fullName)||"Sin Asignar"}}).sort((a,s)=>s.initialDebt-a.initialDebt),[e,t]);return r.length===0?null:n.jsxs("div",{className:"bg-slate-900 rounded-[3rem] p-8 lg:p-12 text-white shadow-2xl relative overflow-hidden animate-in fade-in duration-1000 mb-12",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[n.jsx("div",{className:"w-12 h-12 bg-amber-500 rounded-2xl flex items-center justify-center text-white shadow-lg shadow-amber-500/20",children:n.jsx(na,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black tracking-tight uppercase",children:"Monitor de Convenios de Pago"}),n.jsx("p",{className:"text-amber-400 font-bold text-[10px] uppercase tracking-widest",children:"Protocolo de Recuperación de Deuda Histórica V4.0.70"})]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(a=>n.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 rounded-[2rem] hover:bg-white/10 transition-all group",children:[n.jsxs("div",{className:"flex justify-between items-start mb-4",children:[n.jsx("span",{className:"bg-amber-500 text-slate-900 px-3 py-1 rounded-lg text-[10px] font-black uppercase tracking-tighter",children:"EN CONVENIO"}),n.jsx("span",{className:"text-2xl font-black text-white",children:a.code})]}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest truncate",children:a.ownerName}),n.jsxs("div",{className:"mt-6 pt-4 border-t border-white/5",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Saldo Histórico Pendiente"}),n.jsxs("p",{className:"text-xl font-black text-amber-400",children:["$",ar(a.initialDebt)]})]}),n.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[n.jsxs("div",{className:"flex-1 h-1.5 bg-white/5 rounded-full overflow-hidden",children:[n.jsx("div",{className:"h-full bg-amber-500 w-1/3 animate-pulse"})," "]}),n.jsx("span",{className:"text-[8px] font-black text-amber-500/50 uppercase",children:"Auditando..."})]})]},a.id))})]}),n.jsx(xr,{size:200,className:"absolute right-[-40px] bottom-[-40px] text-white/[0.03] pointer-events-none"})]})},Pde=({onCancel:e,existingFee:t,onTabChange:r})=>{const{addFee:a,exchangeRateHistory:s,properties:i,refreshData:l}=ht(),[o,d]=j.useState(!1),[u,f]=j.useState(!1),p=()=>{if(!s||s.length===0)return 45.5;const O=s[0];return Number(O.pmValue)>0?Number(O.pmValue):Number(O.amValue)},[x,m]=j.useState((t==null?void 0:t.month)??new Date().getMonth()),[b,v]=j.useState((t==null?void 0:t.year)??new Date().getFullYear()),[y,k]=j.useState((t==null?void 0:t.exchangeRate)??p()),_=O=>Array(O).fill(null).map(()=>({description:"",amountUsd:0,isUncommon:!1,isSpecial:!1,specialPropertyIds:[]})),[C,E]=j.useState(t?[...t.fixedExpenses,..._(Math.max(0,20-t.fixedExpenses.length))]:_(20)),[T,B]=j.useState(t?[...t.variableExpenses,..._(Math.max(0,15-t.variableExpenses.length))]:_(15)),[I,M]=j.useState(t?[...t.otherExpenses,..._(Math.max(0,8-t.otherExpenses.length))]:_(8)),[U,D]=j.useState((t==null?void 0:t.reserveFundPercent)??10),L=async()=>{f(!0);try{const P=await(await fetch(`${ye}/get_prefill_expenses.php?month=${x}&year=${b}`,{credentials:"include"})).json();if(Array.isArray(P)){if(P.length===0){alert("No se encontraron facturas marcadas para pre-llenado en este periodo.");return}const q=P.filter(ae=>ae.category==="fixed"),H=P.filter(ae=>ae.category==="variable"),J=P.filter(ae=>ae.category==="other");E([...q,..._(Math.max(0,20-q.length))]),B([...H,..._(Math.max(0,15-H.length))]),M([...J,..._(Math.max(0,8-J.length))]),alert(`¡Importación Exitosa! Se cargaron ${P.length} conceptos.`)}}catch{alert("Error al importar datos.")}finally{f(!1)}},R=(O,P,q,H,J)=>{const ae=[...H];ae[O]={...ae[O],[P]:q},J(ae)},Q=(O,P,q,H)=>{const J=[...q],ae=J[O].specialPropertyIds||[];ae.includes(P)?J[O].specialPropertyIds=ae.filter(oe=>oe!==P):J[O].specialPropertyIds=[...ae,P],H(J)},G=O=>O.reduce((P,q)=>P+(Number(q.amountUsd)||0),0),K=Number(G(C))+Number(G(T))+Number(G(I)),W=Number(K)*(Number(U)/100),z=Number(K)+Number(W),Z=Number(z)*Number(y),Y=async()=>{if(Math.abs(z)<.01&&z!==0){alert("Monto total inválido.");return}if(confirm(`¿Generar cuota para ${Ue[x]} ${b}?`)){d(!0);try{await a({id:(t==null?void 0:t.id)||`fee-${x}-${b}-${Date.now()}`,month:x,year:b,exchangeRate:y,fixedExpenses:C.filter(O=>O.description&&Number(O.amountUsd)!==0),variableExpenses:T.filter(O=>O.description&&Number(O.amountUsd)!==0),otherExpenses:I.filter(O=>O.description&&Number(O.amountUsd)!==0),reserveFundPercent:U,totalUsd:z,totalBs:Z,status:"Generada",createdAt:(t==null?void 0:t.createdAt)||Er()}),alert("¡Facturación Generada con Éxito!"),r?r("view-fees"):e()}catch(O){alert("Error: "+O.message)}finally{d(!1)}}},te=j.useMemo(()=>[...i].sort((O,P)=>O.code.localeCompare(P.code,void 0,{numeric:!0})),[i]);return n.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-sm border border-slate-200 p-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-8 border-b pb-6 gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx(mi,{size:24})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Generación de Facturación"}),n.jsx("p",{className:"text-slate-400 text-xs font-bold uppercase tracking-widest",children:"Periodo de Gestión"})]})]}),n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsxs("button",{onClick:L,disabled:u,className:"bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white px-6 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-sm flex items-center justify-center gap-3 active:scale-95 disabled:opacity-50",children:[u?n.jsx(ot,{className:"animate-spin",size:16}):n.jsx(sa,{size:16})," PRE-CARGAR DESDE BALANCE"]}),n.jsx("button",{onClick:e,className:"p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-slate-200 transition-all",children:n.jsx(ft,{size:20})})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-5 gap-6 mb-10 bg-slate-50 p-6 rounded-[2rem] border border-slate-100",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Mes"}),n.jsx("select",{value:x,onChange:O=>m(Number(O.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-bold text-slate-700 outline-none text-sm",children:Ue.map((O,P)=>n.jsx("option",{value:P,children:O},P))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Año"}),n.jsx("input",{type:"number",value:b,onChange:O=>v(Number(O.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-bold text-slate-700 outline-none text-sm"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Tasa (Bs)"}),n.jsx("input",{type:"number",step:"0.01",value:y,onChange:O=>k(Number(O.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-black text-blue-600 outline-none text-sm"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Reserva (%)"}),n.jsx("input",{type:"number",value:U,onChange:O=>D(Number(O.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-bold text-slate-700 outline-none text-sm"})]}),n.jsxs("div",{className:"flex items-end",children:[n.jsx("button",{type:"button",onClick:()=>{const O=[...C];O[0].specialPropertyIds=i.map(P=>P.id),E(O)},className:"hidden",children:"Trigger"}),n.jsxs("button",{disabled:o,onClick:Y,className:"w-full bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-2xl font-black shadow-xl shadow-blue-600/20 flex items-center justify-center gap-3 active:scale-95 transition-all disabled:opacity-50 text-xs",children:[o?n.jsx(ot,{className:"animate-spin",size:16}):n.jsx(qn,{size:16})," ",o?"PROCESANDO...":"GENERAR CUOTA"]})]})]}),n.jsx("div",{className:"space-y-12",children:[{title:"Gastos Fijos",data:C,setter:E},{title:"Gastos Variables",data:T,setter:B},{title:"Otros Gastos",data:I,setter:M}].map((O,P)=>n.jsxs("div",{children:[n.jsxs("div",{className:"flex justify-between items-center mb-4 border-b pb-2 px-1",children:[n.jsx("h3",{className:"text-lg font-black text-slate-800 uppercase tracking-tight",children:O.title}),n.jsxs("div",{className:"flex gap-8 text-[9px] font-black text-slate-400 uppercase tracking-widest",children:[n.jsx("span",{className:"w-10 text-center",children:"GNC"}),n.jsx("span",{className:"text-center",children:"ESP"}),n.jsx("span",{className:"w-32 text-right",children:"USD"})]})]}),n.jsx("div",{className:"space-y-3",children:O.data.map((q,H)=>n.jsxs("div",{className:"flex flex-col gap-2 p-1 rounded-2xl hover:bg-slate-50/50 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-4 group",children:[n.jsx("span",{className:"text-[9px] font-bold text-slate-300 w-4",children:H+1}),n.jsx("input",{placeholder:"Descripción...",className:"flex-1 bg-slate-50 border border-slate-200 rounded-xl px-4 py-2 text-sm focus:bg-white focus:ring-2 focus:ring-blue-100 outline-none transition-all",value:q.description,onChange:J=>R(H,"description",J.target.value,O.data,O.setter)}),n.jsx("div",{className:"w-10 flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>R(H,"isUncommon",!q.isUncommon,O.data,O.setter),className:`w-8 h-8 rounded-xl border transition-all flex items-center justify-center ${q.isUncommon?"bg-indigo-600 border-indigo-600 text-white shadow-lg":"bg-white border-slate-200 text-slate-200 hover:text-slate-400"}`,children:n.jsx(Lc,{size:14,fill:q.isUncommon?"currentColor":"none"})})}),n.jsx("div",{className:"w-10 flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>R(H,"isSpecial",!q.isSpecial,O.data,O.setter),className:`w-8 h-8 rounded-xl border transition-all flex items-center justify-center ${q.isSpecial?"bg-amber-500 border-amber-500 text-white shadow-lg":"bg-white border-slate-200 text-slate-200 hover:text-slate-400"}`,children:n.jsx(cb,{size:14})})}),n.jsx("input",{type:"number",step:"0.01",className:`w-32 border rounded-xl px-4 py-2 text-sm text-right font-black group-hover:bg-blue-50 transition-all outline-none ${Number(q.amountUsd)<0?"bg-rose-50 border-rose-200 text-rose-600":"bg-slate-50 border-slate-200 text-slate-800"}`,value:q.amountUsd||"",onChange:J=>R(H,"amountUsd",Number(J.target.value),O.data,O.setter)})]}),q.isSpecial&&n.jsxs("div",{className:"ml-8 p-6 bg-amber-50/50 border border-amber-100 rounded-[2rem] animate-in slide-in-from-top-2 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsxs("h4",{className:"text-[10px] font-black text-amber-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(lk,{size:14})," Seleccionar Unidades"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>{const J=[...O.data];J[H].specialPropertyIds=i.map(ae=>ae.id),O.setter(J)},className:"text-[9px] font-black text-blue-600 uppercase tracking-tighter hover:underline",children:"Marcar Todas"}),n.jsx("span",{className:"text-slate-300 text-[9px]",children:"|"}),n.jsx("button",{type:"button",onClick:()=>R(H,"specialPropertyIds",[],O.data,O.setter),className:"text-[9px] font-black text-slate-400 uppercase tracking-tighter hover:underline",children:"Limpiar"})]})]}),n.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-6 md:grid-cols-10 gap-2",children:te.map(J=>{var oe;const ae=(oe=q.specialPropertyIds)==null?void 0:oe.includes(J.id);return n.jsx("button",{type:"button",onClick:()=>Q(H,J.id,O.data,O.setter),className:`py-2 rounded-xl text-[9px] font-black uppercase transition-all border shadow-sm ${ae?"bg-amber-500 border-amber-500 text-white":"bg-white border-slate-200 text-slate-400 hover:border-amber-300 hover:text-amber-600"}`,children:J.code},J.id)})})]})]},H))})]},P))})]})},Lde=({user:e,onEdit:t,onTabChange:r})=>{const{fees:a,deleteFee:s,exchangeRateHistory:i,properties:l}=ht(),[o,d]=j.useState(null),u=["admin","programmer","board"].includes(e.role),f=j.useMemo(()=>{if(!i||i.length===0)return 45;const x=i[0];return Number(x.pmValue)>0?Number(x.pmValue):Number(x.amValue)},[i]),p=j.useMemo(()=>a.find(x=>x.id===o)||null,[a,o]);return p?n.jsx($de,{fee:p,user:e,onBack:()=>d(null)}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-12 px-1",children:[n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tight uppercase",children:"Control de Recaudación"}),u&&n.jsx(Ode,{}),n.jsx("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Periodo"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Facturación Total"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Recaudación"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Tasa Sello"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a.map(x=>{const m=Number(x.totalUsd)||0,b=(x.debts||[]).reduce((y,k)=>y+(Number(k.paidAmount)||0),0),v=m>0?Math.min(100,Math.round(b/m*100)):0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-1",children:x.year}),n.jsx("span",{className:"font-black text-slate-800 text-lg uppercase tracking-tight",children:Ue[x.month]})]}),n.jsxs("td",{className:"px-8 py-6 text-center",children:[n.jsxs("span",{className:"text-2xl font-black text-slate-900 tracking-tighter",children:["$",ar(m)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase mt-0.5",children:["≈ Bs. ",_g(m*f)]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"w-full max-w-[140px] mx-auto space-y-1.5",children:[n.jsxs("div",{className:"flex justify-between items-center text-[9px] font-black uppercase tracking-tighter",children:[n.jsxs("span",{className:"text-emerald-600",children:["$",ar(b)]}),n.jsxs("span",{className:"text-slate-400",children:[v,"%"]})]}),n.jsx("div",{className:"w-full bg-slate-100 h-2.5 rounded-full overflow-hidden border border-slate-100",children:n.jsx("div",{className:`h-full transition-all duration-1000 shadow-sm ${v>=100?"bg-emerald-50":v>50?"bg-blue-50":"bg-amber-50"}`,style:{width:`${v}%`}})})]})}),n.jsxs("td",{className:"px-8 py-6 text-right font-mono font-black text-blue-600 text-xs",children:[Number(x.exchangeRate).toFixed(2)," Bs"]}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>d(x.id),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(_c,{size:18})}),u&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>t(x),className:"p-3 bg-indigo-50 text-indigo-600 rounded-xl hover:bg-indigo-600 hover:text-white transition-all shadow-sm",children:n.jsx(vl,{size:18})}),n.jsx("button",{onClick:()=>{confirm("¿Eliminar?")&&s(x.id)},className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ta,{size:18})})]})]})})]},x.id)})})]})})})]})},y5=({feeId:e,propertyId:t,feeRate:r,currentBalance:a,availableCredit:s,isOwnerReporting:i=!1,existingPayment:l,onSuccess:o})=>{const{registerPayment:d,updatePayment:u,exchangeRateHistory:f,refreshData:p,properties:x}=ht(),[m,b]=j.useState(l?(Number(l.amount)*(l.appliedRate||r)).toString():""),[v,y]=j.useState((l==null?void 0:l.method)||"Transferencia Bancaria"),[k,_]=j.useState("pm"),[C,E]=j.useState((l==null?void 0:l.reference)||""),[T,B]=j.useState((l==null?void 0:l.date)||Er()),[I,M]=j.useState(!1),[U,D]=j.useState(null),[L,R]=j.useState(!1),Q=async O=>{if(!(!O||O==="S/R"||O.length<3))try{const q=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${O}`,{credentials:"include"})).json();q.duplicate?D(q):D(null)}catch(P){console.error("Error checking duplicate",P)}},G=j.useMemo(()=>x.find(O=>O.id===t),[x,t]),K=Number((G==null?void 0:G.initialDebt)||0),W=Number((G==null?void 0:G.creditBalance)||0),z=j.useMemo(()=>{const O=f.find(q=>q.date===T);if(!O)return Number(r);if(k==="parallel")return Number(O.parallelValue)||Number(r);if(k==="am")return Number(O.amValue)||Number(O.pmValue)||Number(r);const P=Number(O.pmValue)>0?O.pmValue:O.amValue;return Number(P)||Number(r)},[T,f,r,k]),Z=Number(m)>0?Number(m)/Number(z):0,Y=Math.max(0,Z-a),te=async O=>{if(O.preventDefault(),U&&!L)if(i){alert("ATENCIÓN: Este número de transferencia ya existe en el sistema. Por favor, verifique nuevamente. Si el código es correcto y el problema persiste, debe enviar el pago directamente a la administración para su procesamiento manual.");return}else{alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}const P=Number(m);if(isNaN(P)||P<=0){alert("Monto inválido.");return}if(!C&&v!=="Efectivo / Divisa"){alert("Referencia obligatoria.");return}M(!0);try{if(i&&!l){const q=await fetch(`${ye}/report_payment_owner.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e,propertyId:t,amountBs:P,amount:Number(Z.toFixed(2)),method:v,reference:C||"EFECTIVO",date:T,slot:k})}),H=await q.json();if(!q.ok)throw new Error(H.error||"Fallo al reportar");await p(),alert("¡Reporte enviado exitosamente! La administración revisará su comprobante.")}else l?(await u(e,t,{...l,amount:Number(Z.toFixed(2)),method:v,reference:C||"EFECTIVO",date:T,slot:k}),alert("¡Pago Actualizado con Éxito!")):(await d(e,t,Number(Z.toFixed(2)),v,C||"EFECTIVO",T,k,P),alert("¡Pago Registrado Directamente!"));o()}catch(q){alert("ERROR: "+(q.message||"Fallo de red."))}finally{M(!1)}};return n.jsxs("form",{onSubmit:te,className:"space-y-6",children:[n.jsxs("div",{className:"space-y-3",children:[K>0&&n.jsxs("div",{className:"flex items-start gap-4 p-5 bg-red-600 text-white rounded-[2rem] shadow-2xl animate-in zoom-in-95 relative overflow-hidden",children:[n.jsx("div",{className:"bg-white/20 p-3 rounded-2xl relative z-10",children:n.jsx(na,{size:32})}),n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] mb-1 opacity-70",children:"Cerrojo de Deuda Histórica"}),n.jsxs("p",{className:"text-xl font-black leading-none",children:["$",K.toFixed(2)," USD"]}),n.jsx("p",{className:"text-[10px] font-bold mt-3 leading-tight opacity-90",children:"⚠ BLOQUEO ACTIVO: Este pago se absorberá 100% por la deuda anterior. La cuota del mes seguirá pendiente hasta que el histórico sea $0.00."})]}),n.jsx(ho,{className:"absolute right-[-20px] bottom-[-20px] w-24 h-24 text-white/10 pointer-events-none"})]}),W>0&&n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-blue-50 border border-blue-100 rounded-2xl",children:[n.jsx(Lc,{className:"text-blue-500 shrink-0",size:20,fill:"currentColor"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-blue-700 uppercase tracking-widest",children:"Saldo a Favor Disponible"}),n.jsxs("p",{className:"text-sm font-bold text-blue-600",children:["Crédito migrado utilizable: $",W.toFixed(2)]})]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200 shadow-inner",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4 px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest",children:"Monto Voucher (Bolívares)"}),n.jsxs("div",{className:"flex bg-white border border-slate-200 rounded-xl p-1 shadow-sm",children:[n.jsx("button",{type:"button",onClick:()=>_("am"),className:`px-4 py-1.5 rounded-lg text-[10px] font-black uppercase transition-all ${k==="am"?"bg-blue-600 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>_("pm"),className:`px-4 py-1.5 rounded-lg text-[10px] font-black uppercase transition-all ${k==="pm"?"bg-blue-600 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>_("parallel"),className:`px-4 py-1.5 rounded-lg text-[10px] font-black uppercase transition-all ${k==="parallel"?"bg-indigo-600 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"Paralela"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:m,onChange:O=>b(O.target.value),placeholder:"0.00"})]}),n.jsxs("div",{className:"mt-6 space-y-4",children:[n.jsx("div",{className:"flex justify-between items-start px-1",children:n.jsxs("div",{className:"space-y-1",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha Contable:"}),n.jsx("input",{required:!0,type:"date",className:"bg-white border border-slate-200 rounded-lg px-3 py-1 text-xs font-black text-slate-600 outline-none",value:T,onChange:O=>B(O.target.value)}),z>0&&n.jsxs("p",{className:"text-[10px] font-black text-slate-500 mt-1 uppercase tracking-tighter",children:["Tasa del día: ",z.toFixed(2)," Bs/$"]})]})}),n.jsxs("div",{className:"flex justify-between items-center bg-slate-800 text-white p-4 rounded-xl shadow-lg",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Abono Proyectado:"}),n.jsxs("span",{className:"text-xl font-black",children:["$",ar(Z)," USD"]})]}),Z>0&&n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-3 rounded-xl",children:[n.jsx("span",{className:"text-[8px] font-black text-blue-400 uppercase block",children:"Saldo Cuota"}),n.jsxs("span",{className:"text-sm font-black text-blue-700",children:["$",ar(a)]})]}),n.jsxs("div",{className:`p-3 rounded-xl border ${Y>0?"bg-emerald-50 border-emerald-100":"bg-slate-50 border-slate-100"}`,children:[n.jsx("span",{className:`text-[8px] font-black uppercase block ${Y>0?"text-emerald-400":"text-slate-400"}`,children:"Excedente"}),n.jsxs("span",{className:`text-sm font-black ${Y>0?"text-emerald-700":"text-slate-400"}`,children:["$",ar(Y)]})]})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:C,onChange:O=>{const P=O.target.value;E(P),P.length>=3&&Q(P)},placeholder:"Número de Referencia"}),U&&n.jsx("div",{className:"p-5 bg-red-50 border-2 border-red-200 rounded-3xl animate-in slide-in-from-top duration-500",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx(Cr,{className:"text-red-600 shrink-0 mt-1",size:20}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-red-900 font-black text-[11px] uppercase tracking-tight",children:"¡ALERTA: REFERENCIA DUPLICADA!"}),n.jsx("p",{className:"text-red-700 text-[10px] font-bold mt-1 leading-relaxed",children:i?"Este número de transferencia ya ha sido utilizado. Verifique su comprobante o contacte a la administración.":"Este código ya existe en los registros del sistema SAC 2026."}),!i&&U.matches&&n.jsxs("div",{className:"mt-3 space-y-2",children:[n.jsx("p",{className:"text-[9px] font-black text-red-900 uppercase tracking-widest underline",children:"Rastro Encontrado:"}),U.matches.map((O,P)=>n.jsxs("div",{className:"bg-white/50 p-2 rounded-lg border border-red-100 text-[9px] font-mono",children:[n.jsxs("span",{className:"font-black text-red-600",children:["[",O.source,"]"]})," ",O.detail," - ",O.date]},P)),n.jsxs("div",{className:"mt-4 flex items-center gap-3 bg-red-600 text-white p-3 rounded-xl shadow-lg",children:[n.jsx("input",{type:"checkbox",id:"auth_dup_fees",className:"w-5 h-5 accent-white cursor-pointer",checked:L,onChange:O=>R(O.target.checked)}),n.jsx("label",{htmlFor:"auth_dup_fees",className:"text-[9px] font-black uppercase tracking-widest cursor-pointer",children:"AUTORIZAR CARGA DUPLICADA"})]})]})]})]})}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:v,onChange:O=>y(O.target.value),children:[n.jsx("option",{value:"Transferencia Bancaria",children:"Transferencia Bancaria"}),n.jsx("option",{value:"Pago Móvil",children:"Pago Móvil"}),n.jsx("option",{value:"Efectivo / Divisa",children:"Efectivo / Divisa"})]})]}),n.jsxs("button",{disabled:I,type:"submit",className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95 disabled:opacity-50",children:[I?n.jsx(ot,{className:"animate-spin"}):n.jsx(zt,{size:24})," ",l?"ACTUALIZAR PAGO":i?"ENVIAR REPORTE":"SELLAR PAGO"]})]})},Qde=({feeId:e,propertyId:t,feeRate:r,onSuccess:a})=>{const{exchangeRateHistory:s,refreshData:i}=ht(),[l,o]=j.useState(""),[d,u]=j.useState(""),[f,p]=j.useState("pm"),[x,m]=j.useState(Er()),[b,v]=j.useState(""),[y,k]=j.useState(!1),[_,C]=j.useState(!1),E=Bp.useMemo(()=>{const I=s.find(U=>U.date===x);if(!I)return Number(r);if(f==="parallel")return Number(I.parallelValue)||Number(r);if(f==="am")return Number(I.amValue)||Number(I.pmValue)||Number(r);const M=Number(I.pmValue)>0?I.pmValue:I.amValue;return Number(M)||Number(r)},[x,s,r,f]),T=_?Number(l)>0?Number(l)/Number(E):0:Number(d),B=async I=>{I.preventDefault();const M=Number(T.toFixed(2));if(M<=0){alert("Monto inválido.");return}k(!0);try{const U=await fetch(`${ye}/add_extra_charge.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e,propertyId:t,amount:M,amount_bs:_?Number(l):0,exchange_rate:E,description:b})}),D=await U.json();if(!U.ok)throw new Error(D.error||"Fallo al agregar cargo");await i(),alert("¡Cargo Extra Agregado con Éxito!"),a()}catch(U){alert("ERROR: "+(U.message||"Fallo de red."))}finally{k(!1)}};return n.jsxs("form",{onSubmit:B,className:"space-y-6",children:[n.jsxs("div",{className:"flex bg-slate-100 p-1 rounded-2xl mb-4",children:[n.jsx("button",{type:"button",onClick:()=>C(!1),className:`flex-1 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all ${_?"text-slate-400":"bg-white text-blue-600 shadow-sm"}`,children:"Monto en USD"}),n.jsx("button",{type:"button",onClick:()=>C(!0),className:`flex-1 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all ${_?"bg-white text-blue-600 shadow-sm":"text-slate-400"}`,children:"Monto en BS"})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200 shadow-inner",children:[_?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest",children:"Monto en Bolívares"}),n.jsxs("div",{className:"flex bg-white border border-slate-200 rounded-xl p-1 shadow-sm",children:[n.jsx("button",{type:"button",onClick:()=>p("am"),className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase ${f==="am"?"bg-blue-600 text-white":"text-slate-400"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>p("pm"),className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase ${f==="pm"?"bg-blue-600 text-white":"text-slate-400"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>p("parallel"),className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase ${f==="parallel"?"bg-indigo-600 text-white":"text-slate-400"}`,children:"Paralela"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:l,onChange:I=>o(I.target.value),placeholder:"0.00"})]}),n.jsxs("div",{className:"flex justify-between items-center bg-slate-800 text-white p-4 rounded-xl shadow-lg",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Equivalente USD:"}),n.jsxs("span",{className:"text-xl font-black",children:["$",ar(T)]})]})]}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest px-1",children:"Monto en Dólares"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"$"}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:d,onChange:I=>u(I.target.value),placeholder:"0.00"})]})]}),n.jsx("div",{className:"mt-6 space-y-4",children:n.jsxs("div",{className:"space-y-1",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha Contable:"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-3 text-sm font-black text-slate-600 outline-none",value:x,onChange:I=>m(I.target.value)}),_&&E>0&&n.jsxs("p",{className:"text-[10px] font-black text-slate-500 mt-1 uppercase tracking-tighter",children:["Tasa aplicada: ",E.toFixed(2)," Bs/$"]})]})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest px-1",children:"Descripción / Motivo"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm min-h-[100px]",value:b,onChange:I=>v(I.target.value),placeholder:"Ej: Multa por retraso, Reparación extra, etc."})]}),n.jsxs("button",{disabled:y,type:"submit",className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95 disabled:opacity-50",children:[y?n.jsx(ot,{className:"animate-spin"}):n.jsx(ak,{size:24})," AGREGAR CARGO EXTRA"]})]})},Hde=({fee:e,user:t,onBack:r})=>{const{properties:a,financialTotals:s,latestRate:i}=ht(),l=["admin","programmer","board"].includes(t.role),o=t.propertyId,d=j.useMemo(()=>a.find(_=>_.id===o),[a,o]),u=Number(d==null?void 0:d.aliquot)||0,f=!!(d!=null&&d.hasUncommonExpense),p=j.useMemo(()=>a.filter(_=>_.hasUncommonExpense).length,[a]),x=j.useMemo(()=>{const _=C=>{var I,M;const E=Number(C.amountUsd)||0;let T=0,B="";if(l)T=E,B="GLOBAL";else if(C.isSpecial){const U=((I=C.specialPropertyIds)==null?void 0:I.length)||1,D=(M=C.specialPropertyIds)==null?void 0:M.includes(o);T=D?E/U:0,B=D?`ESP (1/${U})`:"Exento"}else C.isUncommon?(T=f&&p>0?E/p:0,B=f&&p>0?`GNC (1/${p})`:"Exento"):(T=E*(u/100),B=`ALIQ (${u.toFixed(4)}%)`);return{...C,global:E,myPortion:T,basisDesc:B}};return[{title:"Gastos Fijos",items:e.fixedExpenses.map(_)},{title:"Gastos Variables",items:e.variableExpenses.map(_)},{title:"Otros Gastos",items:e.otherExpenses.map(_)}]},[e,o,u,f,p,a,l]),m=x.reduce((_,C)=>_+C.items.reduce((E,T)=>E+T.myPortion,0),0),b=x.reduce((_,C)=>_+C.items.reduce((E,T)=>E+T.global,0),0),v=Number(e.reserveFundPercent)||10,y=m*(v/100),k=m+y;return n.jsxs("div",{className:"max-w-7xl mx-auto space-y-10 animate-in fade-in duration-500 pb-24 px-1 print:p-0 print:space-y-2 print-compact",children:[n.jsx("style",{children:`
                @media print {
                    @page { margin: 0.5cm; size: auto; }
                    .print-compact { font-size: 8pt !important; width: 100% !important; overflow: visible !important; }
                    .print-compact table td, .print-compact table th { padding-top: 2px !important; padding-bottom: 2px !important; line-height: 1.1 !important; font-size: 8pt !important; }
                    .print-compact h2 { font-size: 14pt !important; margin-bottom: 4px !important; }
                    .print-compact h3 { font-size: 10pt !important; margin-bottom: 6px !important; margin-top: 6px !important; border-bottom-width: 1px !important; padding-bottom: 2px !important; }
                    .print-compact .p-10, .print-compact .p-14, .print-compact .p-8 { padding: 12px !important; }
                    .print-compact .mt-8, .print-compact .mt-10, .print-compact .mt-6 { margin-top: 6px !important; }
                    .print-compact .mb-8, .print-compact .mb-10, .print-compact .mb-4, .print-compact .mb-2 { margin-bottom: 4px !important; }
                    .print-compact .rounded-[3rem], .print-compact .rounded-2xl, .print-compact .rounded-[2.5rem] { border-radius: 8px !important; }
                    .print-compact .shadow-xl, .print-compact .shadow-2xl, .print-compact .shadow-lg { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
                    .print-compact .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                    .print-compact .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                    .print-compact .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                    .print-compact .bg-indigo-600 { background-color: #4f46e5 !important; -webkit-print-color-adjust: exact; }
                    .print-compact table { page-break-inside: auto !important; }
                    .print-compact tr { page-break-inside: avoid !important; page-break-after: auto !important; }
                }
            `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Monitor"]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(yt,{size:20})})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-xl border border-slate-200 overflow-hidden print:border-none print:shadow-none",children:[n.jsxs("div",{className:"p-10 lg:p-14 bg-slate-900 text-white text-center relative overflow-hidden print:p-6",children:[n.jsx("h2",{className:"text-2xl lg:text-3xl font-black uppercase tracking-[0.2em] mb-2 print:text-xl",children:l?"Relación Global de Gastos":"Relación de Gastos Mensuales"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-xs",children:[Ue[e.month]," ",e.year]}),n.jsx("div",{className:"mt-8 mb-4 max-w-md mx-auto print:mt-4 print:mb-2",children:n.jsxs("div",{className:"bg-indigo-600/20 border border-indigo-400/30 p-4 rounded-2xl backdrop-blur-sm flex items-center justify-between print:p-2 print:border-none",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ho,{className:"text-blue-400",size:24}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-300 tracking-widest",children:"Disponibilidad Fondo de Reserva"}),n.jsxs("p",{className:"text-lg font-black text-white",children:["$ ",ar((s==null?void 0:s.reserveFundUsd)||0)]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[7px] font-black uppercase text-indigo-300",children:"Equiv. VES"}),n.jsxs("p",{className:"text-xs font-black text-blue-200",children:["Bs. ",_g((s==null?void 0:s.reserveFundBs)||0)]})]})]})}),n.jsxs("div",{className:"mt-6 flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4",children:[!l&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[d==null?void 0:d.type," ",d==null?void 0:d.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[u.toFixed(4),"%"]})]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:l?"Tasa Emisión":"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[Number(l?e.exchangeRate:i).toFixed(2)," Bs/$"]})]})]})]}),n.jsx("div",{className:"p-8 lg:p-14 space-y-12 bg-white print:p-4 print:space-y-4",children:x.map((_,C)=>{const E=_.items.reduce((T,B)=>T+B.global,0);return _.items.length===0?null:n.jsxs("div",{className:"print:break-inside-auto",children:[n.jsxs("h3",{className:"text-lg font-black text-slate-900 uppercase tracking-tighter mb-6 flex items-center gap-3 print:text-sm print:mb-2",children:[n.jsx("div",{className:"w-2 h-6 bg-blue-600 rounded-full print:h-4"})," ",_.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b-2 border-slate-100",children:[n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 tracking-widest print:py-1",children:"Concepto"}),!l&&n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 text-center print:py-1",children:"Base"}),n.jsx("th",{className:`py-4 text-[9px] font-black uppercase text-right print:py-1 ${l?"text-blue-600 bg-blue-50/30 px-4":"text-slate-400"}`,children:"Gasto Global ($)"}),!l&&n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-blue-600 text-right bg-blue-50/30 px-4 print:py-1",children:"Su Cuota ($)"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-50",children:[_.items.map((T,B)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[n.jsxs("td",{className:"py-4 text-xs font-bold text-slate-600 uppercase flex items-center gap-3 print:py-0.5 print:text-[7pt]",children:[T.isSpecial?n.jsx(cb,{size:12,className:"text-amber-500 no-print"}):T.isUncommon?n.jsx(Lc,{size:12,className:"text-indigo-500 no-print",fill:"currentColor"}):n.jsx("div",{className:"w-3 no-print"}),T.description]}),!l&&n.jsx("td",{className:"py-4 text-center print:py-0.5",children:n.jsx("span",{className:"px-3 py-1 rounded-lg text-[8px] font-black uppercase tracking-tighter border bg-slate-50 text-slate-500 print:text-[6pt] print:px-1",children:T.basisDesc})}),n.jsxs("td",{className:`py-4 text-xs font-black text-right print:py-0.5 ${l?"text-blue-900 bg-blue-50/10 px-4 text-sm":"text-slate-400"}`,children:["$",ar(T.global)]}),!l&&n.jsxs("td",{className:"py-4 text-sm font-black text-blue-900 text-right bg-blue-50/10 px-4 print:py-0.5 print:text-[8pt]",children:["$",ar(T.myPortion)]})]},B)),l&&n.jsxs("tr",{className:"bg-slate-100/50 border-t border-slate-200",children:[n.jsxs("td",{className:"py-4 px-4 font-black text-xs text-slate-900 uppercase print:py-1",children:["SUBTOTAL ",_.title.toUpperCase()]}),n.jsxs("td",{className:"py-4 px-4 text-right font-black text-slate-900 text-sm print:py-1",children:["$",ar(E)]})]})]})]})})]},C)})}),n.jsxs("div",{className:"bg-slate-50 p-10 lg:p-14 border-t border-slate-100 grid grid-cols-1 lg:grid-cols-2 gap-12 print:p-6 print:gap-4 print:grid-cols-2",children:[n.jsxs("div",{className:"space-y-4 print:space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-3 text-amber-600 print:gap-1",children:[n.jsx(Cr,{size:20,className:"print:w-4 print:h-4"}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest print:text-[8pt]",children:"Resumen"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-4 print:pt-1",children:[n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-slate-400 uppercase print:text-[6pt]",children:"Subtotal"}),n.jsxs("span",{className:"font-black text-slate-800 text-xs print:text-[8pt]",children:["$",ar(l?b:m)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsxs("span",{className:"block text-[8px] font-black text-blue-400 uppercase print:text-[6pt]",children:["Reserva (",v,"%)"]}),n.jsxs("span",{className:"font-black text-blue-600 text-xs print:text-[8pt]",children:["$",ar(l?b*(v/100):y)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-amber-400 uppercase print:text-[6pt]",children:"Gasto Global"}),n.jsxs("span",{className:"font-black text-amber-600 text-xs print:text-[8pt]",children:["$",ar(b)]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-2xl relative overflow-hidden flex flex-col justify-center print:p-4",children:[n.jsxs("div",{className:"relative z-10 flex flex-col gap-6 print:gap-2",children:[n.jsxs("div",{className:"flex justify-between items-center border-b border-white/10 pb-4 print:pb-1",children:[n.jsx("span",{className:"text-[10px] font-black uppercase text-blue-400 print:text-[7pt]",children:l?"Gran Total a Recaudar":"Total a Pagar"}),n.jsxs("span",{className:"text-4xl font-black tracking-tighter print:text-xl",children:["$",ar(l?b*(1+v/100):k)]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600/20 p-5 rounded-2xl border border-blue-500/20 print:p-2",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] font-black uppercase text-blue-300 block print:text-[6pt]",children:"Equivalente VES"}),n.jsxs("p",{className:"text-2xl font-black tracking-tight mt-1 print:text-sm print:mt-0",children:["Bs. ",_g((l?b*(1+v/100):k)*Number(l?e.exchangeRate:i))]})]}),n.jsx($i,{size:32,className:"text-blue-400 opacity-50 print:w-6 print:h-6"})]})]}),n.jsx(Fp,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/[0.05] pointer-events-none no-print"})]})]})]}),n.jsx("div",{className:"hidden print:block text-center mt-4 border-t pt-4",children:n.jsx("p",{className:"text-[8pt] font-black uppercase text-slate-300 tracking-[0.4em]",children:"Certificado Digital de Gestión • SAC 2026 • By Andres Mathison"})})]})},zde=({debt:e,property:t,onClose:r})=>{const{residents:a,users:s,latestRate:i}=ht(),[l,o]=j.useState(null),d=e.payments||[],u=d.reduce((_,C)=>_+Number(C.amount),0),f=Number(e.amountUsd),p=f-u,x=u>=f,m=j.useMemo(()=>{if(!t)return null;const _=a.find(E=>E.propertyId===t.id&&E.isOwner),C=s.find(E=>E.cedula===(_==null?void 0:_.cedula));return{fullName:(_==null?void 0:_.fullName)||"Propietario",email:(C==null?void 0:C.email)||"",phone:(_==null?void 0:_.phone)||(C==null?void 0:C.phone)||"",telegramId:(C==null?void 0:C.telegramChatId)||"",propertyCode:t.code}},[t,a,s]),b=_=>{if(!_)return"";let C=_.trim();return C.startsWith("+")?C.replace(/\D/g,""):C.startsWith("0")?"58"+C.substring(1).replace(/\D/g,""):C.length===10?"58"+C.replace(/\D/g,""):C.replace(/\D/g,"")},v=()=>{if(!t||!e)return"";const _=x?"✅ SOLVENTE":"⚠️ PAGO PARCIAL",C=p>0?`📉 *Deuda Restante:* $${ar(p)}
`:`✨ *CUOTA CANCELADA*
`;let E="";return d.forEach((T,B)=>{E+=`🔹 Pago ${B+1}: $${ar(T.amount)} (${T.date} - Ref: ${T.reference})
`}),`📄 *RECIBO DE PAGO - SAC 2026*

Unidad: *${t.code}*
Propietario: *${m==null?void 0:m.fullName}*
------------------------------------------
💰 *Monto Cuota:* $${ar(f)}
💵 *Total Pagado:* $${ar(u)}
🔢 *Cant. Pagos:* ${d.length}
------------------------------------------
📋 *DETALLE DE PAGOS:*
${E}------------------------------------------
📊 *ESTATUS:* ${_}
`+C+`------------------------------------------
Fecha de Emisión: ${new Date().toLocaleDateString()}

¡Gracias por su compromiso!`},y=async _=>{if(!m||!t||!e)return;const C=v();if(_==="whatsapp"){const E=b(m.phone);if(!E)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${E}?text=${encodeURIComponent(C)}`,"_blank");return}if(_==="share"){if(navigator.share)try{await navigator.share({title:`Recibo de Pago - ${t.code}`,text:C.replace(/\*/g,""),url:la})}catch(E){console.warn("Share failed",E)}else alert("La función de compartir no está disponible en este navegador.");return}o(_);try{const E={channel:_,messageType:"receipt",monthName:"Periodo Actual",year:new Date().getFullYear(),recipients:[{name:m.fullName,email:m.email,telegramChatId:m.telegramId,propName:`${t.code}`,amount:ar(f),paid:ar(u),status:x?"Solvente":"Parcial",balance:ar(p)}]},B=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)})).json();B.status==="success"?alert(`¡Éxito! Recibo enviado por ${_}.`):alert("Error: "+B.message)}catch{alert("Error de red al enviar.")}finally{o(null)}},k=()=>{const _=v();navigator.clipboard.writeText(_),alert("Copiado al portapapeles")};return n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl relative overflow-hidden animate-in zoom-in-95 duration-300 max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsx("button",{onClick:r,className:"absolute top-8 right-8 p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-red-500 transition-all no-print",children:n.jsx(ft,{size:20})}),n.jsxs("div",{className:"text-center mb-10",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto mb-6 shadow-inner",children:n.jsx(zt,{size:40})}),n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Recibo de Pago"}),n.jsx("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-[0.3em] mt-2",children:"Certificado Digital SAC 2026"})]}),n.jsxs("div",{className:"space-y-5 border-y border-slate-100 py-8 mb-10",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Inmueble:"}),n.jsx("span",{className:"font-black text-slate-800 text-lg uppercase",children:(t==null?void 0:t.code)||"S/I"})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Monto Cuota:"}),n.jsxs("span",{className:"font-black text-slate-800",children:["$",ar(f)]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-emerald-50/50 p-4 rounded-2xl border border-emerald-100",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-700 uppercase tracking-widest",children:"Total Pagado:"}),n.jsxs("span",{className:"font-black text-emerald-600 text-2xl",children:["$",ar(u)]})]}),d.length>0&&n.jsxs("div",{className:"space-y-3 mt-4",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest text-center",children:["Historial de Pagos (",d.length,")"]}),d.map((_,C)=>n.jsxs("div",{className:"p-3 bg-slate-50 rounded-xl border border-slate-100 flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-800 uppercase",children:["Ref: #",_.reference]}),n.jsx("p",{className:"text-[8px] font-bold text-slate-400 uppercase",children:_.date})]}),n.jsxs("span",{className:"font-black text-slate-700 text-xs",children:["$",ar(_.amount)]})]},C))]})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-3 no-print",children:[n.jsxs("button",{onClick:()=>window.print(),className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(yt,{size:18})," IMPRIMIR"]}),n.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[n.jsx("button",{onClick:()=>y("whatsapp"),className:"p-4 bg-emerald-500 text-white rounded-2xl shadow-lg active:scale-95 transition-all flex justify-center",title:"WhatsApp",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>y("telegram"),disabled:!(m!=null&&m.telegramId)||!!l,className:`p-4 rounded-2xl text-white shadow-lg active:scale-95 transition-all flex justify-center ${m!=null&&m.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:l==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>y("email"),disabled:!(m!=null&&m.email)||!!l,className:`p-4 rounded-2xl text-white shadow-lg active:scale-95 transition-all flex justify-center ${m!=null&&m.email?"bg-indigo-600":"bg-slate-200"}`,title:"Email",children:l==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>y("share"),className:"p-4 bg-blue-600 text-white rounded-2xl shadow-lg active:scale-95 transition-all flex justify-center",title:"Compartir",children:n.jsx(_a,{size:20})})]}),n.jsxs("button",{onClick:k,className:"w-full bg-slate-100 text-slate-600 py-3 rounded-2xl font-black text-[9px] uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-slate-200 transition-all",children:[n.jsx(lb,{size:16})," COPIAR TEXTO"]})]}),n.jsx("div",{className:"mt-6 text-center",children:n.jsx("p",{className:"text-[9px] font-bold text-slate-300 uppercase tracking-widest leading-relaxed",children:"Este documento es una representación digital de una transacción confirmada en el Libro Diario."})})]})})},$de=({fee:e,user:t,onBack:r})=>{var R,Q,G,K,W,z,Z,Y,te;const{properties:a,residents:s,users:i,deletePayment:l,refreshData:o}=ht(),[d,u]=j.useState("debts"),[f,p]=j.useState(null),[x,m]=j.useState(null),[b,v]=j.useState(null),[y,k]=j.useState(!1),[_,C]=j.useState(null),[E,T]=j.useState(null),B=["admin","programmer","board"].includes(t.role),[I,M]=j.useState(!1),U=async O=>{k(!0);try{const P=await fetch(`${ye}/approve_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e.id,propertyId:O.propertyId})});if(P.ok)alert("¡Pago Validado y Registrado en el Sistema!"),await o(),C(null);else{const q=await P.json();alert("Error: "+q.error)}}catch{alert("Fallo de conexión.")}finally{k(!1)}},D=async O=>{const P=prompt("Indique el motivo del rechazo para que el propietario pueda corregirlo:","Comprobante no coincide con el banco.");if(P!==null){k(!0);try{(await fetch(`${ye}/reject_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e.id,propertyId:O.propertyId,reason:P})})).ok&&(alert("Reporte rechazado. El propietario será notificado."),await o(),C(null))}catch{alert("Fallo de conexión.")}finally{k(!1)}}};if(d==="breakdown")return n.jsx(Hde,{fee:e,user:t,onBack:()=>u("debts")});const L=[...e.debts||[]].sort((O,P)=>{var J,ae;const q=((J=a.find(oe=>oe.id===O.propertyId))==null?void 0:J.code)||"",H=((ae=a.find(oe=>oe.id===P.propertyId))==null?void 0:ae.code)||"";return q.localeCompare(H,void 0,{numeric:!0})});return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-12 px-1",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6 no-print",children:[n.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[n.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver al Listado"]}),n.jsx("button",{onClick:()=>{const O=["Unidad","Propietario","Monto $","Pagado $","Pendiente $","Estatus"],P=L.map(q=>{const H=a.find(oe=>oe.id===q.propertyId),J=s.find(oe=>oe.propertyId===q.propertyId&&oe.isOwner),ae=Number(q.amountUsd)-Number(q.paidAmount);return[(H==null?void 0:H.code)||"",(J==null?void 0:J.fullName)||"Sin Propietario",`$${Number(q.amountUsd).toFixed(2)}`,`$${Number(q.paidAmount).toFixed(2)}`,`$${ae.toFixed(2)}`,q.paidAmount>=q.amountUsd?"PAGADO":q.paidAmount>0?"PARCIAL":"PENDIENTE"]});zc(`Monitor de Cobranza - ${Ue[e.month]} ${e.year}`,O,P)},className:"p-3 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(gr,{size:20})}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",children:n.jsx(yt,{size:20})})]}),n.jsxs("button",{onClick:()=>u("breakdown"),className:"w-full md:w-auto bg-indigo-600 hover:bg-indigo-700 text-white px-8 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl shadow-indigo-100 flex items-center justify-center gap-3",children:[n.jsx(Pc,{size:18})," Ver Relación de Gastos"]})]}),n.jsxs("div",{className:`bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden ${x?"no-print":""}`,children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-slate-100 bg-slate-50/50",children:[n.jsxs("h3",{className:"text-2xl font-black text-slate-800 tracking-tight uppercase",children:["Monitor de Cobranza: ",Ue[e.month]," ",e.year]}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Sincronización en tiempo real con tesorería"})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Titular / Propietario"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Detalle de Pago"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto $"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estatus"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:L.map(O=>{const P=a.find(ae=>ae.id===O.propertyId),q=s.find(ae=>ae.propertyId===O.propertyId&&ae.isOwner),H=O.pendingPayment!==null,J=Number((P==null?void 0:P.initialDebt)||0)>0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg",children:P==null?void 0:P.code})}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("p",{className:"text-sm font-bold text-slate-700 uppercase",children:(q==null?void 0:q.fullName)||"Sin Propietario"})}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsxs("div",{className:"inline-flex flex-col items-center gap-1",children:[n.jsxs("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-tighter",children:["Cuota: $",ar(O.amountUsd)]}),(O.paidAmount||0)>0&&O.status!=="Pagado"&&n.jsxs("span",{className:"text-[9px] font-black text-amber-600 uppercase tracking-tighter",children:["Pendiente: $",ar(O.amountUsd-(O.paidAmount||0))]}),Number(O.previousDebt)>0&&Number(O.paidAmount)<Number(O.previousDebt)&&n.jsxs("span",{className:"text-[9px] font-black text-rose-600 uppercase tracking-tighter",children:["Deuda Ant: $",ar(Number(O.previousDebt)-Number(O.paidAmount))]})]})}),n.jsxs("td",{className:"px-8 py-6 text-right font-mono font-black text-slate-800 text-lg",children:["$",ar(O.amountUsd),J&&O.status!=="Pagado"&&n.jsx("span",{className:"block text-[8px] font-black text-red-600 bg-red-50 px-2 py-0.5 rounded-lg uppercase tracking-widest mt-1 animate-pulse",children:"Convenio Activo"})]}),n.jsx("td",{className:"px-8 py-6 text-center",children:H?n.jsx("span",{className:"px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest bg-amber-50 text-amber-600 border border-amber-100 animate-pulse",children:"En Revisión"}):n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${O.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":O.status==="Parcial"?"bg-amber-50 text-amber-600 border-amber-100":"bg-red-50 text-red-600 border-red-100"}`,children:O.status})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[H&&B&&n.jsx("div",{className:"flex gap-2 animate-in zoom-in",children:n.jsxs("button",{onClick:()=>C(O),className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg hover:bg-indigo-700 transition-all flex items-center gap-2 font-black text-[9px] uppercase tracking-widest",title:"Verificar Reporte",children:[n.jsx($f,{size:18})," REVISAR"]})}),!H&&n.jsxs("div",{className:"flex justify-end gap-2",children:[O.payments&&O.payments.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m(O),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",title:"Ver Recibo Sello",children:n.jsx(gr,{size:18})}),B&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>v({...O,payment:O.payments[0]}),className:"p-3 bg-amber-50 text-amber-600 rounded-xl hover:bg-amber-600 hover:text-white transition-all shadow-sm",title:"Modificar Pago",children:n.jsx(vl,{size:18})}),n.jsx("button",{onClick:()=>{confirm("¿Anular pago?")&&l(O.payments[O.payments.length-1].id)},className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",title:"Borrar Pago",children:n.jsx(Ta,{size:18})})]})]}),B&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>p(O),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg hover:bg-blue-700 transition-all active:scale-95",title:"Registrar Pago",children:n.jsx(_p,{size:18})}),n.jsx("button",{onClick:()=>T(O),className:"p-3 bg-indigo-50 text-indigo-600 rounded-xl hover:bg-indigo-600 hover:text-white transition-all shadow-sm",title:"Agregar Cargo Extra",children:n.jsx(ak,{size:18})})]})]})]})})]},O.id)})})]})})]}),_&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 border-2 border-indigo-100 flex flex-col relative max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-lg shadow-indigo-100",children:n.jsx($f,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Validación de Pago"}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:["Unidad: ",(R=a.find(O=>O.id===_.propertyId))==null?void 0:R.code]})]})]}),n.jsx("button",{onClick:()=>C(null),className:"p-2 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:20})})]}),n.jsxs("div",{className:"space-y-6 flex-1",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-200 space-y-4 shadow-inner",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Monto Reportado:"}),n.jsxs("span",{className:"text-2xl font-black text-slate-900",children:["Bs. ",_g((Q=_.pendingPayment)==null?void 0:Q.amountBs)]})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Abono Proyectado:"}),n.jsxs("span",{className:"text-lg font-black text-blue-600",children:["$",ar((G=_.pendingPayment)==null?void 0:G.amount)," USD"]})]}),n.jsx("div",{className:"h-px bg-slate-200 w-full"}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Referencia:"}),n.jsxs("span",{className:"font-mono font-black text-slate-800 bg-white px-3 py-1 rounded-lg",children:["#",(K=_.pendingPayment)==null?void 0:K.reference]})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Fecha Valor:"}),n.jsx("span",{className:"font-black text-slate-800",children:(W=_.pendingPayment)==null?void 0:W.date})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Método:"}),n.jsx("span",{className:"font-black text-slate-800 uppercase text-xs",children:(z=_.pendingPayment)==null?void 0:z.method})]})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[n.jsxs("button",{disabled:y,onClick:()=>U(_),className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95 disabled:opacity-50",children:[y?n.jsx(ot,{className:"animate-spin"}):n.jsx(sa,{size:18})," VALIDAR Y ASENTAR EN LIBROS"]}),n.jsxs("button",{disabled:y,onClick:()=>D(_),className:"w-full bg-red-50 text-red-600 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border border-red-100 hover:bg-red-600 hover:text-white transition-all flex items-center justify-center gap-3 active:scale-95 disabled:opacity-50",children:[n.jsx(YK,{size:18})," RECHAZAR REPORTE"]})]})]})]})}),f&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 border border-slate-100 relative max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:B?"Carga de Pago":"Reporte de Pago"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-1",children:["Unidad: ",(Z=a.find(O=>O.id===f.propertyId))==null?void 0:Z.code]})]}),n.jsx("button",{onClick:()=>p(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsx(y5,{feeId:e.id,propertyId:f.propertyId,feeRate:e.exchangeRate,currentBalance:Number(f.amountUsd)-(Number(f.paidAmount)||0),availableCredit:0,isOwnerReporting:!B,onSuccess:()=>p(null)})]})}),b&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 border-2 border-amber-100 relative max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-amber-600 tracking-tight",children:"Editar Transacción"}),n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mt-1",children:["Unidad: ",(Y=a.find(O=>O.id===b.propertyId))==null?void 0:Y.code]})]}),n.jsx("button",{onClick:()=>v(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsx(y5,{feeId:e.id,propertyId:b.propertyId,feeRate:e.exchangeRate,currentBalance:Number(b.amountUsd)-(Number(b.paidAmount)||0)+Number(b.payment.amount),availableCredit:0,existingPayment:b.payment,onSuccess:()=>v(null)})]})}),x&&n.jsx(zde,{debt:x,property:a.find(O=>O.id===x.propertyId),onClose:()=>m(null)}),E&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl relative animate-in zoom-in-95 duration-300",children:[n.jsx("button",{onClick:()=>T(null),className:"absolute top-8 right-8 p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-red-500 transition-all",children:n.jsx(ft,{size:20})}),n.jsxs("div",{className:"mb-10",children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Cargo Extra"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-[0.3em] mt-2",children:["Unidad: ",(te=a.find(O=>O.id===E.propertyId))==null?void 0:te.code]})]}),n.jsx(Qde,{feeId:e.id,propertyId:E.propertyId,feeRate:Number(e.exchangeRate),onSuccess:()=>T(null)})]})})]})},w5=({user:e,viewMode:t,onTabChange:r})=>{const[a,s]=j.useState(t),[i,l]=j.useState();return j.useEffect(()=>{s(t)},[t]),a==="generate"?n.jsx(Pde,{onCancel:()=>s("list"),existingFee:i,onTabChange:r}):n.jsx(Lde,{user:e,onEdit:o=>{l(o),s("generate")},onTabChange:r})};var nf={exports:{}},m2={},g2,N5;function Vde(){if(N5)return g2;N5=1;function e(t,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return g2=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var r=new Date().getTime();if(t&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var a=this._timeouts.shift();if(a===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),a=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},a),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,r){this._fn=t,r&&(r.timeout&&(this._operationTimeout=r.timeout),r.cb&&(this._operationTimeoutCb=r.cb));var a=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){a._operationTimeoutCb()},a._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},r=null,a=0,s=0;s<this._errors.length;s++){var i=this._errors[s],l=i.message,o=(t[l]||0)+1;t[l]=o,o>=a&&(r=i,a=o)}return r},g2}var C5;function Gde(){return C5||(C5=1,(function(e){var t=Vde();e.operation=function(r){var a=e.timeouts(r);return new t(a,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var a={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in r)a[s]=r[s];if(a.minTimeout>a.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],l=0;l<a.retries;l++)i.push(this.createTimeout(l,a));return r&&r.forever&&!i.length&&i.push(this.createTimeout(l,a)),i.sort(function(o,d){return o-d}),i},e.createTimeout=function(r,a){var s=a.randomize?Math.random()+1:1,i=Math.round(s*Math.max(a.minTimeout,1)*Math.pow(a.factor,r));return i=Math.min(i,a.maxTimeout),i},e.wrap=function(r,a,s){if(a instanceof Array&&(s=a,a=null),!s){s=[];for(var i in r)typeof r[i]=="function"&&s.push(i)}for(var l=0;l<s.length;l++){var o=s[l],d=r[o];r[o]=(function(f){var p=e.operation(a),x=Array.prototype.slice.call(arguments,1),m=x.pop();x.push(function(b){p.retry(b)||(b&&(arguments[0]=p.mainError()),m.apply(this,arguments))}),p.attempt(function(){f.apply(r,x)})}).bind(r,d),r[o].options=a}}})(m2)),m2}var b2,k5;function Kde(){return k5||(k5=1,b2=Gde()),b2}var j5;function qde(){if(j5)return nf.exports;j5=1;const e=Kde(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class r extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const a=(l,o,d)=>{const u=d.retries-(o-1);return l.attemptNumber=o,l.retriesLeft=u,l},s=l=>t.includes(l),i=(l,o)=>new Promise((d,u)=>{o={onFailedAttempt:()=>{},retries:10,...o};const f=e.operation(o);f.attempt(async p=>{try{d(await l(p))}catch(x){if(!(x instanceof Error)){u(new TypeError(`Non-error was thrown: "${x}". You should only throw errors.`));return}if(x instanceof r)f.stop(),u(x.originalError);else if(x instanceof TypeError&&!s(x.message))f.stop(),u(x);else{a(x,p,o);try{await o.onFailedAttempt(x)}catch(m){u(m);return}f.retry(x)||u(f.mainError())}}})});return nf.exports=i,nf.exports.default=i,nf.exports.AbortError=r,nf.exports}var xL=qde();const Wde=El(xL);var Yde={};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let Xde,Jde;function Zde(){return{geminiUrl:Xde,vertexUrl:Jde}}function eue(e,t,r,a){var s,i;if(!(e!=null&&e.baseUrl)){const l=Zde();return t?(s=l.vertexUrl)!==null&&s!==void 0?s:r:(i=l.geminiUrl)!==null&&i!==void 0?i:a}return e.baseUrl}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Do{}function Ze(e,t){const r=/\{([^}]+)\}/g;return e.replace(r,(a,s)=>{if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s];return i!=null?String(i):""}else throw new Error(`Key '${s}' not found in valueMap.`)})}function N(e,t,r){for(let i=0;i<t.length-1;i++){const l=t[i];if(l.endsWith("[]")){const o=l.slice(0,-2);if(!(o in e))if(Array.isArray(r))e[o]=Array.from({length:r.length},()=>({}));else throw new Error(`Value must be a list given an array path ${l}`);if(Array.isArray(e[o])){const d=e[o];if(Array.isArray(r))for(let u=0;u<d.length;u++){const f=d[u];N(f,t.slice(i+1),r[u])}else for(const u of d)N(u,t.slice(i+1),r)}return}else if(l.endsWith("[0]")){const o=l.slice(0,-3);o in e||(e[o]=[{}]);const d=e[o];N(d[0],t.slice(i+1),r);return}(!e[l]||typeof e[l]!="object")&&(e[l]={}),e=e[l]}const a=t[t.length-1],s=e[a];if(s!==void 0){if(!r||typeof r=="object"&&Object.keys(r).length===0||r===s)return;if(typeof s=="object"&&typeof r=="object"&&s!==null&&r!==null)Object.assign(s,r);else throw new Error(`Cannot set value for an existing key. Key: ${a}`)}else a==="_self"&&typeof r=="object"&&r!==null&&!Array.isArray(r)?Object.assign(e,r):e[a]=r}function w(e,t,r=void 0){try{if(t.length===1&&t[0]==="_self")return e;for(let a=0;a<t.length;a++){if(typeof e!="object"||e===null)return r;const s=t[a];if(s.endsWith("[]")){const i=s.slice(0,-2);if(i in e){const l=e[i];return Array.isArray(l)?l.map(o=>w(o,t.slice(a+1),r)):r}else return r}else e=e[s]}return e}catch(a){if(a instanceof TypeError)return r;throw a}}function tue(e,t){for(const[r,a]of Object.entries(t)){const s=r.split("."),i=a.split("."),l=new Set;let o=-1;for(let d=0;d<s.length;d++)if(s[d]==="*"){o=d;break}if(o!==-1&&i.length>o)for(let d=o;d<i.length;d++){const u=i[d];u!=="*"&&!u.endsWith("[]")&&!u.endsWith("[0]")&&l.add(u)}aC(e,s,i,0,l)}}function aC(e,t,r,a,s){if(a>=t.length||typeof e!="object"||e===null)return;const i=t[a];if(i.endsWith("[]")){const l=i.slice(0,-2),o=e;if(l in o&&Array.isArray(o[l]))for(const d of o[l])aC(d,t,r,a+1,s)}else if(i==="*"){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const l=e,o=Object.keys(l).filter(u=>!u.startsWith("_")&&!s.has(u)),d={};for(const u of o)d[u]=l[u];for(const[u,f]of Object.entries(d)){const p=[];for(const x of r.slice(a))x==="*"?p.push(u):p.push(x);N(l,p,f)}for(const u of o)delete l[u]}}else{const l=e;i in l&&aC(l[i],t,r,a+1,s)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Hj(e){if(typeof e!="string")throw new Error("fromImageBytes must be a string");return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function rue(e){const t={},r=w(e,["operationName"]);r!=null&&N(t,["operationName"],r);const a=w(e,["resourceName"]);return a!=null&&N(t,["_url","resourceName"],a),t}function aue(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response","generateVideoResponse"]);return l!=null&&N(t,["response"],sue(l)),t}function nue(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],iue(l)),t}function sue(e){const t={},r=w(e,["generatedSamples"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(l=>lue(l))),N(t,["generatedVideos"],i)}const a=w(e,["raiMediaFilteredCount"]);a!=null&&N(t,["raiMediaFilteredCount"],a);const s=w(e,["raiMediaFilteredReasons"]);return s!=null&&N(t,["raiMediaFilteredReasons"],s),t}function iue(e){const t={},r=w(e,["videos"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(l=>oue(l))),N(t,["generatedVideos"],i)}const a=w(e,["raiMediaFilteredCount"]);a!=null&&N(t,["raiMediaFilteredCount"],a);const s=w(e,["raiMediaFilteredReasons"]);return s!=null&&N(t,["raiMediaFilteredReasons"],s),t}function lue(e){const t={},r=w(e,["video"]);return r!=null&&N(t,["video"],pue(r)),t}function oue(e){const t={},r=w(e,["_self"]);return r!=null&&N(t,["video"],hue(r)),t}function cue(e){const t={},r=w(e,["operationName"]);return r!=null&&N(t,["_url","operationName"],r),t}function due(e){const t={},r=w(e,["operationName"]);return r!=null&&N(t,["_url","operationName"],r),t}function uue(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],Aue(l)),t}function Aue(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&N(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&N(t,["documentName"],s),t}function mL(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],fue(l)),t}function fue(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&N(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&N(t,["documentName"],s),t}function pue(e){const t={},r=w(e,["uri"]);r!=null&&N(t,["uri"],r);const a=w(e,["encodedVideo"]);a!=null&&N(t,["videoBytes"],Hj(a));const s=w(e,["encoding"]);return s!=null&&N(t,["mimeType"],s),t}function hue(e){const t={},r=w(e,["gcsUri"]);r!=null&&N(t,["uri"],r);const a=w(e,["bytesBase64Encoded"]);a!=null&&N(t,["videoBytes"],Hj(a));const s=w(e,["mimeType"]);return s!=null&&N(t,["mimeType"],s),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var E5;(function(e){e.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",e.OUTCOME_OK="OUTCOME_OK",e.OUTCOME_FAILED="OUTCOME_FAILED",e.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(E5||(E5={}));var S5;(function(e){e.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",e.PYTHON="PYTHON"})(S5||(S5={}));var B5;(function(e){e.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",e.SILENT="SILENT",e.WHEN_IDLE="WHEN_IDLE",e.INTERRUPT="INTERRUPT"})(B5||(B5={}));var bc;(function(e){e.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",e.STRING="STRING",e.NUMBER="NUMBER",e.INTEGER="INTEGER",e.BOOLEAN="BOOLEAN",e.ARRAY="ARRAY",e.OBJECT="OBJECT",e.NULL="NULL"})(bc||(bc={}));var _5;(function(e){e.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",e.SIMPLE_SEARCH="SIMPLE_SEARCH",e.ELASTIC_SEARCH="ELASTIC_SEARCH"})(_5||(_5={}));var T5;(function(e){e.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",e.NO_AUTH="NO_AUTH",e.API_KEY_AUTH="API_KEY_AUTH",e.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",e.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",e.OAUTH="OAUTH",e.OIDC_AUTH="OIDC_AUTH"})(T5||(T5={}));var F5;(function(e){e.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",e.HTTP_IN_QUERY="HTTP_IN_QUERY",e.HTTP_IN_HEADER="HTTP_IN_HEADER",e.HTTP_IN_PATH="HTTP_IN_PATH",e.HTTP_IN_BODY="HTTP_IN_BODY",e.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(F5||(F5={}));var I5;(function(e){e.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",e.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",e.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",e.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(I5||(I5={}));var D5;(function(e){e.UNSPECIFIED="UNSPECIFIED",e.BLOCKING="BLOCKING",e.NON_BLOCKING="NON_BLOCKING"})(D5||(D5={}));var U5;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.MODE_DYNAMIC="MODE_DYNAMIC"})(U5||(U5={}));var M5;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.AUTO="AUTO",e.ANY="ANY",e.NONE="NONE",e.VALIDATED="VALIDATED"})(M5||(M5={}));var R5;(function(e){e.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH",e.MINIMAL="MINIMAL"})(R5||(R5={}));var O5;(function(e){e.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",e.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",e.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",e.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",e.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",e.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",e.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",e.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",e.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",e.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",e.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(O5||(O5={}));var P5;(function(e){e.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",e.SEVERITY="SEVERITY",e.PROBABILITY="PROBABILITY"})(P5||(P5={}));var L5;(function(e){e.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",e.BLOCK_NONE="BLOCK_NONE",e.OFF="OFF"})(L5||(L5={}));var Q5;(function(e){e.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",e.STOP="STOP",e.MAX_TOKENS="MAX_TOKENS",e.SAFETY="SAFETY",e.RECITATION="RECITATION",e.LANGUAGE="LANGUAGE",e.OTHER="OTHER",e.BLOCKLIST="BLOCKLIST",e.PROHIBITED_CONTENT="PROHIBITED_CONTENT",e.SPII="SPII",e.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",e.IMAGE_SAFETY="IMAGE_SAFETY",e.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",e.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",e.NO_IMAGE="NO_IMAGE",e.IMAGE_RECITATION="IMAGE_RECITATION",e.IMAGE_OTHER="IMAGE_OTHER"})(Q5||(Q5={}));var H5;(function(e){e.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",e.NEGLIGIBLE="NEGLIGIBLE",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"})(H5||(H5={}));var z5;(function(e){e.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",e.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",e.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",e.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",e.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(z5||(z5={}));var $5;(function(e){e.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",e.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",e.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",e.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",e.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})($5||($5={}));var V5;(function(e){e.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",e.SAFETY="SAFETY",e.OTHER="OTHER",e.BLOCKLIST="BLOCKLIST",e.PROHIBITED_CONTENT="PROHIBITED_CONTENT",e.IMAGE_SAFETY="IMAGE_SAFETY",e.MODEL_ARMOR="MODEL_ARMOR",e.JAILBREAK="JAILBREAK"})(V5||(V5={}));var G5;(function(e){e.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",e.ON_DEMAND="ON_DEMAND",e.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(G5||(G5={}));var Tg;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.AUDIO="AUDIO"})(Tg||(Tg={}));var K5;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",e.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",e.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",e.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(K5||(K5={}));var q5;(function(e){e.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",e.TUNING_MODE_FULL="TUNING_MODE_FULL",e.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(q5||(q5={}));var W5;(function(e){e.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",e.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",e.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",e.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",e.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",e.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",e.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(W5||(W5={}));var nC;(function(e){e.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",e.JOB_STATE_QUEUED="JOB_STATE_QUEUED",e.JOB_STATE_PENDING="JOB_STATE_PENDING",e.JOB_STATE_RUNNING="JOB_STATE_RUNNING",e.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",e.JOB_STATE_FAILED="JOB_STATE_FAILED",e.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",e.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",e.JOB_STATE_PAUSED="JOB_STATE_PAUSED",e.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",e.JOB_STATE_UPDATING="JOB_STATE_UPDATING",e.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(nC||(nC={}));var Y5;(function(e){e.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",e.TUNING_TASK_I2V="TUNING_TASK_I2V",e.TUNING_TASK_T2V="TUNING_TASK_T2V",e.TUNING_TASK_R2V="TUNING_TASK_R2V"})(Y5||(Y5={}));var X5;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",e.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",e.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",e.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",e.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(X5||(X5={}));var sC;(function(e){e.COLLECTION="COLLECTION"})(sC||(sC={}));var J5;(function(e){e.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",e.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",e.BALANCED="BALANCED",e.PRIORITIZE_COST="PRIORITIZE_COST"})(J5||(J5={}));var Z5;(function(e){e.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",e.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(Z5||(Z5={}));var Fg;(function(e){e.PREDICT="PREDICT",e.EMBED_CONTENT="EMBED_CONTENT"})(Fg||(Fg={}));var e3;(function(e){e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",e.BLOCK_NONE="BLOCK_NONE"})(e3||(e3={}));var t3;(function(e){e.DONT_ALLOW="DONT_ALLOW",e.ALLOW_ADULT="ALLOW_ADULT",e.ALLOW_ALL="ALLOW_ALL"})(t3||(t3={}));var r3;(function(e){e.auto="auto",e.en="en",e.ja="ja",e.ko="ko",e.hi="hi",e.zh="zh",e.pt="pt",e.es="es"})(r3||(r3={}));var a3;(function(e){e.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",e.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",e.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",e.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",e.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(a3||(a3={}));var n3;(function(e){e.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",e.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",e.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",e.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(n3||(n3={}));var s3;(function(e){e.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",e.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",e.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",e.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(s3||(s3={}));var i3;(function(e){e.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",e.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",e.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",e.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",e.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",e.EDIT_MODE_STYLE="EDIT_MODE_STYLE",e.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",e.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(i3||(i3={}));var l3;(function(e){e.FOREGROUND="FOREGROUND",e.BACKGROUND="BACKGROUND",e.PROMPT="PROMPT",e.SEMANTIC="SEMANTIC",e.INTERACTIVE="INTERACTIVE"})(l3||(l3={}));var o3;(function(e){e.ASSET="ASSET",e.STYLE="STYLE"})(o3||(o3={}));var c3;(function(e){e.INSERT="INSERT",e.REMOVE="REMOVE",e.REMOVE_STATIC="REMOVE_STATIC",e.OUTPAINT="OUTPAINT"})(c3||(c3={}));var d3;(function(e){e.OPTIMIZED="OPTIMIZED",e.LOSSLESS="LOSSLESS"})(d3||(d3={}));var u3;(function(e){e.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",e.PREFERENCE_TUNING="PREFERENCE_TUNING",e.DISTILLATION="DISTILLATION"})(u3||(u3={}));var A3;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.STATE_PENDING="STATE_PENDING",e.STATE_ACTIVE="STATE_ACTIVE",e.STATE_FAILED="STATE_FAILED"})(A3||(A3={}));var f3;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.PROCESSING="PROCESSING",e.ACTIVE="ACTIVE",e.FAILED="FAILED"})(f3||(f3={}));var p3;(function(e){e.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",e.UPLOADED="UPLOADED",e.GENERATED="GENERATED",e.REGISTERED="REGISTERED"})(p3||(p3={}));var h3;(function(e){e.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",e.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",e.RESPONSE_REJECTED="RESPONSE_REJECTED",e.NEED_MORE_INPUT="NEED_MORE_INPUT"})(h3||(h3={}));var x3;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.DOCUMENT="DOCUMENT"})(x3||(x3={}));var m3;(function(e){e.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",e.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",e.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(m3||(m3={}));var g3;(function(e){e.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",e.ACTIVITY_START="ACTIVITY_START",e.ACTIVITY_END="ACTIVITY_END"})(g3||(g3={}));var b3;(function(e){e.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",e.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",e.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(b3||(b3={}));var v3;(function(e){e.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",e.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",e.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(v3||(v3={}));var y3;(function(e){e.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",e.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",e.NO_INTERRUPTION="NO_INTERRUPTION"})(y3||(y3={}));var w3;(function(e){e.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",e.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",e.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(w3||(w3={}));var N3;(function(e){e.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",e.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",e.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",e.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",e.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",e.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",e.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",e.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",e.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",e.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",e.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",e.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",e.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(N3||(N3={}));var C3;(function(e){e.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",e.QUALITY="QUALITY",e.DIVERSITY="DIVERSITY",e.VOCALIZATION="VOCALIZATION"})(C3||(C3={}));var AA;(function(e){e.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",e.PLAY="PLAY",e.PAUSE="PAUSE",e.STOP="STOP",e.RESET_CONTEXT="RESET_CONTEXT"})(AA||(AA={}));class iC{constructor(t){const r={};for(const a of t.headers.entries())r[a[0]]=a[1];this.headers=r,this.responseInternal=t}json(){return this.responseInternal.json()}}class sf{get text(){var t,r,a,s,i,l,o,d;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let u="",f=!1;const p=[];for(const x of(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)!==null&&d!==void 0?d:[]){for(const[m,b]of Object.entries(x))m!=="text"&&m!=="thought"&&m!=="thoughtSignature"&&(b!==null||b!==void 0)&&p.push(m);if(typeof x.text=="string"){if(typeof x.thought=="boolean"&&x.thought)continue;f=!0,u+=x.text}}return p.length>0&&console.warn(`there are non-text parts ${p} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),f?u:void 0}get data(){var t,r,a,s,i,l,o,d;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let u="";const f=[];for(const p of(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)!==null&&d!==void 0?d:[]){for(const[x,m]of Object.entries(p))x!=="inlineData"&&(m!==null||m!==void 0)&&f.push(x);p.inlineData&&typeof p.inlineData.data=="string"&&(u+=atob(p.inlineData.data))}return f.length>0&&console.warn(`there are non-data parts ${f} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),u.length>0?btoa(u):void 0}get functionCalls(){var t,r,a,s,i,l,o,d;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const u=(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)===null||d===void 0?void 0:d.filter(f=>f.functionCall).map(f=>f.functionCall).filter(f=>f!==void 0);if((u==null?void 0:u.length)!==0)return u}get executableCode(){var t,r,a,s,i,l,o,d,u;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const f=(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)===null||d===void 0?void 0:d.filter(p=>p.executableCode).map(p=>p.executableCode).filter(p=>p!==void 0);if((f==null?void 0:f.length)!==0)return(u=f==null?void 0:f[0])===null||u===void 0?void 0:u.code}get codeExecutionResult(){var t,r,a,s,i,l,o,d,u;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const f=(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)===null||d===void 0?void 0:d.filter(p=>p.codeExecutionResult).map(p=>p.codeExecutionResult).filter(p=>p!==void 0);if((f==null?void 0:f.length)!==0)return(u=f==null?void 0:f[0])===null||u===void 0?void 0:u.output}}class k3{}class j3{}class xue{}class mue{}class gue{}class bue{}class E3{}class S3{}class B3{}class vue{}class Ig{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new Ig;let s;const i=t;return r?s=nue(i):s=aue(i),Object.assign(a,s),a}}class _3{}class T3{}class F3{}class I3{}class yue{}class wue{}class Nue{}class zj{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new zj,i=uue(t);return Object.assign(a,i),a}}class Cue{}class kue{}class jue{}class Eue{}class D3{}class Sue{get text(){var t,r,a;let s="",i=!1;const l=[];for(const o of(a=(r=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||r===void 0?void 0:r.parts)!==null&&a!==void 0?a:[]){for(const[d,u]of Object.entries(o))d!=="text"&&d!=="thought"&&u!==null&&l.push(d);if(typeof o.text=="string"){if(typeof o.thought=="boolean"&&o.thought)continue;i=!0,s+=o.text}}return l.length>0&&console.warn(`there are non-text parts ${l} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),i?s:void 0}get data(){var t,r,a;let s="";const i=[];for(const l of(a=(r=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||r===void 0?void 0:r.parts)!==null&&a!==void 0?a:[]){for(const[o,d]of Object.entries(l))o!=="inlineData"&&d!==null&&i.push(o);l.inlineData&&typeof l.inlineData.data=="string"&&(s+=atob(l.inlineData.data))}return i.length>0&&console.warn(`there are non-data parts ${i} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),s.length>0?btoa(s):void 0}}class Bue{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class $j{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new $j,i=mL(t);return Object.assign(a,i),a}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Zt(e,t){if(!t||typeof t!="string")throw new Error("model is required and must be a string");if(t.includes("..")||t.includes("?")||t.includes("&"))throw new Error("invalid model parameter");if(e.isVertexAI()){if(t.startsWith("publishers/")||t.startsWith("projects/")||t.startsWith("models/"))return t;if(t.indexOf("/")>=0){const r=t.split("/",2);return`publishers/${r[0]}/models/${r[1]}`}else return`publishers/google/models/${t}`}else return t.startsWith("models/")||t.startsWith("tunedModels/")?t:`models/${t}`}function gL(e,t){const r=Zt(e,t);return r?r.startsWith("publishers/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/${r}`:r.startsWith("models/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/publishers/google/${r}`:r:""}function bL(e){return Array.isArray(e)?e.map(t=>Dg(t)):[Dg(e)]}function Dg(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function vL(e){const t=Dg(e);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function yL(e){const t=Dg(e);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function U3(e){if(e==null)throw new Error("PartUnion is required");if(typeof e=="object")return e;if(typeof e=="string")return{text:e};throw new Error(`Unsupported part type: ${typeof e}`)}function wL(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("PartListUnion is required");return Array.isArray(e)?e.map(t=>U3(t)):[U3(e)]}function lC(e){return e!=null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)}function M3(e){return e!=null&&typeof e=="object"&&"functionCall"in e}function R3(e){return e!=null&&typeof e=="object"&&"functionResponse"in e}function Ja(e){if(e==null)throw new Error("ContentUnion is required");return lC(e)?e:{role:"user",parts:wL(e)}}function Vj(e,t){if(!t)return[];if(e.isVertexAI()&&Array.isArray(t))return t.flatMap(r=>{const a=Ja(r);return a.parts&&a.parts.length>0&&a.parts[0].text!==void 0?[a.parts[0].text]:[]});if(e.isVertexAI()){const r=Ja(t);return r.parts&&r.parts.length>0&&r.parts[0].text!==void 0?[r.parts[0].text]:[]}return Array.isArray(t)?t.map(r=>Ja(r)):[Ja(t)]}function Ms(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("contents are required");if(!Array.isArray(e)){if(M3(e)||R3(e))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[Ja(e)]}const t=[],r=[],a=lC(e[0]);for(const s of e){const i=lC(s);if(i!=a)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(i)t.push(s);else{if(M3(s)||R3(s))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");r.push(s)}}return a||t.push({role:"user",parts:wL(r)}),t}function _ue(e,t){e.includes("null")&&(t.nullable=!0);const r=e.filter(a=>a!=="null");if(r.length===1)t.type=Object.values(bc).includes(r[0].toUpperCase())?r[0].toUpperCase():bc.TYPE_UNSPECIFIED;else{t.anyOf=[];for(const a of r)t.anyOf.push({type:Object.values(bc).includes(a.toUpperCase())?a.toUpperCase():bc.TYPE_UNSPECIFIED})}}function gA(e){const t={},r=["items"],a=["anyOf"],s=["properties"];if(e.type&&e.anyOf)throw new Error("type and anyOf cannot be both populated.");const i=e.anyOf;i!=null&&i.length==2&&(i[0].type==="null"?(t.nullable=!0,e=i[1]):i[1].type==="null"&&(t.nullable=!0,e=i[0])),e.type instanceof Array&&_ue(e.type,t);for(const[l,o]of Object.entries(e))if(o!=null)if(l=="type"){if(o==="null")throw new Error("type: null can not be the only possible type for the field.");if(o instanceof Array)continue;t.type=Object.values(bc).includes(o.toUpperCase())?o.toUpperCase():bc.TYPE_UNSPECIFIED}else if(r.includes(l))t[l]=gA(o);else if(a.includes(l)){const d=[];for(const u of o){if(u.type=="null"){t.nullable=!0;continue}d.push(gA(u))}t[l]=d}else if(s.includes(l)){const d={};for(const[u,f]of Object.entries(o))d[u]=gA(f);t[l]=d}else{if(l==="additionalProperties")continue;t[l]=o}return t}function Gj(e){return gA(e)}function Kj(e){if(typeof e=="object")return e;if(typeof e=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:e}}};throw new Error(`Unsupported speechConfig type: ${typeof e}`)}function qj(e){if("multiSpeakerVoiceConfig"in e)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return e}function XA(e){if(e.functionDeclarations)for(const t of e.functionDeclarations)t.parameters&&(Object.keys(t.parameters).includes("$schema")?t.parametersJsonSchema||(t.parametersJsonSchema=t.parameters,delete t.parameters):t.parameters=gA(t.parameters)),t.response&&(Object.keys(t.response).includes("$schema")?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=gA(t.response));return e}function JA(e){if(e==null)throw new Error("tools is required");if(!Array.isArray(e))throw new Error("tools is required and must be an array of Tools");const t=[];for(const r of e)t.push(r);return t}function Tue(e,t,r,a=1){const s=!t.startsWith(`${r}/`)&&t.split("/").length===a;return e.isVertexAI()?t.startsWith("projects/")?t:t.startsWith("locations/")?`projects/${e.getProject()}/${t}`:t.startsWith(`${r}/`)?`projects/${e.getProject()}/locations/${e.getLocation()}/${t}`:s?`projects/${e.getProject()}/locations/${e.getLocation()}/${r}/${t}`:t:s?`${r}/${t}`:t}function Uo(e,t){if(typeof t!="string")throw new Error("name must be a string");return Tue(e,t,"cachedContents")}function NL(e){switch(e){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return e}}function $c(e){return Hj(e)}function Fue(e){return e!=null&&typeof e=="object"&&"name"in e}function Iue(e){return e!=null&&typeof e=="object"&&"video"in e}function Due(e){return e!=null&&typeof e=="object"&&"uri"in e}function CL(e){var t;let r;if(Fue(e)&&(r=e.name),!(Due(e)&&(r=e.uri,r===void 0))&&!(Iue(e)&&(r=(t=e.video)===null||t===void 0?void 0:t.uri,r===void 0))){if(typeof e=="string"&&(r=e),r===void 0)throw new Error("Could not extract file name from the provided input.");if(r.startsWith("https://")){const s=r.split("files/")[1].match(/[a-z0-9]+/);if(s===null)throw new Error(`Could not extract file name from URI ${r}`);r=s[0]}else r.startsWith("files/")&&(r=r.split("files/")[1]);return r}}function kL(e,t){let r;return e.isVertexAI()?r=t?"publishers/google/models":"models":r=t?"models":"tunedModels",r}function jL(e){for(const t of["models","tunedModels","publisherModels"])if(Uue(e,t))return e[t];return[]}function Uue(e,t){return e!==null&&typeof e=="object"&&t in e}function Mue(e,t={}){const r=e,a={name:r.name,description:r.description,parametersJsonSchema:r.inputSchema};return r.outputSchema&&(a.responseJsonSchema=r.outputSchema),t.behavior&&(a.behavior=t.behavior),{functionDeclarations:[a]}}function Rue(e,t={}){const r=[],a=new Set;for(const s of e){const i=s.name;if(a.has(i))throw new Error(`Duplicate function name ${i} found in MCP tools. Please ensure function names are unique.`);a.add(i);const l=Mue(s,t);l.functionDeclarations&&r.push(...l.functionDeclarations)}return{functionDeclarations:r}}function EL(e,t){let r;if(typeof t=="string")if(e.isVertexAI())if(t.startsWith("gs://"))r={format:"jsonl",gcsUri:[t]};else if(t.startsWith("bq://"))r={format:"bigquery",bigqueryUri:t};else throw new Error(`Unsupported string source for Vertex AI: ${t}`);else if(t.startsWith("files/"))r={fileName:t};else throw new Error(`Unsupported string source for Gemini API: ${t}`);else if(Array.isArray(t)){if(e.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");r={inlinedRequests:t}}else r=t;const a=[r.gcsUri,r.bigqueryUri].filter(Boolean).length,s=[r.inlinedRequests,r.fileName].filter(Boolean).length;if(e.isVertexAI()){if(s>0||a!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(a>0||s!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return r}function Oue(e){if(typeof e!="string")return e;const t=e;if(t.startsWith("gs://"))return{format:"jsonl",gcsUri:t};if(t.startsWith("bq://"))return{format:"bigquery",bigqueryUri:t};throw new Error(`Unsupported destination: ${t}`)}function SL(e){if(typeof e!="object"||e===null)return{};const t=e,r=t.inlinedResponses;if(typeof r!="object"||r===null)return e;const s=r.inlinedResponses;if(!Array.isArray(s)||s.length===0)return e;let i=!1;for(const l of s){if(typeof l!="object"||l===null)continue;const d=l.response;if(typeof d!="object"||d===null)continue;if(d.embedding!==void 0){i=!0;break}}return i&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),e}function ZA(e,t){const r=t;if(!e.isVertexAI()){if(/batches\/[^/]+$/.test(r))return r.split("/").pop();throw new Error(`Invalid batch job name: ${r}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(r))return r.split("/").pop();if(/^\d+$/.test(r))return r;throw new Error(`Invalid batch job name: ${r}.`)}function BL(e){const t=e;return t==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":t==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":t==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":t==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":t==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":t==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":t==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":t}function Pue(e){return e.includes("gemini")&&e!=="gemini-embedding-001"||e.includes("maas")}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Lue(e){const t={},r=w(e,["responsesFile"]);r!=null&&N(t,["fileName"],r);const a=w(e,["inlinedResponses","inlinedResponses"]);if(a!=null){let i=a;Array.isArray(i)&&(i=i.map(l=>vAe(l))),N(t,["inlinedResponses"],i)}const s=w(e,["inlinedEmbedContentResponses","inlinedResponses"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["inlinedEmbedContentResponses"],i)}return t}function Que(e){const t={},r=w(e,["predictionsFormat"]);r!=null&&N(t,["format"],r);const a=w(e,["gcsDestination","outputUriPrefix"]);a!=null&&N(t,["gcsUri"],a);const s=w(e,["bigqueryDestination","outputUri"]);return s!=null&&N(t,["bigqueryUri"],s),t}function Hue(e){const t={},r=w(e,["format"]);r!=null&&N(t,["predictionsFormat"],r);const a=w(e,["gcsUri"]);a!=null&&N(t,["gcsDestination","outputUriPrefix"],a);const s=w(e,["bigqueryUri"]);if(s!=null&&N(t,["bigqueryDestination","outputUri"],s),w(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(w(e,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(w(e,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return t}function Tm(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata","displayName"]);a!=null&&N(t,["displayName"],a);const s=w(e,["metadata","state"]);s!=null&&N(t,["state"],BL(s));const i=w(e,["metadata","createTime"]);i!=null&&N(t,["createTime"],i);const l=w(e,["metadata","endTime"]);l!=null&&N(t,["endTime"],l);const o=w(e,["metadata","updateTime"]);o!=null&&N(t,["updateTime"],o);const d=w(e,["metadata","model"]);d!=null&&N(t,["model"],d);const u=w(e,["metadata","output"]);return u!=null&&N(t,["dest"],Lue(SL(u))),t}function oC(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["displayName"]);a!=null&&N(t,["displayName"],a);const s=w(e,["state"]);s!=null&&N(t,["state"],BL(s));const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["createTime"]);l!=null&&N(t,["createTime"],l);const o=w(e,["startTime"]);o!=null&&N(t,["startTime"],o);const d=w(e,["endTime"]);d!=null&&N(t,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&N(t,["updateTime"],u);const f=w(e,["model"]);f!=null&&N(t,["model"],f);const p=w(e,["inputConfig"]);p!=null&&N(t,["src"],zue(p));const x=w(e,["outputConfig"]);x!=null&&N(t,["dest"],Que(SL(x)));const m=w(e,["completionStats"]);return m!=null&&N(t,["completionStats"],m),t}function zue(e){const t={},r=w(e,["instancesFormat"]);r!=null&&N(t,["format"],r);const a=w(e,["gcsSource","uris"]);a!=null&&N(t,["gcsUri"],a);const s=w(e,["bigquerySource","inputUri"]);return s!=null&&N(t,["bigqueryUri"],s),t}function $ue(e,t){const r={};if(w(t,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(w(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(w(t,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const a=w(t,["fileName"]);a!=null&&N(r,["fileName"],a);const s=w(t,["inlinedRequests"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>bAe(e,l))),N(r,["requests","requests"],i)}return r}function Vue(e){const t={},r=w(e,["format"]);r!=null&&N(t,["instancesFormat"],r);const a=w(e,["gcsUri"]);a!=null&&N(t,["gcsSource","uris"],a);const s=w(e,["bigqueryUri"]);if(s!=null&&N(t,["bigquerySource","inputUri"],s),w(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(w(e,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return t}function Gue(e){const t={},r=w(e,["data"]);if(r!=null&&N(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function Kue(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function que(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function Wue(e){const t={},r=w(e,["content"]);r!=null&&N(t,["content"],r);const a=w(e,["citationMetadata"]);a!=null&&N(t,["citationMetadata"],Yue(a));const s=w(e,["tokenCount"]);s!=null&&N(t,["tokenCount"],s);const i=w(e,["finishReason"]);i!=null&&N(t,["finishReason"],i);const l=w(e,["avgLogprobs"]);l!=null&&N(t,["avgLogprobs"],l);const o=w(e,["groundingMetadata"]);o!=null&&N(t,["groundingMetadata"],o);const d=w(e,["index"]);d!=null&&N(t,["index"],d);const u=w(e,["logprobsResult"]);u!=null&&N(t,["logprobsResult"],u);const f=w(e,["safetyRatings"]);if(f!=null){let x=f;Array.isArray(x)&&(x=x.map(m=>m)),N(t,["safetyRatings"],x)}const p=w(e,["urlContextMetadata"]);return p!=null&&N(t,["urlContextMetadata"],p),t}function Yue(e){const t={},r=w(e,["citationSources"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(s=>s)),N(t,["citations"],a)}return t}function _L(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>EAe(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function Xue(e,t){const r={},a=w(e,["displayName"]);if(t!==void 0&&a!=null&&N(t,["batch","displayName"],a),w(e,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return r}function Jue(e,t){const r={},a=w(e,["displayName"]);t!==void 0&&a!=null&&N(t,["displayName"],a);const s=w(e,["dest"]);return t!==void 0&&s!=null&&N(t,["outputConfig"],Hue(Oue(s))),r}function O3(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["_url","model"],Zt(e,a));const s=w(t,["src"]);s!=null&&N(r,["batch","inputConfig"],$ue(e,EL(e,s)));const i=w(t,["config"]);return i!=null&&Xue(i,r),r}function Zue(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["model"],Zt(e,a));const s=w(t,["src"]);s!=null&&N(r,["inputConfig"],Vue(EL(e,s)));const i=w(t,["config"]);return i!=null&&Jue(i,r),r}function eAe(e,t){const r={},a=w(e,["displayName"]);return t!==void 0&&a!=null&&N(t,["batch","displayName"],a),r}function tAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["_url","model"],Zt(e,a));const s=w(t,["src"]);s!=null&&N(r,["batch","inputConfig"],oAe(e,s));const i=w(t,["config"]);return i!=null&&eAe(i,r),r}function rAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function aAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function nAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);return i!=null&&N(t,["error"],i),t}function sAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);return i!=null&&N(t,["error"],i),t}function iAe(e,t){const r={},a=w(t,["contents"]);if(a!=null){let i=Vj(e,a);Array.isArray(i)&&(i=i.map(l=>l)),N(r,["requests[]","request","content"],i)}const s=w(t,["config"]);return s!=null&&(N(r,["_self"],lAe(s,r)),tue(r,{"requests[].*":"requests[].request.*"})),r}function lAe(e,t){const r={},a=w(e,["taskType"]);t!==void 0&&a!=null&&N(t,["requests[]","taskType"],a);const s=w(e,["title"]);t!==void 0&&s!=null&&N(t,["requests[]","title"],s);const i=w(e,["outputDimensionality"]);if(t!==void 0&&i!=null&&N(t,["requests[]","outputDimensionality"],i),w(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(w(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return r}function oAe(e,t){const r={},a=w(t,["fileName"]);a!=null&&N(r,["file_name"],a);const s=w(t,["inlinedRequests"]);return s!=null&&N(r,["requests"],iAe(e,s)),r}function cAe(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function dAe(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function uAe(e){const t={},r=w(e,["allowedFunctionNames"]);r!=null&&N(t,["allowedFunctionNames"],r);const a=w(e,["mode"]);if(a!=null&&N(t,["mode"],a),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function AAe(e,t,r){const a={},s=w(t,["systemInstruction"]);r!==void 0&&s!=null&&N(r,["systemInstruction"],_L(Ja(s)));const i=w(t,["temperature"]);i!=null&&N(a,["temperature"],i);const l=w(t,["topP"]);l!=null&&N(a,["topP"],l);const o=w(t,["topK"]);o!=null&&N(a,["topK"],o);const d=w(t,["candidateCount"]);d!=null&&N(a,["candidateCount"],d);const u=w(t,["maxOutputTokens"]);u!=null&&N(a,["maxOutputTokens"],u);const f=w(t,["stopSequences"]);f!=null&&N(a,["stopSequences"],f);const p=w(t,["responseLogprobs"]);p!=null&&N(a,["responseLogprobs"],p);const x=w(t,["logprobs"]);x!=null&&N(a,["logprobs"],x);const m=w(t,["presencePenalty"]);m!=null&&N(a,["presencePenalty"],m);const b=w(t,["frequencyPenalty"]);b!=null&&N(a,["frequencyPenalty"],b);const v=w(t,["seed"]);v!=null&&N(a,["seed"],v);const y=w(t,["responseMimeType"]);y!=null&&N(a,["responseMimeType"],y);const k=w(t,["responseSchema"]);k!=null&&N(a,["responseSchema"],Gj(k));const _=w(t,["responseJsonSchema"]);if(_!=null&&N(a,["responseJsonSchema"],_),w(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(w(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const C=w(t,["safetySettings"]);if(r!==void 0&&C!=null){let Q=C;Array.isArray(Q)&&(Q=Q.map(G=>SAe(G))),N(r,["safetySettings"],Q)}const E=w(t,["tools"]);if(r!==void 0&&E!=null){let Q=JA(E);Array.isArray(Q)&&(Q=Q.map(G=>_Ae(XA(G)))),N(r,["tools"],Q)}const T=w(t,["toolConfig"]);if(r!==void 0&&T!=null&&N(r,["toolConfig"],BAe(T)),w(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const B=w(t,["cachedContent"]);r!==void 0&&B!=null&&N(r,["cachedContent"],Uo(e,B));const I=w(t,["responseModalities"]);I!=null&&N(a,["responseModalities"],I);const M=w(t,["mediaResolution"]);M!=null&&N(a,["mediaResolution"],M);const U=w(t,["speechConfig"]);if(U!=null&&N(a,["speechConfig"],Kj(U)),w(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const D=w(t,["thinkingConfig"]);D!=null&&N(a,["thinkingConfig"],D);const L=w(t,["imageConfig"]);L!=null&&N(a,["imageConfig"],gAe(L));const R=w(t,["enableEnhancedCivicAnswers"]);if(R!=null&&N(a,["enableEnhancedCivicAnswers"],R),w(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return a}function fAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["candidates"]);if(a!=null){let d=a;Array.isArray(d)&&(d=d.map(u=>Wue(u))),N(t,["candidates"],d)}const s=w(e,["modelVersion"]);s!=null&&N(t,["modelVersion"],s);const i=w(e,["promptFeedback"]);i!=null&&N(t,["promptFeedback"],i);const l=w(e,["responseId"]);l!=null&&N(t,["responseId"],l);const o=w(e,["usageMetadata"]);return o!=null&&N(t,["usageMetadata"],o),t}function pAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function hAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function xAe(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&N(t,["enableWidget"],r),t}function mAe(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&N(t,["timeRangeFilter"],r),t}function gAe(e){const t={},r=w(e,["aspectRatio"]);r!=null&&N(t,["aspectRatio"],r);const a=w(e,["imageSize"]);if(a!=null&&N(t,["imageSize"],a),w(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(w(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(w(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return t}function bAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["request","model"],Zt(e,a));const s=w(t,["contents"]);if(s!=null){let o=Ms(s);Array.isArray(o)&&(o=o.map(d=>_L(d))),N(r,["request","contents"],o)}const i=w(t,["metadata"]);i!=null&&N(r,["metadata"],i);const l=w(t,["config"]);return l!=null&&N(r,["request","generationConfig"],AAe(e,l,w(r,["request"],{}))),r}function vAe(e){const t={},r=w(e,["response"]);r!=null&&N(t,["response"],fAe(r));const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["error"]);return s!=null&&N(t,["error"],s),t}function yAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);if(t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),w(e,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return r}function wAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);t!==void 0&&s!=null&&N(t,["_query","pageToken"],s);const i=w(e,["filter"]);return t!==void 0&&i!=null&&N(t,["_query","filter"],i),r}function NAe(e){const t={},r=w(e,["config"]);return r!=null&&yAe(r,t),t}function CAe(e){const t={},r=w(e,["config"]);return r!=null&&wAe(r,t),t}function kAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["operations"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>Tm(l))),N(t,["batchJobs"],i)}return t}function jAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["batchPredictionJobs"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>oC(l))),N(t,["batchJobs"],i)}return t}function EAe(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],cAe(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],dAe(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],Gue(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function SAe(e){const t={},r=w(e,["category"]);if(r!=null&&N(t,["category"],r),w(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const a=w(e,["threshold"]);return a!=null&&N(t,["threshold"],a),t}function BAe(e){const t={},r=w(e,["retrievalConfig"]);r!=null&&N(t,["retrievalConfig"],r);const a=w(e,["functionCallingConfig"]);return a!=null&&N(t,["functionCallingConfig"],uAe(a)),t}function _Ae(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],xAe(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],mAe(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var wo;(function(e){e.PAGED_ITEM_BATCH_JOBS="batchJobs",e.PAGED_ITEM_MODELS="models",e.PAGED_ITEM_TUNING_JOBS="tuningJobs",e.PAGED_ITEM_FILES="files",e.PAGED_ITEM_CACHED_CONTENTS="cachedContents",e.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",e.PAGED_ITEM_DOCUMENTS="documents"})(wo||(wo={}));class au{constructor(t,r,a,s){this.pageInternal=[],this.paramsInternal={},this.requestInternal=r,this.init(t,a,s)}init(t,r,a){var s,i;this.nameInternal=t,this.pageInternal=r[this.nameInternal]||[],this.sdkHttpResponseInternal=r==null?void 0:r.sdkHttpResponse,this.idxInternal=0;let l={config:{}};!a||Object.keys(a).length===0?l={config:{}}:typeof a=="object"?l=Object.assign({},a):l=a,l.config&&(l.config.pageToken=r.nextPageToken),this.paramsInternal=l,this.pageInternalSize=(i=(s=l.config)===null||s===void 0?void 0:s.pageSize)!==null&&i!==void 0?i:this.pageInternal.length}initNextPage(t){this.init(this.nameInternal,t,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(t){return this.pageInternal[t]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const t=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:t,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const t=await this.requestInternal(this.params);return this.initNextPage(t),this.page}hasNextPage(){var t;return((t=this.params.config)===null||t===void 0?void 0:t.pageToken)!==void 0}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class TAe extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.PAGED_ITEM_BATCH_JOBS,a=>this.listInternal(a),await this.listInternal(r),r),this.create=async r=>(this.apiClient.isVertexAI()&&(r.config=this.formatDestination(r.src,r.config)),this.createInternal(r)),this.createEmbeddings=async r=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Vertex AI does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(r)}}createInlinedGenerateContentRequest(t){const r=O3(this.apiClient,t),a=r._url,s=Ze("{model}:batchGenerateContent",a),o=r.batch.inputConfig.requests,d=o.requests,u=[];for(const f of d){const p=Object.assign({},f);if(p.systemInstruction){const x=p.systemInstruction;delete p.systemInstruction;const m=p.request;m.systemInstruction=x,p.request=m}u.push(p)}return o.requests=u,delete r.config,delete r._url,delete r._query,{path:s,body:r}}getGcsUri(t){if(typeof t=="string")return t.startsWith("gs://")?t:void 0;if(!Array.isArray(t)&&t.gcsUri&&t.gcsUri.length>0)return t.gcsUri[0]}getBigqueryUri(t){if(typeof t=="string")return t.startsWith("bq://")?t:void 0;if(!Array.isArray(t))return t.bigqueryUri}formatDestination(t,r){const a=r?Object.assign({},r):{},s=Date.now().toString();if(a.displayName||(a.displayName=`genaiBatchJob_${s}`),a.dest===void 0){const i=this.getGcsUri(t),l=this.getBigqueryUri(t);if(i)i.endsWith(".jsonl")?a.dest=`${i.slice(0,-6)}/dest`:a.dest=`${i}_dest_${s}`;else if(l)a.dest=`${l}_dest_${s}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return a}async createInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Zue(this.apiClient,t);return o=Ze("batchPredictionJobs",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>oC(f))}else{const u=O3(this.apiClient,t);return o=Ze("{model}:batchGenerateContent",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>Tm(f))}}async createEmbeddingsInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=tAe(this.apiClient,t);return i=Ze("{model}:asyncBatchEmbedContent",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>Tm(d))}}async get(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=hAe(this.apiClient,t);return o=Ze("batchPredictionJobs/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>oC(f))}else{const u=pAe(this.apiClient,t);return o=Ze("batches/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>Tm(f))}}async cancel(t){var r,a,s,i;let l="",o={};if(this.apiClient.isVertexAI()){const d=que(this.apiClient,t);l=Ze("batchPredictionJobs/{name}:cancel",d._url),o=d._query,delete d._url,delete d._query,await this.apiClient.request({path:l,queryParams:o,body:JSON.stringify(d),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}else{const d=Kue(this.apiClient,t);l=Ze("batches/{name}:cancel",d._url),o=d._query,delete d._url,delete d._query,await this.apiClient.request({path:l,queryParams:o,body:JSON.stringify(d),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=CAe(t);return o=Ze("batchPredictionJobs",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=jAe(f),x=new D3;return Object.assign(x,p),x})}else{const u=NAe(t);return o=Ze("batches",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=kAe(f),x=new D3;return Object.assign(x,p),x})}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=aAe(this.apiClient,t);return o=Ze("batchPredictionJobs/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>sAe(f))}else{const u=rAe(this.apiClient,t);return o=Ze("batches/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>nAe(f))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function FAe(e){const t={},r=w(e,["data"]);if(r!=null&&N(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function P3(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>t0e(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function IAe(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);t!==void 0&&s!=null&&N(t,["expireTime"],s);const i=w(e,["displayName"]);t!==void 0&&i!=null&&N(t,["displayName"],i);const l=w(e,["contents"]);if(t!==void 0&&l!=null){let f=Ms(l);Array.isArray(f)&&(f=f.map(p=>P3(p))),N(t,["contents"],f)}const o=w(e,["systemInstruction"]);t!==void 0&&o!=null&&N(t,["systemInstruction"],P3(Ja(o)));const d=w(e,["tools"]);if(t!==void 0&&d!=null){let f=d;Array.isArray(f)&&(f=f.map(p=>a0e(p))),N(t,["tools"],f)}const u=w(e,["toolConfig"]);if(t!==void 0&&u!=null&&N(t,["toolConfig"],r0e(u)),w(e,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return r}function DAe(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);t!==void 0&&s!=null&&N(t,["expireTime"],s);const i=w(e,["displayName"]);t!==void 0&&i!=null&&N(t,["displayName"],i);const l=w(e,["contents"]);if(t!==void 0&&l!=null){let p=Ms(l);Array.isArray(p)&&(p=p.map(x=>x)),N(t,["contents"],p)}const o=w(e,["systemInstruction"]);t!==void 0&&o!=null&&N(t,["systemInstruction"],Ja(o));const d=w(e,["tools"]);if(t!==void 0&&d!=null){let p=d;Array.isArray(p)&&(p=p.map(x=>n0e(x))),N(t,["tools"],p)}const u=w(e,["toolConfig"]);t!==void 0&&u!=null&&N(t,["toolConfig"],u);const f=w(e,["kmsKeyName"]);return t!==void 0&&f!=null&&N(t,["encryption_spec","kmsKeyName"],f),r}function UAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["model"],gL(e,a));const s=w(t,["config"]);return s!=null&&IAe(s,r),r}function MAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["model"],gL(e,a));const s=w(t,["config"]);return s!=null&&DAe(s,r),r}function RAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function OAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function PAe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function LAe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function QAe(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function HAe(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function zAe(e){const t={},r=w(e,["allowedFunctionNames"]);r!=null&&N(t,["allowedFunctionNames"],r);const a=w(e,["mode"]);if(a!=null&&N(t,["mode"],a),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function $Ae(e){const t={},r=w(e,["description"]);r!=null&&N(t,["description"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["parameters"]);s!=null&&N(t,["parameters"],s);const i=w(e,["parametersJsonSchema"]);i!=null&&N(t,["parametersJsonSchema"],i);const l=w(e,["response"]);l!=null&&N(t,["response"],l);const o=w(e,["responseJsonSchema"]);if(o!=null&&N(t,["responseJsonSchema"],o),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function VAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function GAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function KAe(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&N(t,["enableWidget"],r),t}function qAe(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&N(t,["timeRangeFilter"],r),t}function WAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function YAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function XAe(e){const t={},r=w(e,["config"]);return r!=null&&WAe(r,t),t}function JAe(e){const t={},r=w(e,["config"]);return r!=null&&YAe(r,t),t}function ZAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["cachedContents"],i)}return t}function e0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["cachedContents"],i)}return t}function t0e(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],QAe(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],HAe(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],FAe(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function r0e(e){const t={},r=w(e,["retrievalConfig"]);r!=null&&N(t,["retrievalConfig"],r);const a=w(e,["functionCallingConfig"]);return a!=null&&N(t,["functionCallingConfig"],zAe(a)),t}function a0e(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],KAe(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],qAe(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}function n0e(e){const t={},r=w(e,["retrieval"]);r!=null&&N(t,["retrieval"],r);const a=w(e,["computerUse"]);if(a!=null&&N(t,["computerUse"],a),w(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const s=w(e,["codeExecution"]);s!=null&&N(t,["codeExecution"],s);const i=w(e,["enterpriseWebSearch"]);i!=null&&N(t,["enterpriseWebSearch"],i);const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(x=>$Ae(x))),N(t,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&N(t,["googleMaps"],o);const d=w(e,["googleSearch"]);d!=null&&N(t,["googleSearch"],d);const u=w(e,["googleSearchRetrieval"]);u!=null&&N(t,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&N(t,["urlContext"],f),t}function s0e(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);return t!==void 0&&s!=null&&N(t,["expireTime"],s),r}function i0e(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);return t!==void 0&&s!=null&&N(t,["expireTime"],s),r}function l0e(e,t){const r={},a=w(t,["name"]);a!=null&&N(r,["_url","name"],Uo(e,a));const s=w(t,["config"]);return s!=null&&s0e(s,r),r}function o0e(e,t){const r={},a=w(t,["name"]);a!=null&&N(r,["_url","name"],Uo(e,a));const s=w(t,["config"]);return s!=null&&i0e(s,r),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class c0e extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.PAGED_ITEM_CACHED_CONTENTS,a=>this.listInternal(a),await this.listInternal(r),r)}async create(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=MAe(this.apiClient,t);return o=Ze("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>f)}else{const u=UAe(this.apiClient,t);return o=Ze("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>f)}}async get(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=GAe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>f)}else{const u=VAe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>f)}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=OAe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=LAe(f),x=new F3;return Object.assign(x,p),x})}else{const u=RAe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=PAe(f),x=new F3;return Object.assign(x,p),x})}}async update(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=o0e(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>f)}else{const u=l0e(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>f)}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=JAe(t);return o=Ze("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=e0e(f),x=new I3;return Object.assign(x,p),x})}else{const u=XAe(t);return o=Ze("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=ZAe(f),x=new I3;return Object.assign(x,p),x})}}}function Ug(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]]);return r}function L3(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function wt(e){return this instanceof wt?(this.v=e,this):new wt(e)}function Li(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=r.apply(e,t||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",l),s[Symbol.asyncIterator]=function(){return this},s;function l(m){return function(b){return Promise.resolve(b).then(m,p)}}function o(m,b){a[m]&&(s[m]=function(v){return new Promise(function(y,k){i.push([m,v,y,k])>1||d(m,v)})},b&&(s[m]=b(s[m])))}function d(m,b){try{u(a[m](b))}catch(v){x(i[0][3],v)}}function u(m){m.value instanceof wt?Promise.resolve(m.value.v).then(f,p):x(i[0][2],m)}function f(m){d("next",m)}function p(m){d("throw",m)}function x(m,b){m(b),i.shift(),i.length&&d(i[0][0],i[0][1])}}function Qi(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof L3=="function"?L3(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(i){r[i]=e[i]&&function(l){return new Promise(function(o,d){l=e[i](l),s(o,d,l.done,l.value)})}}function s(i,l,o,d){Promise.resolve(d).then(function(u){i({value:u,done:o})},l)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function d0e(e){var t;if(e.candidates==null||e.candidates.length===0)return!1;const r=(t=e.candidates[0])===null||t===void 0?void 0:t.content;return r===void 0?!1:TL(r)}function TL(e){if(e.parts===void 0||e.parts.length===0)return!1;for(const t of e.parts)if(t===void 0||Object.keys(t).length===0)return!1;return!0}function u0e(e){if(e.length!==0){for(const t of e)if(t.role!=="user"&&t.role!=="model")throw new Error(`Role must be user or model, but got ${t.role}.`)}}function Q3(e){if(e===void 0||e.length===0)return[];const t=[],r=e.length;let a=0;for(;a<r;)if(e[a].role==="user")t.push(e[a]),a++;else{const s=[];let i=!0;for(;a<r&&e[a].role==="model";)s.push(e[a]),i&&!TL(e[a])&&(i=!1),a++;i?t.push(...s):t.pop()}return t}class A0e{constructor(t,r){this.modelsModule=t,this.apiClient=r}create(t){return new f0e(this.apiClient,this.modelsModule,t.model,t.config,structuredClone(t.history))}}class f0e{constructor(t,r,a,s={},i=[]){this.apiClient=t,this.modelsModule=r,this.model=a,this.config=s,this.history=i,this.sendPromise=Promise.resolve(),u0e(i)}async sendMessage(t){var r;await this.sendPromise;const a=Ja(t.message),s=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(a),config:(r=t.config)!==null&&r!==void 0?r:this.config});return this.sendPromise=(async()=>{var i,l,o;const d=await s,u=(l=(i=d.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content,f=d.automaticFunctionCallingHistory,p=this.getHistory(!0).length;let x=[];f!=null&&(x=(o=f.slice(p))!==null&&o!==void 0?o:[]);const m=u?[u]:[];this.recordHistory(a,m,x)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}async sendMessageStream(t){var r;await this.sendPromise;const a=Ja(t.message),s=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(a),config:(r=t.config)!==null&&r!==void 0?r:this.config});this.sendPromise=s.then(()=>{}).catch(()=>{});const i=await s;return this.processStreamResponse(i,a)}getHistory(t=!1){const r=t?Q3(this.history):this.history;return structuredClone(r)}processStreamResponse(t,r){return Li(this,arguments,function*(){var s,i,l,o,d,u;const f=[];try{for(var p=!0,x=Qi(t),m;m=yield wt(x.next()),s=m.done,!s;p=!0){o=m.value,p=!1;const b=o;if(d0e(b)){const v=(u=(d=b.candidates)===null||d===void 0?void 0:d[0])===null||u===void 0?void 0:u.content;v!==void 0&&f.push(v)}yield yield wt(b)}}catch(b){i={error:b}}finally{try{!p&&!s&&(l=x.return)&&(yield wt(l.call(x)))}finally{if(i)throw i.error}}this.recordHistory(r,f)})}recordHistory(t,r,a){let s=[];r.length>0&&r.every(i=>i.role!==void 0)?s=r:s.push({role:"model",parts:[]}),a&&a.length>0?this.history.push(...Q3(a)):this.history.push(t),this.history.push(...s)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class up extends Error{constructor(t){super(t.message),this.name="ApiError",this.status=t.status,Object.setPrototypeOf(this,up.prototype)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function p0e(e){const t={},r=w(e,["file"]);return r!=null&&N(t,["file"],r),t}function h0e(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function x0e(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","file"],CL(r)),t}function m0e(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function g0e(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","file"],CL(r)),t}function b0e(e){const t={},r=w(e,["uris"]);return r!=null&&N(t,["uris"],r),t}function v0e(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function y0e(e){const t={},r=w(e,["config"]);return r!=null&&v0e(r,t),t}function w0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["files"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["files"],i)}return t}function N0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["files"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),N(t,["files"],s)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class C0e extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.PAGED_ITEM_FILES,a=>this.listInternal(a),await this.listInternal(r),r)}async upload(t){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(t.file,t.config).then(r=>r)}async download(t){await this.apiClient.downloadFile(t)}async registerFiles(t){throw new Error("registerFiles is only supported in Node.js environments.")}async _registerFiles(t){return this.registerFilesInternal(t)}async listInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=y0e(t);return i=Ze("files",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=w0e(d),f=new Cue;return Object.assign(f,u),f})}}async createInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=p0e(t);return i=Ze("upload/v1beta/files",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=h0e(d),f=new kue;return Object.assign(f,u),f})}}async get(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=g0e(t);return i=Ze("files/{file}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async delete(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=x0e(t);return i=Ze("files/{file}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=m0e(d),f=new jue;return Object.assign(f,u),f})}}async registerFilesInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=b0e(t);return i=Ze("files:register",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=N0e(d),f=new Eue;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Fm(e){const t={},r=w(e,["data"]);if(r!=null&&N(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function k0e(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>Q0e(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function j0e(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function E0e(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function S0e(e){const t={},r=w(e,["description"]);r!=null&&N(t,["description"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["parameters"]);s!=null&&N(t,["parameters"],s);const i=w(e,["parametersJsonSchema"]);i!=null&&N(t,["parametersJsonSchema"],i);const l=w(e,["response"]);l!=null&&N(t,["response"],l);const o=w(e,["responseJsonSchema"]);if(o!=null&&N(t,["responseJsonSchema"],o),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function B0e(e){const t={},r=w(e,["modelSelectionConfig"]);r!=null&&N(t,["modelConfig"],r);const a=w(e,["responseJsonSchema"]);a!=null&&N(t,["responseJsonSchema"],a);const s=w(e,["audioTimestamp"]);s!=null&&N(t,["audioTimestamp"],s);const i=w(e,["candidateCount"]);i!=null&&N(t,["candidateCount"],i);const l=w(e,["enableAffectiveDialog"]);l!=null&&N(t,["enableAffectiveDialog"],l);const o=w(e,["frequencyPenalty"]);o!=null&&N(t,["frequencyPenalty"],o);const d=w(e,["logprobs"]);d!=null&&N(t,["logprobs"],d);const u=w(e,["maxOutputTokens"]);u!=null&&N(t,["maxOutputTokens"],u);const f=w(e,["mediaResolution"]);f!=null&&N(t,["mediaResolution"],f);const p=w(e,["presencePenalty"]);p!=null&&N(t,["presencePenalty"],p);const x=w(e,["responseLogprobs"]);x!=null&&N(t,["responseLogprobs"],x);const m=w(e,["responseMimeType"]);m!=null&&N(t,["responseMimeType"],m);const b=w(e,["responseModalities"]);b!=null&&N(t,["responseModalities"],b);const v=w(e,["responseSchema"]);v!=null&&N(t,["responseSchema"],v);const y=w(e,["routingConfig"]);y!=null&&N(t,["routingConfig"],y);const k=w(e,["seed"]);k!=null&&N(t,["seed"],k);const _=w(e,["speechConfig"]);_!=null&&N(t,["speechConfig"],_);const C=w(e,["stopSequences"]);C!=null&&N(t,["stopSequences"],C);const E=w(e,["temperature"]);E!=null&&N(t,["temperature"],E);const T=w(e,["thinkingConfig"]);T!=null&&N(t,["thinkingConfig"],T);const B=w(e,["topK"]);B!=null&&N(t,["topK"],B);const I=w(e,["topP"]);if(I!=null&&N(t,["topP"],I),w(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function _0e(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&N(t,["enableWidget"],r),t}function T0e(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&N(t,["timeRangeFilter"],r),t}function F0e(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&N(t,["setup","generationConfig"],a);const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&N(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&N(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&N(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&N(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&N(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&N(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&N(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&N(t,["setup","generationConfig","speechConfig"],qj(p));const x=w(e,["thinkingConfig"]);t!==void 0&&x!=null&&N(t,["setup","generationConfig","thinkingConfig"],x);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&N(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&N(t,["setup","systemInstruction"],k0e(Ja(b)));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let B=JA(v);Array.isArray(B)&&(B=B.map(I=>z0e(XA(I)))),N(t,["setup","tools"],B)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&N(t,["setup","sessionResumption"],H0e(y));const k=w(e,["inputAudioTranscription"]);t!==void 0&&k!=null&&N(t,["setup","inputAudioTranscription"],k);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&N(t,["setup","outputAudioTranscription"],_);const C=w(e,["realtimeInputConfig"]);t!==void 0&&C!=null&&N(t,["setup","realtimeInputConfig"],C);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&N(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);if(t!==void 0&&T!=null&&N(t,["setup","proactivity"],T),w(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return r}function I0e(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&N(t,["setup","generationConfig"],B0e(a));const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&N(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&N(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&N(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&N(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&N(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&N(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&N(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&N(t,["setup","generationConfig","speechConfig"],qj(p));const x=w(e,["thinkingConfig"]);t!==void 0&&x!=null&&N(t,["setup","generationConfig","thinkingConfig"],x);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&N(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&N(t,["setup","systemInstruction"],Ja(b));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let I=JA(v);Array.isArray(I)&&(I=I.map(M=>$0e(XA(M)))),N(t,["setup","tools"],I)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&N(t,["setup","sessionResumption"],y);const k=w(e,["inputAudioTranscription"]);t!==void 0&&k!=null&&N(t,["setup","inputAudioTranscription"],k);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&N(t,["setup","outputAudioTranscription"],_);const C=w(e,["realtimeInputConfig"]);t!==void 0&&C!=null&&N(t,["setup","realtimeInputConfig"],C);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&N(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);t!==void 0&&T!=null&&N(t,["setup","proactivity"],T);const B=w(e,["explicitVadSignal"]);return t!==void 0&&B!=null&&N(t,["setup","explicitVadSignal"],B),r}function D0e(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["setup","model"],Zt(e,a));const s=w(t,["config"]);return s!=null&&N(r,["config"],F0e(s,r)),r}function U0e(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["setup","model"],Zt(e,a));const s=w(t,["config"]);return s!=null&&N(r,["config"],I0e(s,r)),r}function M0e(e){const t={},r=w(e,["musicGenerationConfig"]);return r!=null&&N(t,["musicGenerationConfig"],r),t}function R0e(e){const t={},r=w(e,["weightedPrompts"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(s=>s)),N(t,["weightedPrompts"],a)}return t}function O0e(e){const t={},r=w(e,["media"]);if(r!=null){let u=bL(r);Array.isArray(u)&&(u=u.map(f=>Fm(f))),N(t,["mediaChunks"],u)}const a=w(e,["audio"]);a!=null&&N(t,["audio"],Fm(yL(a)));const s=w(e,["audioStreamEnd"]);s!=null&&N(t,["audioStreamEnd"],s);const i=w(e,["video"]);i!=null&&N(t,["video"],Fm(vL(i)));const l=w(e,["text"]);l!=null&&N(t,["text"],l);const o=w(e,["activityStart"]);o!=null&&N(t,["activityStart"],o);const d=w(e,["activityEnd"]);return d!=null&&N(t,["activityEnd"],d),t}function P0e(e){const t={},r=w(e,["media"]);if(r!=null){let u=bL(r);Array.isArray(u)&&(u=u.map(f=>f)),N(t,["mediaChunks"],u)}const a=w(e,["audio"]);a!=null&&N(t,["audio"],yL(a));const s=w(e,["audioStreamEnd"]);s!=null&&N(t,["audioStreamEnd"],s);const i=w(e,["video"]);i!=null&&N(t,["video"],vL(i));const l=w(e,["text"]);l!=null&&N(t,["text"],l);const o=w(e,["activityStart"]);o!=null&&N(t,["activityStart"],o);const d=w(e,["activityEnd"]);return d!=null&&N(t,["activityEnd"],d),t}function L0e(e){const t={},r=w(e,["setupComplete"]);r!=null&&N(t,["setupComplete"],r);const a=w(e,["serverContent"]);a!=null&&N(t,["serverContent"],a);const s=w(e,["toolCall"]);s!=null&&N(t,["toolCall"],s);const i=w(e,["toolCallCancellation"]);i!=null&&N(t,["toolCallCancellation"],i);const l=w(e,["usageMetadata"]);l!=null&&N(t,["usageMetadata"],V0e(l));const o=w(e,["goAway"]);o!=null&&N(t,["goAway"],o);const d=w(e,["sessionResumptionUpdate"]);d!=null&&N(t,["sessionResumptionUpdate"],d);const u=w(e,["voiceActivityDetectionSignal"]);u!=null&&N(t,["voiceActivityDetectionSignal"],u);const f=w(e,["voiceActivity"]);return f!=null&&N(t,["voiceActivity"],G0e(f)),t}function Q0e(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],j0e(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],E0e(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],Fm(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function H0e(e){const t={},r=w(e,["handle"]);if(r!=null&&N(t,["handle"],r),w(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function z0e(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],_0e(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],T0e(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}function $0e(e){const t={},r=w(e,["retrieval"]);r!=null&&N(t,["retrieval"],r);const a=w(e,["computerUse"]);if(a!=null&&N(t,["computerUse"],a),w(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const s=w(e,["codeExecution"]);s!=null&&N(t,["codeExecution"],s);const i=w(e,["enterpriseWebSearch"]);i!=null&&N(t,["enterpriseWebSearch"],i);const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(x=>S0e(x))),N(t,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&N(t,["googleMaps"],o);const d=w(e,["googleSearch"]);d!=null&&N(t,["googleSearch"],d);const u=w(e,["googleSearchRetrieval"]);u!=null&&N(t,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&N(t,["urlContext"],f),t}function V0e(e){const t={},r=w(e,["promptTokenCount"]);r!=null&&N(t,["promptTokenCount"],r);const a=w(e,["cachedContentTokenCount"]);a!=null&&N(t,["cachedContentTokenCount"],a);const s=w(e,["candidatesTokenCount"]);s!=null&&N(t,["responseTokenCount"],s);const i=w(e,["toolUsePromptTokenCount"]);i!=null&&N(t,["toolUsePromptTokenCount"],i);const l=w(e,["thoughtsTokenCount"]);l!=null&&N(t,["thoughtsTokenCount"],l);const o=w(e,["totalTokenCount"]);o!=null&&N(t,["totalTokenCount"],o);const d=w(e,["promptTokensDetails"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["promptTokensDetails"],m)}const u=w(e,["cacheTokensDetails"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["cacheTokensDetails"],m)}const f=w(e,["candidatesTokensDetails"]);if(f!=null){let m=f;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["responseTokensDetails"],m)}const p=w(e,["toolUsePromptTokensDetails"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["toolUsePromptTokensDetails"],m)}const x=w(e,["trafficType"]);return x!=null&&N(t,["trafficType"],x),t}function G0e(e){const t={},r=w(e,["type"]);return r!=null&&N(t,["voiceActivityType"],r),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function K0e(e,t){const r={},a=w(e,["data"]);if(a!=null&&N(r,["data"],a),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=w(e,["mimeType"]);return s!=null&&N(r,["mimeType"],s),r}function q0e(e,t){const r={},a=w(e,["content"]);a!=null&&N(r,["content"],a);const s=w(e,["citationMetadata"]);s!=null&&N(r,["citationMetadata"],W0e(s));const i=w(e,["tokenCount"]);i!=null&&N(r,["tokenCount"],i);const l=w(e,["finishReason"]);l!=null&&N(r,["finishReason"],l);const o=w(e,["avgLogprobs"]);o!=null&&N(r,["avgLogprobs"],o);const d=w(e,["groundingMetadata"]);d!=null&&N(r,["groundingMetadata"],d);const u=w(e,["index"]);u!=null&&N(r,["index"],u);const f=w(e,["logprobsResult"]);f!=null&&N(r,["logprobsResult"],f);const p=w(e,["safetyRatings"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(b=>b)),N(r,["safetyRatings"],m)}const x=w(e,["urlContextMetadata"]);return x!=null&&N(r,["urlContextMetadata"],x),r}function W0e(e,t){const r={},a=w(e,["citationSources"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),N(r,["citations"],s)}return r}function Y0e(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["contents"]);if(i!=null){let l=Ms(i);Array.isArray(l)&&(l=l.map(o=>o)),N(a,["contents"],l)}return a}function X0e(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["tokensInfo"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(r,["tokensInfo"],i)}return r}function J0e(e,t){const r={},a=w(e,["values"]);a!=null&&N(r,["values"],a);const s=w(e,["statistics"]);return s!=null&&N(r,["statistics"],Z0e(s)),r}function Z0e(e,t){const r={},a=w(e,["truncated"]);a!=null&&N(r,["truncated"],a);const s=w(e,["token_count"]);return s!=null&&N(r,["tokenCount"],s),r}function Wp(e,t){const r={},a=w(e,["parts"]);if(a!=null){let i=a;Array.isArray(i)&&(i=i.map(l=>ope(l))),N(r,["parts"],i)}const s=w(e,["role"]);return s!=null&&N(r,["role"],s),r}function efe(e,t){const r={},a=w(e,["controlType"]);a!=null&&N(r,["controlType"],a);const s=w(e,["enableControlImageComputation"]);return s!=null&&N(r,["computeControl"],s),r}function tfe(e,t){const r={};if(w(e,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(w(e,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(w(e,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return r}function rfe(e,t,r){const a={},s=w(e,["systemInstruction"]);t!==void 0&&s!=null&&N(t,["systemInstruction"],Ja(s));const i=w(e,["tools"]);if(t!==void 0&&i!=null){let o=i;Array.isArray(o)&&(o=o.map(d=>UL(d))),N(t,["tools"],o)}const l=w(e,["generationConfig"]);return t!==void 0&&l!=null&&N(t,["generationConfig"],Kfe(l)),a}function afe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ms(i);Array.isArray(o)&&(o=o.map(d=>Wp(d))),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&tfe(l),a}function nfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ms(i);Array.isArray(o)&&(o=o.map(d=>d)),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&rfe(l,a),a}function sfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["totalTokens"]);s!=null&&N(r,["totalTokens"],s);const i=w(e,["cachedContentTokenCount"]);return i!=null&&N(r,["cachedContentTokenCount"],i),r}function ife(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["totalTokens"]);return s!=null&&N(r,["totalTokens"],s),r}function lfe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],Zt(e,s)),a}function ofe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],Zt(e,s)),a}function cfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function dfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function ufe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&N(t,["parameters","storageUri"],s);const i=w(e,["negativePrompt"]);t!==void 0&&i!=null&&N(t,["parameters","negativePrompt"],i);const l=w(e,["numberOfImages"]);t!==void 0&&l!=null&&N(t,["parameters","sampleCount"],l);const o=w(e,["aspectRatio"]);t!==void 0&&o!=null&&N(t,["parameters","aspectRatio"],o);const d=w(e,["guidanceScale"]);t!==void 0&&d!=null&&N(t,["parameters","guidanceScale"],d);const u=w(e,["seed"]);t!==void 0&&u!=null&&N(t,["parameters","seed"],u);const f=w(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&N(t,["parameters","safetySetting"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&N(t,["parameters","personGeneration"],p);const x=w(e,["includeSafetyAttributes"]);t!==void 0&&x!=null&&N(t,["parameters","includeSafetyAttributes"],x);const m=w(e,["includeRaiReason"]);t!==void 0&&m!=null&&N(t,["parameters","includeRaiReason"],m);const b=w(e,["language"]);t!==void 0&&b!=null&&N(t,["parameters","language"],b);const v=w(e,["outputMimeType"]);t!==void 0&&v!=null&&N(t,["parameters","outputOptions","mimeType"],v);const y=w(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&N(t,["parameters","outputOptions","compressionQuality"],y);const k=w(e,["addWatermark"]);t!==void 0&&k!=null&&N(t,["parameters","addWatermark"],k);const _=w(e,["labels"]);t!==void 0&&_!=null&&N(t,["labels"],_);const C=w(e,["editMode"]);t!==void 0&&C!=null&&N(t,["parameters","editMode"],C);const E=w(e,["baseSteps"]);return t!==void 0&&E!=null&&N(t,["parameters","editConfig","baseSteps"],E),a}function Afe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["referenceImages"]);if(l!=null){let d=l;Array.isArray(d)&&(d=d.map(u=>ppe(u))),N(a,["instances[0]","referenceImages"],d)}const o=w(t,["config"]);return o!=null&&ufe(o,a),a}function ffe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>ev(l))),N(r,["generatedImages"],i)}return r}function pfe(e,t,r){const a={},s=w(e,["taskType"]);t!==void 0&&s!=null&&N(t,["requests[]","taskType"],s);const i=w(e,["title"]);t!==void 0&&i!=null&&N(t,["requests[]","title"],i);const l=w(e,["outputDimensionality"]);if(t!==void 0&&l!=null&&N(t,["requests[]","outputDimensionality"],l),w(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(w(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return a}function hfe(e,t,r){const a={};let s=w(r,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){const u=w(e,["taskType"]);t!==void 0&&u!=null&&N(t,["instances[]","task_type"],u)}else if(s==="EMBED_CONTENT"){const u=w(e,["taskType"]);t!==void 0&&u!=null&&N(t,["taskType"],u)}let i=w(r,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){const u=w(e,["title"]);t!==void 0&&u!=null&&N(t,["instances[]","title"],u)}else if(i==="EMBED_CONTENT"){const u=w(e,["title"]);t!==void 0&&u!=null&&N(t,["title"],u)}let l=w(r,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="PREDICT"){const u=w(e,["outputDimensionality"]);t!==void 0&&u!=null&&N(t,["parameters","outputDimensionality"],u)}else if(l==="EMBED_CONTENT"){const u=w(e,["outputDimensionality"]);t!==void 0&&u!=null&&N(t,["outputDimensionality"],u)}let o=w(r,["embeddingApiType"]);if(o===void 0&&(o="PREDICT"),o==="PREDICT"){const u=w(e,["mimeType"]);t!==void 0&&u!=null&&N(t,["instances[]","mimeType"],u)}let d=w(r,["embeddingApiType"]);if(d===void 0&&(d="PREDICT"),d==="PREDICT"){const u=w(e,["autoTruncate"]);t!==void 0&&u!=null&&N(t,["parameters","autoTruncate"],u)}else if(d==="EMBED_CONTENT"){const u=w(e,["autoTruncate"]);t!==void 0&&u!=null&&N(t,["autoTruncate"],u)}return a}function xfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["contents"]);if(i!=null){let u=Vj(e,i);Array.isArray(u)&&(u=u.map(f=>f)),N(a,["requests[]","content"],u)}const l=w(t,["content"]);l!=null&&Wp(Ja(l));const o=w(t,["config"]);o!=null&&pfe(o,a);const d=w(t,["model"]);return d!==void 0&&N(a,["requests[]","model"],Zt(e,d)),a}function mfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));let i=w(r,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){const d=w(t,["contents"]);if(d!=null){let u=Vj(e,d);Array.isArray(u)&&(u=u.map(f=>f)),N(a,["instances[]","content"],u)}}let l=w(r,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="EMBED_CONTENT"){const d=w(t,["content"]);d!=null&&N(a,["content"],Ja(d))}const o=w(t,["config"]);return o!=null&&hfe(o,a,r),a}function gfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["embeddings"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>o)),N(r,["embeddings"],l)}const i=w(e,["metadata"]);return i!=null&&N(r,["metadata"],i),r}function bfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions[]","embeddings"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>J0e(o))),N(r,["embeddings"],l)}const i=w(e,["metadata"]);if(i!=null&&N(r,["metadata"],i),t&&w(t,["embeddingApiType"])==="EMBED_CONTENT"){const l=w(e,["embedding"]),o=w(e,["usageMetadata"]),d=w(e,["truncated"]);if(l){const u={};o&&o.promptTokenCount&&(u.tokenCount=o.promptTokenCount),d&&(u.truncated=d),l.statistics=u,N(r,["embeddings"],[l])}}return r}function vfe(e,t){const r={},a=w(e,["endpoint"]);a!=null&&N(r,["name"],a);const s=w(e,["deployedModelId"]);return s!=null&&N(r,["deployedModelId"],s),r}function yfe(e,t){const r={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["fileUri"]);a!=null&&N(r,["fileUri"],a);const s=w(e,["mimeType"]);return s!=null&&N(r,["mimeType"],s),r}function wfe(e,t){const r={},a=w(e,["id"]);a!=null&&N(r,["id"],a);const s=w(e,["args"]);s!=null&&N(r,["args"],s);const i=w(e,["name"]);if(i!=null&&N(r,["name"],i),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return r}function Nfe(e,t){const r={},a=w(e,["allowedFunctionNames"]);a!=null&&N(r,["allowedFunctionNames"],a);const s=w(e,["mode"]);if(s!=null&&N(r,["mode"],s),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return r}function Cfe(e,t){const r={},a=w(e,["description"]);a!=null&&N(r,["description"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["parameters"]);i!=null&&N(r,["parameters"],i);const l=w(e,["parametersJsonSchema"]);l!=null&&N(r,["parametersJsonSchema"],l);const o=w(e,["response"]);o!=null&&N(r,["response"],o);const d=w(e,["responseJsonSchema"]);if(d!=null&&N(r,["responseJsonSchema"],d),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return r}function kfe(e,t,r,a){const s={},i=w(t,["systemInstruction"]);r!==void 0&&i!=null&&N(r,["systemInstruction"],Wp(Ja(i)));const l=w(t,["temperature"]);l!=null&&N(s,["temperature"],l);const o=w(t,["topP"]);o!=null&&N(s,["topP"],o);const d=w(t,["topK"]);d!=null&&N(s,["topK"],d);const u=w(t,["candidateCount"]);u!=null&&N(s,["candidateCount"],u);const f=w(t,["maxOutputTokens"]);f!=null&&N(s,["maxOutputTokens"],f);const p=w(t,["stopSequences"]);p!=null&&N(s,["stopSequences"],p);const x=w(t,["responseLogprobs"]);x!=null&&N(s,["responseLogprobs"],x);const m=w(t,["logprobs"]);m!=null&&N(s,["logprobs"],m);const b=w(t,["presencePenalty"]);b!=null&&N(s,["presencePenalty"],b);const v=w(t,["frequencyPenalty"]);v!=null&&N(s,["frequencyPenalty"],v);const y=w(t,["seed"]);y!=null&&N(s,["seed"],y);const k=w(t,["responseMimeType"]);k!=null&&N(s,["responseMimeType"],k);const _=w(t,["responseSchema"]);_!=null&&N(s,["responseSchema"],Gj(_));const C=w(t,["responseJsonSchema"]);if(C!=null&&N(s,["responseJsonSchema"],C),w(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(w(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const E=w(t,["safetySettings"]);if(r!==void 0&&E!=null){let G=E;Array.isArray(G)&&(G=G.map(K=>hpe(K))),N(r,["safetySettings"],G)}const T=w(t,["tools"]);if(r!==void 0&&T!=null){let G=JA(T);Array.isArray(G)&&(G=G.map(K=>wpe(XA(K)))),N(r,["tools"],G)}const B=w(t,["toolConfig"]);if(r!==void 0&&B!=null&&N(r,["toolConfig"],ype(B)),w(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const I=w(t,["cachedContent"]);r!==void 0&&I!=null&&N(r,["cachedContent"],Uo(e,I));const M=w(t,["responseModalities"]);M!=null&&N(s,["responseModalities"],M);const U=w(t,["mediaResolution"]);U!=null&&N(s,["mediaResolution"],U);const D=w(t,["speechConfig"]);if(D!=null&&N(s,["speechConfig"],Kj(D)),w(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const L=w(t,["thinkingConfig"]);L!=null&&N(s,["thinkingConfig"],L);const R=w(t,["imageConfig"]);R!=null&&N(s,["imageConfig"],Jfe(R));const Q=w(t,["enableEnhancedCivicAnswers"]);if(Q!=null&&N(s,["enableEnhancedCivicAnswers"],Q),w(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return s}function jfe(e,t,r,a){const s={},i=w(t,["systemInstruction"]);r!==void 0&&i!=null&&N(r,["systemInstruction"],Ja(i));const l=w(t,["temperature"]);l!=null&&N(s,["temperature"],l);const o=w(t,["topP"]);o!=null&&N(s,["topP"],o);const d=w(t,["topK"]);d!=null&&N(s,["topK"],d);const u=w(t,["candidateCount"]);u!=null&&N(s,["candidateCount"],u);const f=w(t,["maxOutputTokens"]);f!=null&&N(s,["maxOutputTokens"],f);const p=w(t,["stopSequences"]);p!=null&&N(s,["stopSequences"],p);const x=w(t,["responseLogprobs"]);x!=null&&N(s,["responseLogprobs"],x);const m=w(t,["logprobs"]);m!=null&&N(s,["logprobs"],m);const b=w(t,["presencePenalty"]);b!=null&&N(s,["presencePenalty"],b);const v=w(t,["frequencyPenalty"]);v!=null&&N(s,["frequencyPenalty"],v);const y=w(t,["seed"]);y!=null&&N(s,["seed"],y);const k=w(t,["responseMimeType"]);k!=null&&N(s,["responseMimeType"],k);const _=w(t,["responseSchema"]);_!=null&&N(s,["responseSchema"],Gj(_));const C=w(t,["responseJsonSchema"]);C!=null&&N(s,["responseJsonSchema"],C);const E=w(t,["routingConfig"]);E!=null&&N(s,["routingConfig"],E);const T=w(t,["modelSelectionConfig"]);T!=null&&N(s,["modelConfig"],T);const B=w(t,["safetySettings"]);if(r!==void 0&&B!=null){let Z=B;Array.isArray(Z)&&(Z=Z.map(Y=>Y)),N(r,["safetySettings"],Z)}const I=w(t,["tools"]);if(r!==void 0&&I!=null){let Z=JA(I);Array.isArray(Z)&&(Z=Z.map(Y=>UL(XA(Y)))),N(r,["tools"],Z)}const M=w(t,["toolConfig"]);r!==void 0&&M!=null&&N(r,["toolConfig"],M);const U=w(t,["labels"]);r!==void 0&&U!=null&&N(r,["labels"],U);const D=w(t,["cachedContent"]);r!==void 0&&D!=null&&N(r,["cachedContent"],Uo(e,D));const L=w(t,["responseModalities"]);L!=null&&N(s,["responseModalities"],L);const R=w(t,["mediaResolution"]);R!=null&&N(s,["mediaResolution"],R);const Q=w(t,["speechConfig"]);Q!=null&&N(s,["speechConfig"],Kj(Q));const G=w(t,["audioTimestamp"]);G!=null&&N(s,["audioTimestamp"],G);const K=w(t,["thinkingConfig"]);K!=null&&N(s,["thinkingConfig"],K);const W=w(t,["imageConfig"]);if(W!=null&&N(s,["imageConfig"],Zfe(W)),w(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");const z=w(t,["modelArmorConfig"]);return r!==void 0&&z!=null&&N(r,["modelArmorConfig"],z),s}function H3(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ms(i);Array.isArray(o)&&(o=o.map(d=>Wp(d))),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&N(a,["generationConfig"],kfe(e,l,a)),a}function z3(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ms(i);Array.isArray(o)&&(o=o.map(d=>d)),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&N(a,["generationConfig"],jfe(e,l,a)),a}function $3(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["candidates"]);if(s!=null){let u=s;Array.isArray(u)&&(u=u.map(f=>q0e(f))),N(r,["candidates"],u)}const i=w(e,["modelVersion"]);i!=null&&N(r,["modelVersion"],i);const l=w(e,["promptFeedback"]);l!=null&&N(r,["promptFeedback"],l);const o=w(e,["responseId"]);o!=null&&N(r,["responseId"],o);const d=w(e,["usageMetadata"]);return d!=null&&N(r,["usageMetadata"],d),r}function V3(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["candidates"]);if(s!=null){let f=s;Array.isArray(f)&&(f=f.map(p=>p)),N(r,["candidates"],f)}const i=w(e,["createTime"]);i!=null&&N(r,["createTime"],i);const l=w(e,["modelVersion"]);l!=null&&N(r,["modelVersion"],l);const o=w(e,["promptFeedback"]);o!=null&&N(r,["promptFeedback"],o);const d=w(e,["responseId"]);d!=null&&N(r,["responseId"],d);const u=w(e,["usageMetadata"]);return u!=null&&N(r,["usageMetadata"],u),r}function Efe(e,t,r){const a={};if(w(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(w(e,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const s=w(e,["numberOfImages"]);t!==void 0&&s!=null&&N(t,["parameters","sampleCount"],s);const i=w(e,["aspectRatio"]);t!==void 0&&i!=null&&N(t,["parameters","aspectRatio"],i);const l=w(e,["guidanceScale"]);if(t!==void 0&&l!=null&&N(t,["parameters","guidanceScale"],l),w(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const o=w(e,["safetyFilterLevel"]);t!==void 0&&o!=null&&N(t,["parameters","safetySetting"],o);const d=w(e,["personGeneration"]);t!==void 0&&d!=null&&N(t,["parameters","personGeneration"],d);const u=w(e,["includeSafetyAttributes"]);t!==void 0&&u!=null&&N(t,["parameters","includeSafetyAttributes"],u);const f=w(e,["includeRaiReason"]);t!==void 0&&f!=null&&N(t,["parameters","includeRaiReason"],f);const p=w(e,["language"]);t!==void 0&&p!=null&&N(t,["parameters","language"],p);const x=w(e,["outputMimeType"]);t!==void 0&&x!=null&&N(t,["parameters","outputOptions","mimeType"],x);const m=w(e,["outputCompressionQuality"]);if(t!==void 0&&m!=null&&N(t,["parameters","outputOptions","compressionQuality"],m),w(e,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(w(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const b=w(e,["imageSize"]);if(t!==void 0&&b!=null&&N(t,["parameters","sampleImageSize"],b),w(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return a}function Sfe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&N(t,["parameters","storageUri"],s);const i=w(e,["negativePrompt"]);t!==void 0&&i!=null&&N(t,["parameters","negativePrompt"],i);const l=w(e,["numberOfImages"]);t!==void 0&&l!=null&&N(t,["parameters","sampleCount"],l);const o=w(e,["aspectRatio"]);t!==void 0&&o!=null&&N(t,["parameters","aspectRatio"],o);const d=w(e,["guidanceScale"]);t!==void 0&&d!=null&&N(t,["parameters","guidanceScale"],d);const u=w(e,["seed"]);t!==void 0&&u!=null&&N(t,["parameters","seed"],u);const f=w(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&N(t,["parameters","safetySetting"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&N(t,["parameters","personGeneration"],p);const x=w(e,["includeSafetyAttributes"]);t!==void 0&&x!=null&&N(t,["parameters","includeSafetyAttributes"],x);const m=w(e,["includeRaiReason"]);t!==void 0&&m!=null&&N(t,["parameters","includeRaiReason"],m);const b=w(e,["language"]);t!==void 0&&b!=null&&N(t,["parameters","language"],b);const v=w(e,["outputMimeType"]);t!==void 0&&v!=null&&N(t,["parameters","outputOptions","mimeType"],v);const y=w(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&N(t,["parameters","outputOptions","compressionQuality"],y);const k=w(e,["addWatermark"]);t!==void 0&&k!=null&&N(t,["parameters","addWatermark"],k);const _=w(e,["labels"]);t!==void 0&&_!=null&&N(t,["labels"],_);const C=w(e,["imageSize"]);t!==void 0&&C!=null&&N(t,["parameters","sampleImageSize"],C);const E=w(e,["enhancePrompt"]);return t!==void 0&&E!=null&&N(t,["parameters","enhancePrompt"],E),a}function Bfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["config"]);return l!=null&&Efe(l,a),a}function _fe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["config"]);return l!=null&&Sfe(l,a),a}function Tfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>zfe(o))),N(r,["generatedImages"],l)}const i=w(e,["positivePromptSafetyAttributes"]);return i!=null&&N(r,["positivePromptSafetyAttributes"],IL(i)),r}function Ffe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>ev(o))),N(r,["generatedImages"],l)}const i=w(e,["positivePromptSafetyAttributes"]);return i!=null&&N(r,["positivePromptSafetyAttributes"],DL(i)),r}function Ife(e,t,r){const a={},s=w(e,["numberOfVideos"]);if(t!==void 0&&s!=null&&N(t,["parameters","sampleCount"],s),w(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(w(e,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const i=w(e,["durationSeconds"]);if(t!==void 0&&i!=null&&N(t,["parameters","durationSeconds"],i),w(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const l=w(e,["aspectRatio"]);t!==void 0&&l!=null&&N(t,["parameters","aspectRatio"],l);const o=w(e,["resolution"]);t!==void 0&&o!=null&&N(t,["parameters","resolution"],o);const d=w(e,["personGeneration"]);if(t!==void 0&&d!=null&&N(t,["parameters","personGeneration"],d),w(e,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const u=w(e,["negativePrompt"]);t!==void 0&&u!=null&&N(t,["parameters","negativePrompt"],u);const f=w(e,["enhancePrompt"]);if(t!==void 0&&f!=null&&N(t,["parameters","enhancePrompt"],f),w(e,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const p=w(e,["lastFrame"]);t!==void 0&&p!=null&&N(t,["instances[0]","lastFrame"],tv(p));const x=w(e,["referenceImages"]);if(t!==void 0&&x!=null){let m=x;Array.isArray(m)&&(m=m.map(b=>Upe(b))),N(t,["instances[0]","referenceImages"],m)}if(w(e,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(w(e,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return a}function Dfe(e,t,r){const a={},s=w(e,["numberOfVideos"]);t!==void 0&&s!=null&&N(t,["parameters","sampleCount"],s);const i=w(e,["outputGcsUri"]);t!==void 0&&i!=null&&N(t,["parameters","storageUri"],i);const l=w(e,["fps"]);t!==void 0&&l!=null&&N(t,["parameters","fps"],l);const o=w(e,["durationSeconds"]);t!==void 0&&o!=null&&N(t,["parameters","durationSeconds"],o);const d=w(e,["seed"]);t!==void 0&&d!=null&&N(t,["parameters","seed"],d);const u=w(e,["aspectRatio"]);t!==void 0&&u!=null&&N(t,["parameters","aspectRatio"],u);const f=w(e,["resolution"]);t!==void 0&&f!=null&&N(t,["parameters","resolution"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&N(t,["parameters","personGeneration"],p);const x=w(e,["pubsubTopic"]);t!==void 0&&x!=null&&N(t,["parameters","pubsubTopic"],x);const m=w(e,["negativePrompt"]);t!==void 0&&m!=null&&N(t,["parameters","negativePrompt"],m);const b=w(e,["enhancePrompt"]);t!==void 0&&b!=null&&N(t,["parameters","enhancePrompt"],b);const v=w(e,["generateAudio"]);t!==void 0&&v!=null&&N(t,["parameters","generateAudio"],v);const y=w(e,["lastFrame"]);t!==void 0&&y!=null&&N(t,["instances[0]","lastFrame"],Xi(y));const k=w(e,["referenceImages"]);if(t!==void 0&&k!=null){let E=k;Array.isArray(E)&&(E=E.map(T=>Mpe(T))),N(t,["instances[0]","referenceImages"],E)}const _=w(e,["mask"]);t!==void 0&&_!=null&&N(t,["instances[0]","mask"],Dpe(_));const C=w(e,["compressionQuality"]);return t!==void 0&&C!=null&&N(t,["parameters","compressionQuality"],C),a}function Ufe(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["metadata"]);s!=null&&N(r,["metadata"],s);const i=w(e,["done"]);i!=null&&N(r,["done"],i);const l=w(e,["error"]);l!=null&&N(r,["error"],l);const o=w(e,["response","generateVideoResponse"]);return o!=null&&N(r,["response"],Pfe(o)),r}function Mfe(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["metadata"]);s!=null&&N(r,["metadata"],s);const i=w(e,["done"]);i!=null&&N(r,["done"],i);const l=w(e,["error"]);l!=null&&N(r,["error"],l);const o=w(e,["response"]);return o!=null&&N(r,["response"],Lfe(o)),r}function Rfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["image"]);l!=null&&N(a,["instances[0]","image"],tv(l));const o=w(t,["video"]);o!=null&&N(a,["instances[0]","video"],ML(o));const d=w(t,["source"]);d!=null&&Qfe(d,a);const u=w(t,["config"]);return u!=null&&Ife(u,a),a}function Ofe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["image"]);l!=null&&N(a,["instances[0]","image"],Xi(l));const o=w(t,["video"]);o!=null&&N(a,["instances[0]","video"],RL(o));const d=w(t,["source"]);d!=null&&Hfe(d,a);const u=w(t,["config"]);return u!=null&&Dfe(u,a),a}function Pfe(e,t){const r={},a=w(e,["generatedSamples"]);if(a!=null){let l=a;Array.isArray(l)&&(l=l.map(o=>Vfe(o))),N(r,["generatedVideos"],l)}const s=w(e,["raiMediaFilteredCount"]);s!=null&&N(r,["raiMediaFilteredCount"],s);const i=w(e,["raiMediaFilteredReasons"]);return i!=null&&N(r,["raiMediaFilteredReasons"],i),r}function Lfe(e,t){const r={},a=w(e,["videos"]);if(a!=null){let l=a;Array.isArray(l)&&(l=l.map(o=>Gfe(o))),N(r,["generatedVideos"],l)}const s=w(e,["raiMediaFilteredCount"]);s!=null&&N(r,["raiMediaFilteredCount"],s);const i=w(e,["raiMediaFilteredReasons"]);return i!=null&&N(r,["raiMediaFilteredReasons"],i),r}function Qfe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&N(t,["instances[0]","image"],tv(i));const l=w(e,["video"]);return t!==void 0&&l!=null&&N(t,["instances[0]","video"],ML(l)),a}function Hfe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&N(t,["instances[0]","image"],Xi(i));const l=w(e,["video"]);return t!==void 0&&l!=null&&N(t,["instances[0]","video"],RL(l)),a}function zfe(e,t){const r={},a=w(e,["_self"]);a!=null&&N(r,["image"],epe(a));const s=w(e,["raiFilteredReason"]);s!=null&&N(r,["raiFilteredReason"],s);const i=w(e,["_self"]);return i!=null&&N(r,["safetyAttributes"],IL(i)),r}function ev(e,t){const r={},a=w(e,["_self"]);a!=null&&N(r,["image"],FL(a));const s=w(e,["raiFilteredReason"]);s!=null&&N(r,["raiFilteredReason"],s);const i=w(e,["_self"]);i!=null&&N(r,["safetyAttributes"],DL(i));const l=w(e,["prompt"]);return l!=null&&N(r,["enhancedPrompt"],l),r}function $fe(e,t){const r={},a=w(e,["_self"]);a!=null&&N(r,["mask"],FL(a));const s=w(e,["labels"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(r,["labels"],i)}return r}function Vfe(e,t){const r={},a=w(e,["video"]);return a!=null&&N(r,["video"],Fpe(a)),r}function Gfe(e,t){const r={},a=w(e,["_self"]);return a!=null&&N(r,["video"],Ipe(a)),r}function Kfe(e,t){const r={},a=w(e,["modelSelectionConfig"]);a!=null&&N(r,["modelConfig"],a);const s=w(e,["responseJsonSchema"]);s!=null&&N(r,["responseJsonSchema"],s);const i=w(e,["audioTimestamp"]);i!=null&&N(r,["audioTimestamp"],i);const l=w(e,["candidateCount"]);l!=null&&N(r,["candidateCount"],l);const o=w(e,["enableAffectiveDialog"]);o!=null&&N(r,["enableAffectiveDialog"],o);const d=w(e,["frequencyPenalty"]);d!=null&&N(r,["frequencyPenalty"],d);const u=w(e,["logprobs"]);u!=null&&N(r,["logprobs"],u);const f=w(e,["maxOutputTokens"]);f!=null&&N(r,["maxOutputTokens"],f);const p=w(e,["mediaResolution"]);p!=null&&N(r,["mediaResolution"],p);const x=w(e,["presencePenalty"]);x!=null&&N(r,["presencePenalty"],x);const m=w(e,["responseLogprobs"]);m!=null&&N(r,["responseLogprobs"],m);const b=w(e,["responseMimeType"]);b!=null&&N(r,["responseMimeType"],b);const v=w(e,["responseModalities"]);v!=null&&N(r,["responseModalities"],v);const y=w(e,["responseSchema"]);y!=null&&N(r,["responseSchema"],y);const k=w(e,["routingConfig"]);k!=null&&N(r,["routingConfig"],k);const _=w(e,["seed"]);_!=null&&N(r,["seed"],_);const C=w(e,["speechConfig"]);C!=null&&N(r,["speechConfig"],C);const E=w(e,["stopSequences"]);E!=null&&N(r,["stopSequences"],E);const T=w(e,["temperature"]);T!=null&&N(r,["temperature"],T);const B=w(e,["thinkingConfig"]);B!=null&&N(r,["thinkingConfig"],B);const I=w(e,["topK"]);I!=null&&N(r,["topK"],I);const M=w(e,["topP"]);if(M!=null&&N(r,["topP"],M),w(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return r}function qfe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],Zt(e,s)),a}function Wfe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],Zt(e,s)),a}function Yfe(e,t){const r={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const a=w(e,["enableWidget"]);return a!=null&&N(r,["enableWidget"],a),r}function Xfe(e,t){const r={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const a=w(e,["timeRangeFilter"]);return a!=null&&N(r,["timeRangeFilter"],a),r}function Jfe(e,t){const r={},a=w(e,["aspectRatio"]);a!=null&&N(r,["aspectRatio"],a);const s=w(e,["imageSize"]);if(s!=null&&N(r,["imageSize"],s),w(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(w(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(w(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return r}function Zfe(e,t){const r={},a=w(e,["aspectRatio"]);a!=null&&N(r,["aspectRatio"],a);const s=w(e,["imageSize"]);s!=null&&N(r,["imageSize"],s);const i=w(e,["personGeneration"]);i!=null&&N(r,["personGeneration"],i);const l=w(e,["outputMimeType"]);l!=null&&N(r,["imageOutputOptions","mimeType"],l);const o=w(e,["outputCompressionQuality"]);return o!=null&&N(r,["imageOutputOptions","compressionQuality"],o),r}function epe(e,t){const r={},a=w(e,["bytesBase64Encoded"]);a!=null&&N(r,["imageBytes"],$c(a));const s=w(e,["mimeType"]);return s!=null&&N(r,["mimeType"],s),r}function FL(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["gcsUri"],a);const s=w(e,["bytesBase64Encoded"]);s!=null&&N(r,["imageBytes"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}function tv(e,t){const r={};if(w(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const a=w(e,["imageBytes"]);a!=null&&N(r,["bytesBase64Encoded"],$c(a));const s=w(e,["mimeType"]);return s!=null&&N(r,["mimeType"],s),r}function Xi(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["gcsUri"],a);const s=w(e,["imageBytes"]);s!=null&&N(r,["bytesBase64Encoded"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}function tpe(e,t,r,a){const s={},i=w(t,["pageSize"]);r!==void 0&&i!=null&&N(r,["_query","pageSize"],i);const l=w(t,["pageToken"]);r!==void 0&&l!=null&&N(r,["_query","pageToken"],l);const o=w(t,["filter"]);r!==void 0&&o!=null&&N(r,["_query","filter"],o);const d=w(t,["queryBase"]);return r!==void 0&&d!=null&&N(r,["_url","models_url"],kL(e,d)),s}function rpe(e,t,r,a){const s={},i=w(t,["pageSize"]);r!==void 0&&i!=null&&N(r,["_query","pageSize"],i);const l=w(t,["pageToken"]);r!==void 0&&l!=null&&N(r,["_query","pageToken"],l);const o=w(t,["filter"]);r!==void 0&&o!=null&&N(r,["_query","filter"],o);const d=w(t,["queryBase"]);return r!==void 0&&d!=null&&N(r,["_url","models_url"],kL(e,d)),s}function ape(e,t,r){const a={},s=w(t,["config"]);return s!=null&&tpe(e,s,a),a}function npe(e,t,r){const a={},s=w(t,["config"]);return s!=null&&rpe(e,s,a),a}function spe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["_self"]);if(i!=null){let l=jL(i);Array.isArray(l)&&(l=l.map(o=>cC(o))),N(r,["models"],l)}return r}function ipe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["_self"]);if(i!=null){let l=jL(i);Array.isArray(l)&&(l=l.map(o=>dC(o))),N(r,["models"],l)}return r}function lpe(e,t){const r={},a=w(e,["maskMode"]);a!=null&&N(r,["maskMode"],a);const s=w(e,["segmentationClasses"]);s!=null&&N(r,["maskClasses"],s);const i=w(e,["maskDilation"]);return i!=null&&N(r,["dilation"],i),r}function cC(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["displayName"]);s!=null&&N(r,["displayName"],s);const i=w(e,["description"]);i!=null&&N(r,["description"],i);const l=w(e,["version"]);l!=null&&N(r,["version"],l);const o=w(e,["_self"]);o!=null&&N(r,["tunedModelInfo"],Npe(o));const d=w(e,["inputTokenLimit"]);d!=null&&N(r,["inputTokenLimit"],d);const u=w(e,["outputTokenLimit"]);u!=null&&N(r,["outputTokenLimit"],u);const f=w(e,["supportedGenerationMethods"]);f!=null&&N(r,["supportedActions"],f);const p=w(e,["temperature"]);p!=null&&N(r,["temperature"],p);const x=w(e,["maxTemperature"]);x!=null&&N(r,["maxTemperature"],x);const m=w(e,["topP"]);m!=null&&N(r,["topP"],m);const b=w(e,["topK"]);b!=null&&N(r,["topK"],b);const v=w(e,["thinking"]);return v!=null&&N(r,["thinking"],v),r}function dC(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["displayName"]);s!=null&&N(r,["displayName"],s);const i=w(e,["description"]);i!=null&&N(r,["description"],i);const l=w(e,["versionId"]);l!=null&&N(r,["version"],l);const o=w(e,["deployedModels"]);if(o!=null){let x=o;Array.isArray(x)&&(x=x.map(m=>vfe(m))),N(r,["endpoints"],x)}const d=w(e,["labels"]);d!=null&&N(r,["labels"],d);const u=w(e,["_self"]);u!=null&&N(r,["tunedModelInfo"],Cpe(u));const f=w(e,["defaultCheckpointId"]);f!=null&&N(r,["defaultCheckpointId"],f);const p=w(e,["checkpoints"]);if(p!=null){let x=p;Array.isArray(x)&&(x=x.map(m=>m)),N(r,["checkpoints"],x)}return r}function ope(e,t){const r={},a=w(e,["mediaResolution"]);a!=null&&N(r,["mediaResolution"],a);const s=w(e,["codeExecutionResult"]);s!=null&&N(r,["codeExecutionResult"],s);const i=w(e,["executableCode"]);i!=null&&N(r,["executableCode"],i);const l=w(e,["fileData"]);l!=null&&N(r,["fileData"],yfe(l));const o=w(e,["functionCall"]);o!=null&&N(r,["functionCall"],wfe(o));const d=w(e,["functionResponse"]);d!=null&&N(r,["functionResponse"],d);const u=w(e,["inlineData"]);u!=null&&N(r,["inlineData"],K0e(u));const f=w(e,["text"]);f!=null&&N(r,["text"],f);const p=w(e,["thought"]);p!=null&&N(r,["thought"],p);const x=w(e,["thoughtSignature"]);x!=null&&N(r,["thoughtSignature"],x);const m=w(e,["videoMetadata"]);return m!=null&&N(r,["videoMetadata"],m),r}function cpe(e,t){const r={},a=w(e,["productImage"]);return a!=null&&N(r,["image"],Xi(a)),r}function dpe(e,t,r){const a={},s=w(e,["numberOfImages"]);t!==void 0&&s!=null&&N(t,["parameters","sampleCount"],s);const i=w(e,["baseSteps"]);t!==void 0&&i!=null&&N(t,["parameters","baseSteps"],i);const l=w(e,["outputGcsUri"]);t!==void 0&&l!=null&&N(t,["parameters","storageUri"],l);const o=w(e,["seed"]);t!==void 0&&o!=null&&N(t,["parameters","seed"],o);const d=w(e,["safetyFilterLevel"]);t!==void 0&&d!=null&&N(t,["parameters","safetySetting"],d);const u=w(e,["personGeneration"]);t!==void 0&&u!=null&&N(t,["parameters","personGeneration"],u);const f=w(e,["addWatermark"]);t!==void 0&&f!=null&&N(t,["parameters","addWatermark"],f);const p=w(e,["outputMimeType"]);t!==void 0&&p!=null&&N(t,["parameters","outputOptions","mimeType"],p);const x=w(e,["outputCompressionQuality"]);t!==void 0&&x!=null&&N(t,["parameters","outputOptions","compressionQuality"],x);const m=w(e,["enhancePrompt"]);t!==void 0&&m!=null&&N(t,["parameters","enhancePrompt"],m);const b=w(e,["labels"]);return t!==void 0&&b!=null&&N(t,["labels"],b),a}function upe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["source"]);i!=null&&fpe(i,a);const l=w(t,["config"]);return l!=null&&dpe(l,a),a}function Ape(e,t){const r={},a=w(e,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>ev(i))),N(r,["generatedImages"],s)}return r}function fpe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["personImage"]);t!==void 0&&i!=null&&N(t,["instances[0]","personImage","image"],Xi(i));const l=w(e,["productImages"]);if(t!==void 0&&l!=null){let o=l;Array.isArray(o)&&(o=o.map(d=>cpe(d))),N(t,["instances[0]","productImages"],o)}return a}function ppe(e,t){const r={},a=w(e,["referenceImage"]);a!=null&&N(r,["referenceImage"],Xi(a));const s=w(e,["referenceId"]);s!=null&&N(r,["referenceId"],s);const i=w(e,["referenceType"]);i!=null&&N(r,["referenceType"],i);const l=w(e,["maskImageConfig"]);l!=null&&N(r,["maskImageConfig"],lpe(l));const o=w(e,["controlImageConfig"]);o!=null&&N(r,["controlImageConfig"],efe(o));const d=w(e,["styleImageConfig"]);d!=null&&N(r,["styleImageConfig"],d);const u=w(e,["subjectImageConfig"]);return u!=null&&N(r,["subjectImageConfig"],u),r}function IL(e,t){const r={},a=w(e,["safetyAttributes","categories"]);a!=null&&N(r,["categories"],a);const s=w(e,["safetyAttributes","scores"]);s!=null&&N(r,["scores"],s);const i=w(e,["contentType"]);return i!=null&&N(r,["contentType"],i),r}function DL(e,t){const r={},a=w(e,["safetyAttributes","categories"]);a!=null&&N(r,["categories"],a);const s=w(e,["safetyAttributes","scores"]);s!=null&&N(r,["scores"],s);const i=w(e,["contentType"]);return i!=null&&N(r,["contentType"],i),r}function hpe(e,t){const r={},a=w(e,["category"]);if(a!=null&&N(r,["category"],a),w(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const s=w(e,["threshold"]);return s!=null&&N(r,["threshold"],s),r}function xpe(e,t){const r={},a=w(e,["image"]);return a!=null&&N(r,["image"],Xi(a)),r}function mpe(e,t,r){const a={},s=w(e,["mode"]);t!==void 0&&s!=null&&N(t,["parameters","mode"],s);const i=w(e,["maxPredictions"]);t!==void 0&&i!=null&&N(t,["parameters","maxPredictions"],i);const l=w(e,["confidenceThreshold"]);t!==void 0&&l!=null&&N(t,["parameters","confidenceThreshold"],l);const o=w(e,["maskDilation"]);t!==void 0&&o!=null&&N(t,["parameters","maskDilation"],o);const d=w(e,["binaryColorThreshold"]);t!==void 0&&d!=null&&N(t,["parameters","binaryColorThreshold"],d);const u=w(e,["labels"]);return t!==void 0&&u!=null&&N(t,["labels"],u),a}function gpe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["source"]);i!=null&&vpe(i,a);const l=w(t,["config"]);return l!=null&&mpe(l,a),a}function bpe(e,t){const r={},a=w(e,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>$fe(i))),N(r,["generatedMasks"],s)}return r}function vpe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&N(t,["instances[0]","image"],Xi(i));const l=w(e,["scribbleImage"]);return t!==void 0&&l!=null&&N(t,["instances[0]","scribble"],xpe(l)),a}function ype(e,t){const r={},a=w(e,["retrievalConfig"]);a!=null&&N(r,["retrievalConfig"],a);const s=w(e,["functionCallingConfig"]);return s!=null&&N(r,["functionCallingConfig"],Nfe(s)),r}function wpe(e,t){const r={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const a=w(e,["computerUse"]);a!=null&&N(r,["computerUse"],a);const s=w(e,["fileSearch"]);s!=null&&N(r,["fileSearch"],s);const i=w(e,["codeExecution"]);if(i!=null&&N(r,["codeExecution"],i),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(x=>x)),N(r,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&N(r,["googleMaps"],Yfe(o));const d=w(e,["googleSearch"]);d!=null&&N(r,["googleSearch"],Xfe(d));const u=w(e,["googleSearchRetrieval"]);u!=null&&N(r,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&N(r,["urlContext"],f),r}function UL(e,t){const r={},a=w(e,["retrieval"]);a!=null&&N(r,["retrieval"],a);const s=w(e,["computerUse"]);if(s!=null&&N(r,["computerUse"],s),w(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const i=w(e,["codeExecution"]);i!=null&&N(r,["codeExecution"],i);const l=w(e,["enterpriseWebSearch"]);l!=null&&N(r,["enterpriseWebSearch"],l);const o=w(e,["functionDeclarations"]);if(o!=null){let x=o;Array.isArray(x)&&(x=x.map(m=>Cfe(m))),N(r,["functionDeclarations"],x)}const d=w(e,["googleMaps"]);d!=null&&N(r,["googleMaps"],d);const u=w(e,["googleSearch"]);u!=null&&N(r,["googleSearch"],u);const f=w(e,["googleSearchRetrieval"]);f!=null&&N(r,["googleSearchRetrieval"],f);const p=w(e,["urlContext"]);return p!=null&&N(r,["urlContext"],p),r}function Npe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["createTime"]);s!=null&&N(r,["createTime"],s);const i=w(e,["updateTime"]);return i!=null&&N(r,["updateTime"],i),r}function Cpe(e,t){const r={},a=w(e,["labels","google-vertex-llm-tuning-base-model-id"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["createTime"]);s!=null&&N(r,["createTime"],s);const i=w(e,["updateTime"]);return i!=null&&N(r,["updateTime"],i),r}function kpe(e,t,r){const a={},s=w(e,["displayName"]);t!==void 0&&s!=null&&N(t,["displayName"],s);const i=w(e,["description"]);t!==void 0&&i!=null&&N(t,["description"],i);const l=w(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&N(t,["defaultCheckpointId"],l),a}function jpe(e,t,r){const a={},s=w(e,["displayName"]);t!==void 0&&s!=null&&N(t,["displayName"],s);const i=w(e,["description"]);t!==void 0&&i!=null&&N(t,["description"],i);const l=w(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&N(t,["defaultCheckpointId"],l),a}function Epe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","name"],Zt(e,s));const i=w(t,["config"]);return i!=null&&kpe(i,a),a}function Spe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["config"]);return i!=null&&jpe(i,a),a}function Bpe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&N(t,["parameters","storageUri"],s);const i=w(e,["safetyFilterLevel"]);t!==void 0&&i!=null&&N(t,["parameters","safetySetting"],i);const l=w(e,["personGeneration"]);t!==void 0&&l!=null&&N(t,["parameters","personGeneration"],l);const o=w(e,["includeRaiReason"]);t!==void 0&&o!=null&&N(t,["parameters","includeRaiReason"],o);const d=w(e,["outputMimeType"]);t!==void 0&&d!=null&&N(t,["parameters","outputOptions","mimeType"],d);const u=w(e,["outputCompressionQuality"]);t!==void 0&&u!=null&&N(t,["parameters","outputOptions","compressionQuality"],u);const f=w(e,["enhanceInputImage"]);t!==void 0&&f!=null&&N(t,["parameters","upscaleConfig","enhanceInputImage"],f);const p=w(e,["imagePreservationFactor"]);t!==void 0&&p!=null&&N(t,["parameters","upscaleConfig","imagePreservationFactor"],p);const x=w(e,["labels"]);t!==void 0&&x!=null&&N(t,["labels"],x);const m=w(e,["numberOfImages"]);t!==void 0&&m!=null&&N(t,["parameters","sampleCount"],m);const b=w(e,["mode"]);return t!==void 0&&b!=null&&N(t,["parameters","mode"],b),a}function _pe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],Zt(e,s));const i=w(t,["image"]);i!=null&&N(a,["instances[0]","image"],Xi(i));const l=w(t,["upscaleFactor"]);l!=null&&N(a,["parameters","upscaleConfig","upscaleFactor"],l);const o=w(t,["config"]);return o!=null&&Bpe(o,a),a}function Tpe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>ev(l))),N(r,["generatedImages"],i)}return r}function Fpe(e,t){const r={},a=w(e,["uri"]);a!=null&&N(r,["uri"],a);const s=w(e,["encodedVideo"]);s!=null&&N(r,["videoBytes"],$c(s));const i=w(e,["encoding"]);return i!=null&&N(r,["mimeType"],i),r}function Ipe(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["uri"],a);const s=w(e,["bytesBase64Encoded"]);s!=null&&N(r,["videoBytes"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}function Dpe(e,t){const r={},a=w(e,["image"]);a!=null&&N(r,["_self"],Xi(a));const s=w(e,["maskMode"]);return s!=null&&N(r,["maskMode"],s),r}function Upe(e,t){const r={},a=w(e,["image"]);a!=null&&N(r,["image"],tv(a));const s=w(e,["referenceType"]);return s!=null&&N(r,["referenceType"],s),r}function Mpe(e,t){const r={},a=w(e,["image"]);a!=null&&N(r,["image"],Xi(a));const s=w(e,["referenceType"]);return s!=null&&N(r,["referenceType"],s),r}function ML(e,t){const r={},a=w(e,["uri"]);a!=null&&N(r,["uri"],a);const s=w(e,["videoBytes"]);s!=null&&N(r,["encodedVideo"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["encoding"],i),r}function RL(e,t){const r={},a=w(e,["uri"]);a!=null&&N(r,["gcsUri"],a);const s=w(e,["videoBytes"]);s!=null&&N(r,["bytesBase64Encoded"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Rpe(e,t){const r={},a=w(e,["displayName"]);return t!==void 0&&a!=null&&N(t,["displayName"],a),r}function Ope(e){const t={},r=w(e,["config"]);return r!=null&&Rpe(r,t),t}function Ppe(e,t){const r={},a=w(e,["force"]);return t!==void 0&&a!=null&&N(t,["_query","force"],a),r}function Lpe(e){const t={},r=w(e,["name"]);r!=null&&N(t,["_url","name"],r);const a=w(e,["config"]);return a!=null&&Ppe(a,t),t}function Qpe(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","name"],r),t}function Hpe(e,t){const r={},a=w(e,["customMetadata"]);if(t!==void 0&&a!=null){let i=a;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["customMetadata"],i)}const s=w(e,["chunkingConfig"]);return t!==void 0&&s!=null&&N(t,["chunkingConfig"],s),r}function zpe(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],Vpe(l)),t}function $pe(e){const t={},r=w(e,["fileSearchStoreName"]);r!=null&&N(t,["_url","file_search_store_name"],r);const a=w(e,["fileName"]);a!=null&&N(t,["fileName"],a);const s=w(e,["config"]);return s!=null&&Hpe(s,t),t}function Vpe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&N(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&N(t,["documentName"],s),t}function Gpe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function Kpe(e){const t={},r=w(e,["config"]);return r!=null&&Gpe(r,t),t}function qpe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["fileSearchStores"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["fileSearchStores"],i)}return t}function OL(e,t){const r={},a=w(e,["mimeType"]);t!==void 0&&a!=null&&N(t,["mimeType"],a);const s=w(e,["displayName"]);t!==void 0&&s!=null&&N(t,["displayName"],s);const i=w(e,["customMetadata"]);if(t!==void 0&&i!=null){let o=i;Array.isArray(o)&&(o=o.map(d=>d)),N(t,["customMetadata"],o)}const l=w(e,["chunkingConfig"]);return t!==void 0&&l!=null&&N(t,["chunkingConfig"],l),r}function Wpe(e){const t={},r=w(e,["fileSearchStoreName"]);r!=null&&N(t,["_url","file_search_store_name"],r);const a=w(e,["config"]);return a!=null&&OL(a,t),t}function Ype(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Xpe="Content-Type",Jpe="X-Server-Timeout",Zpe="User-Agent",uC="x-goog-api-client",ehe="1.42.0",the=`google-genai-sdk/${ehe}`,rhe="v1beta1",ahe="v1beta",nhe=5,she=[408,429,500,502,503,504];class ihe{constructor(t){var r,a,s;this.clientOptions=Object.assign({},t),this.customBaseUrl=(r=t.httpOptions)===null||r===void 0?void 0:r.baseUrl,this.clientOptions.vertexai&&(this.clientOptions.project&&this.clientOptions.location?this.clientOptions.apiKey=void 0:this.clientOptions.apiKey&&(this.clientOptions.project=void 0,this.clientOptions.location=void 0));const i={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location="global"),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw new Error("Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.");const o=t.project&&t.location||!!t.apiKey;this.customBaseUrl&&!o?(i.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey||this.clientOptions.location==="global"?i.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&(i.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),i.apiVersion=(a=this.clientOptions.apiVersion)!==null&&a!==void 0?a:rhe}else{if(!this.clientOptions.apiKey)throw new up({message:"API key must be set when using the Gemini API.",status:403});i.apiVersion=(s=this.clientOptions.apiVersion)!==null&&s!==void 0?s:ahe,i.baseUrl="https://generativelanguage.googleapis.com/"}i.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=i,t.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(i,t.httpOptions))}isVertexAI(){var t;return(t=this.clientOptions.vertexai)!==null&&t!==void 0?t:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){const t=new Headers;return await this.clientOptions.auth.addAuthHeaders(t),t}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(t){if(!t||t.baseUrl===void 0||t.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const a=[t.baseUrl.endsWith("/")?t.baseUrl.slice(0,-1):t.baseUrl];return t.apiVersion&&t.apiVersion!==""&&a.push(t.apiVersion),a.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const t=this.getBaseUrl(),r=new URL(t);return r.protocol=r.protocol=="http:"?"ws":"wss",r.toString()}setBaseUrl(t){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=t;else throw new Error("HTTP options are not correctly set.")}constructUrl(t,r,a){const s=[this.getRequestUrlInternal(r)];return a&&s.push(this.getBaseResourcePath()),t!==""&&s.push(t),new URL(`${s.join("/")}`)}shouldPrependVertexProjectPath(t,r){return!(r.baseUrl&&r.baseUrlResourceScope===sC.COLLECTION||this.clientOptions.apiKey||!this.clientOptions.vertexai||t.path.startsWith("projects/")||t.httpMethod==="GET"&&t.path.startsWith("publishers/google/models"))}async request(t){let r=this.clientOptions.httpOptions;t.httpOptions&&(r=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const a=this.shouldPrependVertexProjectPath(t,r),s=this.constructUrl(t.path,r,a);if(t.queryParams)for(const[l,o]of Object.entries(t.queryParams))s.searchParams.append(l,String(o));let i={};if(t.httpMethod==="GET"){if(t.body&&t.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else i.body=t.body;return i=await this.includeExtraHttpOptionsToRequestInit(i,r,s.toString(),t.abortSignal),this.unaryApiCall(s,i,t.httpMethod)}patchHttpOptions(t,r){const a=JSON.parse(JSON.stringify(t));for(const[s,i]of Object.entries(r))typeof i=="object"?a[s]=Object.assign(Object.assign({},a[s]),i):i!==void 0&&(a[s]=i);return a}async requestStream(t){let r=this.clientOptions.httpOptions;t.httpOptions&&(r=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const a=this.shouldPrependVertexProjectPath(t,r),s=this.constructUrl(t.path,r,a);(!s.searchParams.has("alt")||s.searchParams.get("alt")!=="sse")&&s.searchParams.set("alt","sse");let i={};return i.body=t.body,i=await this.includeExtraHttpOptionsToRequestInit(i,r,s.toString(),t.abortSignal),this.streamApiCall(s,i,t.httpMethod)}async includeExtraHttpOptionsToRequestInit(t,r,a,s){if(r&&r.timeout||s){const i=new AbortController,l=i.signal;if(r.timeout&&(r==null?void 0:r.timeout)>0){const o=setTimeout(()=>i.abort(),r.timeout);o&&typeof o.unref=="function"&&o.unref()}s&&s.addEventListener("abort",()=>{i.abort()}),t.signal=l}return r&&r.extraBody!==null&&lhe(t,r.extraBody),t.headers=await this.getHeadersInternal(r,a),t}async unaryApiCall(t,r,a){return this.apiCall(t.toString(),Object.assign(Object.assign({},r),{method:a})).then(async s=>(await G3(s),new iC(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}async streamApiCall(t,r,a){return this.apiCall(t.toString(),Object.assign(Object.assign({},r),{method:a})).then(async s=>(await G3(s),this.processStreamResponse(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}processStreamResponse(t){return Li(this,arguments,function*(){var a;const s=(a=t==null?void 0:t.body)===null||a===void 0?void 0:a.getReader(),i=new TextDecoder("utf-8");if(!s)throw new Error("Response body is empty");try{let l="";const o="data:",d=[`

`,"\r\r",`\r
\r
`];for(;;){const{done:u,value:f}=yield wt(s.read());if(u){if(l.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const p=i.decode(f,{stream:!0});try{const b=JSON.parse(p);if("error"in b){const v=JSON.parse(JSON.stringify(b.error)),y=v.status,k=v.code,_=`got status: ${y}. ${JSON.stringify(b)}`;if(k>=400&&k<600)throw new up({message:_,status:k})}}catch(b){if(b.name==="ApiError")throw b}l+=p;let x=-1,m=0;for(;;){x=-1,m=0;for(const y of d){const k=l.indexOf(y);k!==-1&&(x===-1||k<x)&&(x=k,m=y.length)}if(x===-1)break;const b=l.substring(0,x);l=l.substring(x+m);const v=b.trim();if(v.startsWith(o)){const y=v.substring(o.length).trim();try{const k=new Response(y,{headers:t==null?void 0:t.headers,status:t==null?void 0:t.status,statusText:t==null?void 0:t.statusText});yield yield wt(new iC(k))}catch(k){throw new Error(`exception parsing stream chunk ${y}. ${k}`)}}}}}finally{s.releaseLock()}})}async apiCall(t,r){var a;if(!this.clientOptions.httpOptions||!this.clientOptions.httpOptions.retryOptions)return fetch(t,r);const s=this.clientOptions.httpOptions.retryOptions;return Wde(async()=>{const l=await fetch(t,r);if(l.ok)return l;throw she.includes(l.status)?new Error(`Retryable HTTP Error: ${l.statusText}`):new xL.AbortError(`Non-retryable exception ${l.statusText} sending request`)},{retries:((a=s.attempts)!==null&&a!==void 0?a:nhe)-1})}getDefaultHeaders(){const t={},r=the+" "+this.clientOptions.userAgentExtra;return t[Zpe]=r,t[uC]=r,t[Xpe]="application/json",t}async getHeadersInternal(t,r){const a=new Headers;if(t&&t.headers){for(const[s,i]of Object.entries(t.headers))a.append(s,i);t.timeout&&t.timeout>0&&a.append(Jpe,String(Math.ceil(t.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(a,r),a}getFileName(t){var r;let a="";return typeof t=="string"&&(a=t.replace(/[/\\]+$/,""),a=(r=a.split(/[/\\]/).pop())!==null&&r!==void 0?r:""),a}async uploadFile(t,r){var a;const s={};r!=null&&(s.mimeType=r.mimeType,s.name=r.name,s.displayName=r.displayName),s.name&&!s.name.startsWith("files/")&&(s.name=`files/${s.name}`);const i=this.clientOptions.uploader,l=await i.stat(t);s.sizeBytes=String(l.size);const o=(a=r==null?void 0:r.mimeType)!==null&&a!==void 0?a:l.type;if(o===void 0||o==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");s.mimeType=o;const d={file:s},u=this.getFileName(t),f=Ze("upload/v1beta/files",d._url),p=await this.fetchUploadUrl(f,s.sizeBytes,s.mimeType,u,d,r==null?void 0:r.httpOptions);return i.upload(t,p,this)}async uploadFileToFileSearchStore(t,r,a){var s;const i=this.clientOptions.uploader,l=await i.stat(r),o=String(l.size),d=(s=a==null?void 0:a.mimeType)!==null&&s!==void 0?s:l.type;if(d===void 0||d==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const u=`upload/v1beta/${t}:uploadToFileSearchStore`,f=this.getFileName(r),p={};a!=null&&OL(a,p);const x=await this.fetchUploadUrl(u,o,d,f,p,a==null?void 0:a.httpOptions);return i.uploadToFileSearchStore(r,x,this)}async downloadFile(t){await this.clientOptions.downloader.download(t,this)}async fetchUploadUrl(t,r,a,s,i,l){var o;let d={};l?d=l:d={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${r}`,"X-Goog-Upload-Header-Content-Type":`${a}`},s?{"X-Goog-Upload-File-Name":s}:{})};const u=await this.request({path:t,body:JSON.stringify(i),httpMethod:"POST",httpOptions:d});if(!u||!(u!=null&&u.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const f=(o=u==null?void 0:u.headers)===null||o===void 0?void 0:o["x-goog-upload-url"];if(f===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return f}}async function G3(e){var t;if(e===void 0)throw new Error("response is undefined");if(!e.ok){const r=e.status;let a;!((t=e.headers.get("content-type"))===null||t===void 0)&&t.includes("application/json")?a=await e.json():a={error:{message:await e.text(),code:e.status,status:e.statusText}};const s=JSON.stringify(a);throw r>=400&&r<600?new up({message:s,status:r}):new Error(s)}}function lhe(e,t){if(!t||Object.keys(t).length===0)return;if(e.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let r={};if(typeof e.body=="string"&&e.body.length>0)try{const i=JSON.parse(e.body);if(typeof i=="object"&&i!==null&&!Array.isArray(i))r=i;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function a(i,l){const o=Object.assign({},i);for(const d in l)if(Object.prototype.hasOwnProperty.call(l,d)){const u=l[d],f=o[d];u&&typeof u=="object"&&!Array.isArray(u)&&f&&typeof f=="object"&&!Array.isArray(f)?o[d]=a(f,u):(f&&u&&typeof f!=typeof u&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${d}". Original type: ${typeof f}, New type: ${typeof u}. Overwriting.`),o[d]=u)}return o}const s=a(r,t);e.body=JSON.stringify(s)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const ohe="mcp_used/unknown";let che=!1;function PL(e){for(const t of e)if(dhe(t)||typeof t=="object"&&"inputSchema"in t)return!0;return che}function LL(e){var t;const r=(t=e[uC])!==null&&t!==void 0?t:"";e[uC]=(r+` ${ohe}`).trimStart()}function dhe(e){return e!==null&&typeof e=="object"&&e instanceof Wj}function uhe(e){return Li(this,arguments,function*(r,a=100){let s,i=0;for(;i<a;){const l=yield wt(r.listTools({cursor:s}));for(const o of l.tools)yield yield wt(o),i++;if(!l.nextCursor)break;s=l.nextCursor}})}class Wj{constructor(t=[],r){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=t,this.config=r}static create(t,r){return new Wj(t,r)}async initialize(){var t,r,a,s;if(this.mcpTools.length>0)return;const i={},l=[];for(const f of this.mcpClients)try{for(var o=!0,d=(r=void 0,Qi(uhe(f))),u;u=await d.next(),t=u.done,!t;o=!0){s=u.value,o=!1;const p=s;l.push(p);const x=p.name;if(i[x])throw new Error(`Duplicate function name ${x} found in MCP tools. Please ensure function names are unique.`);i[x]=f}}catch(p){r={error:p}}finally{try{!o&&!t&&(a=d.return)&&await a.call(d)}finally{if(r)throw r.error}}this.mcpTools=l,this.functionNameToMcpClient=i}async tool(){return await this.initialize(),Rue(this.mcpTools,this.config)}async callTool(t){await this.initialize();const r=[];for(const a of t)if(a.name in this.functionNameToMcpClient){const s=this.functionNameToMcpClient[a.name];let i;this.config.timeout&&(i={timeout:this.config.timeout});const l=await s.callTool({name:a.name,arguments:a.args},void 0,i);r.push({functionResponse:{name:a.name,response:l.isError?{error:l}:l}})}return r}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function Ahe(e,t,r){const a=new Bue;let s;r.data instanceof Blob?s=JSON.parse(await r.data.text()):s=JSON.parse(r.data),Object.assign(a,s),t(a)}class fhe{constructor(t,r,a){this.apiClient=t,this.auth=r,this.webSocketFactory=a}async connect(t){var r,a;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const s=this.apiClient.getWebsocketBaseUrl(),i=this.apiClient.getApiVersion(),l=xhe(this.apiClient.getDefaultHeaders()),o=this.apiClient.getApiKey(),d=`${s}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${o}`;let u=()=>{};const f=new Promise(C=>{u=C}),p=t.callbacks,x=function(){u({})},m=this.apiClient,b={onopen:x,onmessage:C=>{Ahe(m,p.onmessage,C)},onerror:(r=p==null?void 0:p.onerror)!==null&&r!==void 0?r:function(C){},onclose:(a=p==null?void 0:p.onclose)!==null&&a!==void 0?a:function(C){}},v=this.webSocketFactory.create(d,hhe(l),b);v.connect(),await f;const _={setup:{model:Zt(this.apiClient,t.model)}};return v.send(JSON.stringify(_)),new phe(v,this.apiClient)}}class phe{constructor(t,r){this.conn=t,this.apiClient=r}async setWeightedPrompts(t){if(!t.weightedPrompts||Object.keys(t.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const r=R0e(t);this.conn.send(JSON.stringify({clientContent:r}))}async setMusicGenerationConfig(t){t.musicGenerationConfig||(t.musicGenerationConfig={});const r=M0e(t);this.conn.send(JSON.stringify(r))}sendPlaybackControl(t){const r={playbackControl:t};this.conn.send(JSON.stringify(r))}play(){this.sendPlaybackControl(AA.PLAY)}pause(){this.sendPlaybackControl(AA.PAUSE)}stop(){this.sendPlaybackControl(AA.STOP)}resetContext(){this.sendPlaybackControl(AA.RESET_CONTEXT)}close(){this.conn.close()}}function hhe(e){const t={};return e.forEach((r,a)=>{t[a]=r}),t}function xhe(e){const t=new Headers;for(const[r,a]of Object.entries(e))t.append(r,a);return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const mhe="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function ghe(e,t,r){const a=new Sue;let s;r.data instanceof Blob?s=await r.data.text():r.data instanceof ArrayBuffer?s=new TextDecoder().decode(r.data):s=r.data;const i=JSON.parse(s);if(e.isVertexAI()){const l=L0e(i);Object.assign(a,l)}else Object.assign(a,i);t(a)}class bhe{constructor(t,r,a){this.apiClient=t,this.auth=r,this.webSocketFactory=a,this.music=new fhe(this.apiClient,this.auth,this.webSocketFactory)}async connect(t){var r,a,s,i,l,o;if(t.config&&t.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");const d=this.apiClient.getWebsocketBaseUrl(),u=this.apiClient.getApiVersion();let f;const p=this.apiClient.getHeaders();t.config&&t.config.tools&&PL(t.config.tools)&&LL(p);const x=Nhe(p);if(this.apiClient.isVertexAI()){const U=this.apiClient.getProject(),D=this.apiClient.getLocation(),L=this.apiClient.getApiKey(),R=!!U&&!!D||!!L;this.apiClient.getCustomBaseUrl()&&!R?f=d:(f=`${d}/ws/google.cloud.aiplatform.${u}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(x,f))}else{const U=this.apiClient.getApiKey();let D="BidiGenerateContent",L="key";U!=null&&U.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),u!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),D="BidiGenerateContentConstrained",L="access_token"),f=`${d}/ws/google.ai.generativelanguage.${u}.GenerativeService.${D}?${L}=${U}`}let m=()=>{};const b=new Promise(U=>{m=U}),v=t.callbacks,y=function(){var U;(U=v==null?void 0:v.onopen)===null||U===void 0||U.call(v),m({})},k=this.apiClient,_={onopen:y,onmessage:U=>{ghe(k,v.onmessage,U)},onerror:(r=v==null?void 0:v.onerror)!==null&&r!==void 0?r:function(U){},onclose:(a=v==null?void 0:v.onclose)!==null&&a!==void 0?a:function(U){}},C=this.webSocketFactory.create(f,whe(x),_);C.connect(),await b;let E=Zt(this.apiClient,t.model);if(this.apiClient.isVertexAI()&&E.startsWith("publishers/")){const U=this.apiClient.getProject(),D=this.apiClient.getLocation();U&&D&&(E=`projects/${U}/locations/${D}/`+E)}let T={};this.apiClient.isVertexAI()&&((s=t.config)===null||s===void 0?void 0:s.responseModalities)===void 0&&(t.config===void 0?t.config={responseModalities:[Tg.AUDIO]}:t.config.responseModalities=[Tg.AUDIO]),!((i=t.config)===null||i===void 0)&&i.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const B=(o=(l=t.config)===null||l===void 0?void 0:l.tools)!==null&&o!==void 0?o:[],I=[];for(const U of B)if(this.isCallableTool(U)){const D=U;I.push(await D.tool())}else I.push(U);I.length>0&&(t.config.tools=I);const M={model:E,config:t.config,callbacks:t.callbacks};return this.apiClient.isVertexAI()?T=U0e(this.apiClient,M):T=D0e(this.apiClient,M),delete T.config,C.send(JSON.stringify(T)),new yhe(C,this.apiClient)}isCallableTool(t){return"callTool"in t&&typeof t.callTool=="function"}}const vhe={turnComplete:!0};class yhe{constructor(t,r){this.conn=t,this.apiClient=r}tLiveClientContent(t,r){if(r.turns!==null&&r.turns!==void 0){let a=[];try{a=Ms(r.turns),t.isVertexAI()||(a=a.map(s=>Wp(s)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof r.turns}'`)}return{clientContent:{turns:a,turnComplete:r.turnComplete}}}return{clientContent:{turnComplete:r.turnComplete}}}tLiveClienttToolResponse(t,r){let a=[];if(r.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(r.functionResponses)?a=r.functionResponses:a=[r.functionResponses],a.length===0)throw new Error("functionResponses is required.");for(const i of a){if(typeof i!="object"||i===null||!("name"in i)||!("response"in i))throw new Error(`Could not parse function response, type '${typeof i}'.`);if(!t.isVertexAI()&&!("id"in i))throw new Error(mhe)}return{toolResponse:{functionResponses:a}}}sendClientContent(t){t=Object.assign(Object.assign({},vhe),t);const r=this.tLiveClientContent(this.apiClient,t);this.conn.send(JSON.stringify(r))}sendRealtimeInput(t){let r={};this.apiClient.isVertexAI()?r={realtimeInput:P0e(t)}:r={realtimeInput:O0e(t)},this.conn.send(JSON.stringify(r))}sendToolResponse(t){if(t.functionResponses==null)throw new Error("Tool response parameters are required.");const r=this.tLiveClienttToolResponse(this.apiClient,t);this.conn.send(JSON.stringify(r))}close(){this.conn.close()}}function whe(e){const t={};return e.forEach((r,a)=>{t[a]=r}),t}function Nhe(e){const t=new Headers;for(const[r,a]of Object.entries(e))t.append(r,a);return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const K3=10;function q3(e){var t,r,a;if(!((t=e==null?void 0:e.automaticFunctionCalling)===null||t===void 0)&&t.disable)return!0;let s=!1;for(const l of(r=e==null?void 0:e.tools)!==null&&r!==void 0?r:[])if(bA(l)){s=!0;break}if(!s)return!0;const i=(a=e==null?void 0:e.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls;return i&&(i<0||!Number.isInteger(i))||i==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",i),!0):!1}function bA(e){return"callTool"in e&&typeof e.callTool=="function"}function Che(e){var t,r,a;return(a=(r=(t=e.config)===null||t===void 0?void 0:t.tools)===null||r===void 0?void 0:r.some(s=>bA(s)))!==null&&a!==void 0?a:!1}function W3(e){var t;const r=[];return!((t=e==null?void 0:e.config)===null||t===void 0)&&t.tools&&e.config.tools.forEach((a,s)=>{if(bA(a))return;const i=a;i.functionDeclarations&&i.functionDeclarations.length>0&&r.push(s)}),r}function Y3(e){var t;return!(!((t=e==null?void 0:e.automaticFunctionCalling)===null||t===void 0)&&t.ignoreCallHistory)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class khe extends Do{constructor(t){super(),this.apiClient=t,this.embedContent=async r=>{if(!this.apiClient.isVertexAI())return await this.embedContentInternal(r);if(r.model.includes("gemini")&&r.model!=="gemini-embedding-001"||r.model.includes("maas")){const s=Ms(r.contents);if(s.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");const i=Object.assign(Object.assign({},r),{content:s[0],embeddingApiType:Fg.EMBED_CONTENT});return await this.embedContentInternal(i)}else{const s=Object.assign(Object.assign({},r),{embeddingApiType:Fg.PREDICT});return await this.embedContentInternal(s)}},this.generateContent=async r=>{var a,s,i,l,o;const d=await this.processParamsMaybeAddMcpUsage(r);if(this.maybeMoveToResponseJsonSchem(r),!Che(r)||q3(r.config))return await this.generateContentInternal(d);const u=W3(r);if(u.length>0){const v=u.map(y=>`tools[${y}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${v}.`)}let f,p;const x=Ms(d.contents),m=(i=(s=(a=d.config)===null||a===void 0?void 0:a.automaticFunctionCalling)===null||s===void 0?void 0:s.maximumRemoteCalls)!==null&&i!==void 0?i:K3;let b=0;for(;b<m&&(f=await this.generateContentInternal(d),!(!f.functionCalls||f.functionCalls.length===0));){const v=f.candidates[0].content,y=[];for(const k of(o=(l=r.config)===null||l===void 0?void 0:l.tools)!==null&&o!==void 0?o:[])if(bA(k)){const C=await k.callTool(f.functionCalls);y.push(...C)}b++,p={role:"user",parts:y},d.contents=Ms(d.contents),d.contents.push(v),d.contents.push(p),Y3(d.config)&&(x.push(v),x.push(p))}return Y3(d.config)&&(f.automaticFunctionCallingHistory=x),f},this.generateContentStream=async r=>{var a,s,i,l,o;if(this.maybeMoveToResponseJsonSchem(r),q3(r.config)){const p=await this.processParamsMaybeAddMcpUsage(r);return await this.generateContentStreamInternal(p)}const d=W3(r);if(d.length>0){const p=d.map(x=>`tools[${x}]`).join(", ");throw new Error(`Incompatible tools found at ${p}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}const u=(i=(s=(a=r==null?void 0:r.config)===null||a===void 0?void 0:a.toolConfig)===null||s===void 0?void 0:s.functionCallingConfig)===null||i===void 0?void 0:i.streamFunctionCallArguments,f=(o=(l=r==null?void 0:r.config)===null||l===void 0?void 0:l.automaticFunctionCalling)===null||o===void 0?void 0:o.disable;if(u&&!f)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(r)},this.generateImages=async r=>await this.generateImagesInternal(r).then(a=>{var s;let i;const l=[];if(a!=null&&a.generatedImages)for(const d of a.generatedImages)d&&(d!=null&&d.safetyAttributes)&&((s=d==null?void 0:d.safetyAttributes)===null||s===void 0?void 0:s.contentType)==="Positive Prompt"?i=d==null?void 0:d.safetyAttributes:l.push(d);let o;return i?o={generatedImages:l,positivePromptSafetyAttributes:i,sdkHttpResponse:a.sdkHttpResponse}:o={generatedImages:l,sdkHttpResponse:a.sdkHttpResponse},o}),this.list=async r=>{var a;const l={config:Object.assign(Object.assign({},{queryBase:!0}),r==null?void 0:r.config)};if(this.apiClient.isVertexAI()&&!l.config.queryBase){if(!((a=l.config)===null||a===void 0)&&a.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");l.config.filter="labels.tune-type:*"}return new au(wo.PAGED_ITEM_MODELS,o=>this.listInternal(o),await this.listInternal(l),l)},this.editImage=async r=>{const a={model:r.model,prompt:r.prompt,referenceImages:[],config:r.config};return r.referenceImages&&r.referenceImages&&(a.referenceImages=r.referenceImages.map(s=>s.toReferenceImageAPI())),await this.editImageInternal(a)},this.upscaleImage=async r=>{let a={numberOfImages:1,mode:"upscale"};r.config&&(a=Object.assign(Object.assign({},a),r.config));const s={model:r.model,image:r.image,upscaleFactor:r.upscaleFactor,config:a};return await this.upscaleImageInternal(s)},this.generateVideos=async r=>{var a,s,i,l,o,d;if((r.prompt||r.image||r.video)&&r.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((a=r.video)===null||a===void 0)&&a.uri&&(!((s=r.video)===null||s===void 0)&&s.videoBytes)?r.video={uri:r.video.uri,mimeType:r.video.mimeType}:!((l=(i=r.source)===null||i===void 0?void 0:i.video)===null||l===void 0)&&l.uri&&(!((d=(o=r.source)===null||o===void 0?void 0:o.video)===null||d===void 0)&&d.videoBytes)&&(r.source.video={uri:r.source.video.uri,mimeType:r.source.video.mimeType})),await this.generateVideosInternal(r)}}maybeMoveToResponseJsonSchem(t){t.config&&t.config.responseSchema&&(t.config.responseJsonSchema||Object.keys(t.config.responseSchema).includes("$schema")&&(t.config.responseJsonSchema=t.config.responseSchema,delete t.config.responseSchema))}async processParamsMaybeAddMcpUsage(t){var r,a,s;const i=(r=t.config)===null||r===void 0?void 0:r.tools;if(!i)return t;const l=await Promise.all(i.map(async d=>bA(d)?await d.tool():d)),o={model:t.model,contents:t.contents,config:Object.assign(Object.assign({},t.config),{tools:l})};if(o.config.tools=l,t.config&&t.config.tools&&PL(t.config.tools)){const d=(s=(a=t.config.httpOptions)===null||a===void 0?void 0:a.headers)!==null&&s!==void 0?s:{};let u=Object.assign({},d);Object.keys(u).length===0&&(u=this.apiClient.getDefaultHeaders()),LL(u),o.config.httpOptions=Object.assign(Object.assign({},t.config.httpOptions),{headers:u})}return o}async initAfcToolsMap(t){var r,a,s;const i=new Map;for(const l of(a=(r=t.config)===null||r===void 0?void 0:r.tools)!==null&&a!==void 0?a:[])if(bA(l)){const o=l,d=await o.tool();for(const u of(s=d.functionDeclarations)!==null&&s!==void 0?s:[]){if(!u.name)throw new Error("Function declaration name is required.");if(i.has(u.name))throw new Error(`Duplicate tool declaration name: ${u.name}`);i.set(u.name,o)}}return i}async processAfcStream(t){var r,a,s;const i=(s=(a=(r=t.config)===null||r===void 0?void 0:r.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls)!==null&&s!==void 0?s:K3;let l=!1,o=0;const d=await this.initAfcToolsMap(t);return(function(u,f,p){return Li(this,arguments,function*(){for(var x,m,b,v,y,k;o<i;){l&&(o++,l=!1);const T=yield wt(u.processParamsMaybeAddMcpUsage(p)),B=yield wt(u.generateContentStreamInternal(T)),I=[],M=[];try{for(var _=!0,C=(m=void 0,Qi(B)),E;E=yield wt(C.next()),x=E.done,!x;_=!0){v=E.value,_=!1;const U=v;if(yield yield wt(U),U.candidates&&(!((y=U.candidates[0])===null||y===void 0)&&y.content)){M.push(U.candidates[0].content);for(const D of(k=U.candidates[0].content.parts)!==null&&k!==void 0?k:[])if(o<i&&D.functionCall){if(!D.functionCall.name)throw new Error("Function call name was not returned by the model.");if(f.has(D.functionCall.name)){const L=yield wt(f.get(D.functionCall.name).callTool([D.functionCall]));I.push(...L)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${f.keys()}, mising tool: ${D.functionCall.name}`)}}}}catch(U){m={error:U}}finally{try{!_&&!x&&(b=C.return)&&(yield wt(b.call(C)))}finally{if(m)throw m.error}}if(I.length>0){l=!0;const U=new sf;U.candidates=[{content:{role:"user",parts:I}}],yield yield wt(U);const D=[];D.push(...M),D.push({role:"user",parts:I});const L=Ms(p.contents).concat(D);p.contents=L}else break}})})(this,d,t)}async generateContentInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=z3(this.apiClient,t);return o=Ze("{model}:generateContent",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=V3(f),x=new sf;return Object.assign(x,p),x})}else{const u=H3(this.apiClient,t);return o=Ze("{model}:generateContent",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=$3(f),x=new sf;return Object.assign(x,p),x})}}async generateContentStreamInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=z3(this.apiClient,t);return o=Ze("{model}:streamGenerateContent?alt=sse",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.requestStream({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}),l.then(function(p){return Li(this,arguments,function*(){var x,m,b,v;try{for(var y=!0,k=Qi(p),_;_=yield wt(k.next()),x=_.done,!x;y=!0){v=_.value,y=!1;const C=v,E=V3(yield wt(C.json()),t);E.sdkHttpResponse={headers:C.headers};const T=new sf;Object.assign(T,E),yield yield wt(T)}}catch(C){m={error:C}}finally{try{!y&&!x&&(b=k.return)&&(yield wt(b.call(k)))}finally{if(m)throw m.error}}})})}else{const u=H3(this.apiClient,t);return o=Ze("{model}:streamGenerateContent?alt=sse",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.requestStream({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}),l.then(function(p){return Li(this,arguments,function*(){var x,m,b,v;try{for(var y=!0,k=Qi(p),_;_=yield wt(k.next()),x=_.done,!x;y=!0){v=_.value,y=!1;const C=v,E=$3(yield wt(C.json()),t);E.sdkHttpResponse={headers:C.headers};const T=new sf;Object.assign(T,E),yield yield wt(T)}}catch(C){m={error:C}}finally{try{!y&&!x&&(b=k.return)&&(yield wt(b.call(k)))}finally{if(m)throw m.error}}})})}}async embedContentInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=mfe(this.apiClient,t,t),f=Pue(t.model)?"{model}:embedContent":"{model}:predict";return o=Ze(f,u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(p=>p.json().then(x=>{const m=x;return m.sdkHttpResponse={headers:p.headers},m})),l.then(p=>{const x=bfe(p,t),m=new k3;return Object.assign(m,x),m})}else{const u=xfe(this.apiClient,t);return o=Ze("{model}:batchEmbedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=gfe(f),x=new k3;return Object.assign(x,p),x})}}async generateImagesInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=_fe(this.apiClient,t);return o=Ze("{model}:predict",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Ffe(f),x=new j3;return Object.assign(x,p),x})}else{const u=Bfe(this.apiClient,t);return o=Ze("{model}:predict",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Tfe(f),x=new j3;return Object.assign(x,p),x})}}async editImageInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Afe(this.apiClient,t);return i=Ze("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=ffe(d),f=new xue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=_pe(this.apiClient,t);return i=Ze("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=Tpe(d),f=new mue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=upe(this.apiClient,t);return i=Ze("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=Ape(d),f=new gue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=gpe(this.apiClient,t);return i=Ze("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=bpe(d),f=new bue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async get(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Wfe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>dC(f))}else{const u=qfe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>cC(f))}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=npe(this.apiClient,t);return o=Ze("{models_url}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=ipe(f),x=new E3;return Object.assign(x,p),x})}else{const u=ape(this.apiClient,t);return o=Ze("{models_url}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=spe(f),x=new E3;return Object.assign(x,p),x})}}async update(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Spe(this.apiClient,t);return o=Ze("{model}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>dC(f))}else{const u=Epe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>cC(f))}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=ofe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=dfe(f),x=new S3;return Object.assign(x,p),x})}else{const u=lfe(this.apiClient,t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=cfe(f),x=new S3;return Object.assign(x,p),x})}}async countTokens(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=nfe(this.apiClient,t);return o=Ze("{model}:countTokens",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=ife(f),x=new B3;return Object.assign(x,p),x})}else{const u=afe(this.apiClient,t);return o=Ze("{model}:countTokens",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=sfe(f),x=new B3;return Object.assign(x,p),x})}}async computeTokens(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Y0e(this.apiClient,t);return i=Ze("{model}:computeTokens",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=X0e(d),f=new vue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Ofe(this.apiClient,t);return o=Ze("{model}:predictLongRunning",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Mfe(f),x=new Ig;return Object.assign(x,p),x})}else{const u=Rfe(this.apiClient,t);return o=Ze("{model}:predictLongRunning",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Ufe(f),x=new Ig;return Object.assign(x,p),x})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class jhe extends Do{constructor(t){super(),this.apiClient=t}async getVideosOperation(t){const r=t.operation,a=t.config;if(r.name===void 0||r.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const s=r.name.split("/operations/")[0];let i;a&&"httpOptions"in a&&(i=a.httpOptions);const l=await this.fetchPredictVideosOperationInternal({operationName:r.name,resourceName:s,config:{httpOptions:i}});return r._fromAPIResponse({apiResponse:l,_isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:r.name,config:a});return r._fromAPIResponse({apiResponse:s,_isVertexAI:!1})}}async get(t){const r=t.operation,a=t.config;if(r.name===void 0||r.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const s=r.name.split("/operations/")[0];let i;a&&"httpOptions"in a&&(i=a.httpOptions);const l=await this.fetchPredictVideosOperationInternal({operationName:r.name,resourceName:s,config:{httpOptions:i}});return r._fromAPIResponse({apiResponse:l,_isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:r.name,config:a});return r._fromAPIResponse({apiResponse:s,_isVertexAI:!1})}}async getVideosOperationInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=due(t);return o=Ze("{operationName}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l}else{const u=cue(t);return o=Ze("{operationName}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l}}async fetchPredictVideosOperationInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=rue(t);return i=Ze("{resourceName}:fetchPredictOperation",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s}else throw new Error("This method is only supported by the Vertex AI.")}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Ehe(e){const t={},r=w(e,["data"]);if(r!=null&&N(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function She(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>Rhe(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function Bhe(e,t,r){const a={},s=w(t,["expireTime"]);r!==void 0&&s!=null&&N(r,["expireTime"],s);const i=w(t,["newSessionExpireTime"]);r!==void 0&&i!=null&&N(r,["newSessionExpireTime"],i);const l=w(t,["uses"]);r!==void 0&&l!=null&&N(r,["uses"],l);const o=w(t,["liveConnectConstraints"]);r!==void 0&&o!=null&&N(r,["bidiGenerateContentSetup"],Mhe(e,o));const d=w(t,["lockAdditionalFields"]);return r!==void 0&&d!=null&&N(r,["fieldMask"],d),a}function _he(e,t){const r={},a=w(t,["config"]);return a!=null&&N(r,["config"],Bhe(e,a,r)),r}function The(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function Fhe(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function Ihe(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&N(t,["enableWidget"],r),t}function Dhe(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&N(t,["timeRangeFilter"],r),t}function Uhe(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&N(t,["setup","generationConfig"],a);const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&N(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&N(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&N(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&N(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&N(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&N(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&N(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&N(t,["setup","generationConfig","speechConfig"],qj(p));const x=w(e,["thinkingConfig"]);t!==void 0&&x!=null&&N(t,["setup","generationConfig","thinkingConfig"],x);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&N(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&N(t,["setup","systemInstruction"],She(Ja(b)));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let B=JA(v);Array.isArray(B)&&(B=B.map(I=>Phe(XA(I)))),N(t,["setup","tools"],B)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&N(t,["setup","sessionResumption"],Ohe(y));const k=w(e,["inputAudioTranscription"]);t!==void 0&&k!=null&&N(t,["setup","inputAudioTranscription"],k);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&N(t,["setup","outputAudioTranscription"],_);const C=w(e,["realtimeInputConfig"]);t!==void 0&&C!=null&&N(t,["setup","realtimeInputConfig"],C);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&N(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);if(t!==void 0&&T!=null&&N(t,["setup","proactivity"],T),w(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return r}function Mhe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["setup","model"],Zt(e,a));const s=w(t,["config"]);return s!=null&&N(r,["config"],Uhe(s,r)),r}function Rhe(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],The(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],Fhe(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],Ehe(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function Ohe(e){const t={},r=w(e,["handle"]);if(r!=null&&N(t,["handle"],r),w(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Phe(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],Ihe(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],Dhe(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Lhe(e){const t=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const a=e[r];if(typeof a=="object"&&a!=null&&Object.keys(a).length>0){const s=Object.keys(a).map(i=>`${r}.${i}`);t.push(...s)}else t.push(r)}return t.join(",")}function Qhe(e,t){let r=null;const a=e.bidiGenerateContentSetup;if(typeof a=="object"&&a!==null&&"setup"in a){const i=a.setup;typeof i=="object"&&i!==null?(e.bidiGenerateContentSetup=i,r=i):delete e.bidiGenerateContentSetup}else a!==void 0&&delete e.bidiGenerateContentSetup;const s=e.fieldMask;if(r){const i=Lhe(r);if(Array.isArray(t==null?void 0:t.lockAdditionalFields)&&(t==null?void 0:t.lockAdditionalFields.length)===0)i?e.fieldMask=i:delete e.fieldMask;else if(t!=null&&t.lockAdditionalFields&&t.lockAdditionalFields.length>0&&s!==null&&Array.isArray(s)&&s.length>0){const l=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let o=[];s.length>0&&(o=s.map(u=>l.includes(u)?`generationConfig.${u}`:u));const d=[];i&&d.push(i),o.length>0&&d.push(...o),d.length>0?e.fieldMask=d.join(","):delete e.fieldMask}else delete e.fieldMask}else s!==null&&Array.isArray(s)&&s.length>0?e.fieldMask=s.join(","):delete e.fieldMask;return e}class Hhe extends Do{constructor(t){super(),this.apiClient=t}async create(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const o=_he(this.apiClient,t);i=Ze("auth_tokens",o._url),l=o._query,delete o.config,delete o._url,delete o._query;const d=Qhe(o,t.config);return s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(d),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(u=>u.json()),s.then(u=>u)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function zhe(e,t){const r={},a=w(e,["force"]);return t!==void 0&&a!=null&&N(t,["_query","force"],a),r}function $he(e){const t={},r=w(e,["name"]);r!=null&&N(t,["_url","name"],r);const a=w(e,["config"]);return a!=null&&zhe(a,t),t}function Vhe(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","name"],r),t}function Ghe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function Khe(e){const t={},r=w(e,["parent"]);r!=null&&N(t,["_url","parent"],r);const a=w(e,["config"]);return a!=null&&Ghe(a,t),t}function qhe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["documents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["documents"],i)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Whe extends Do{constructor(t){super(),this.apiClient=t,this.list=async r=>new au(wo.PAGED_ITEM_DOCUMENTS,a=>this.listInternal({parent:r.parent,config:a.config}),await this.listInternal(r),r)}async get(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Vhe(t);return i=Ze("{name}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async delete(t){var r,a;let s="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=$he(t);s=Ze("{name}",l._url),i=l._query,delete l._url,delete l._query,await this.apiClient.request({path:s,queryParams:i,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}}async listInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Khe(t);return i=Ze("{parent}/documents",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=qhe(d),f=new yue;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Yhe extends Do{constructor(t,r=new Whe(t)){super(),this.apiClient=t,this.documents=r,this.list=async(a={})=>new au(wo.PAGED_ITEM_FILE_SEARCH_STORES,s=>this.listInternal(s),await this.listInternal(a),a)}async uploadToFileSearchStore(t){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(t.fileSearchStoreName,t.file,t.config)}async create(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Ope(t);return i=Ze("fileSearchStores",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async get(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Qpe(t);return i=Ze("{name}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async delete(t){var r,a;let s="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=Lpe(t);s=Ze("{name}",l._url),i=l._query,delete l._url,delete l._query,await this.apiClient.request({path:s,queryParams:i,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}}async listInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Kpe(t);return i=Ze("fileSearchStores",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=qpe(d),f=new wue;return Object.assign(f,u),f})}}async uploadToFileSearchStoreInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Wpe(t);return i=Ze("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=Ype(d),f=new Nue;return Object.assign(f,u),f})}}async importFile(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=$pe(t);return i=Ze("{file_search_store_name}:importFile",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=zpe(d),f=new zj;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let QL=function(){const{crypto:e}=globalThis;if(e!=null&&e.randomUUID)return QL=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^r()&15>>+a/4).toString(16))};const Xhe=()=>QL();/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function AC(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const fC=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class wi extends Error{}class Yn extends wi{constructor(t,r,a,s){super(`${Yn.makeMessage(t,r,a)}`),this.status=t,this.headers=s,this.error=r}static makeMessage(t,r,a){const s=r!=null&&r.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):a;return t&&s?`${t} ${s}`:t?`${t} status code (no body)`:s||"(no status code or body)"}static generate(t,r,a,s){if(!t||!s)return new rv({message:a,cause:fC(r)});const i=r;return t===400?new zL(t,i,a,s):t===401?new $L(t,i,a,s):t===403?new VL(t,i,a,s):t===404?new GL(t,i,a,s):t===409?new KL(t,i,a,s):t===422?new qL(t,i,a,s):t===429?new WL(t,i,a,s):t>=500?new YL(t,i,a,s):new Yn(t,i,a,s)}}class pC extends Yn{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class rv extends Yn{constructor({message:t,cause:r}){super(void 0,void 0,t||"Connection error.",void 0),r&&(this.cause=r)}}class HL extends rv{constructor({message:t}={}){super({message:t??"Request timed out."})}}class zL extends Yn{}class $L extends Yn{}class VL extends Yn{}class GL extends Yn{}class KL extends Yn{}class qL extends Yn{}class WL extends Yn{}class YL extends Yn{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Jhe=/^[a-z][a-z0-9+.-]*:/i,Zhe=e=>Jhe.test(e);let hC=e=>(hC=Array.isArray,hC(e));const exe=hC;let txe=exe;const X3=txe;function rxe(e){if(!e)return!0;for(const t in e)return!1;return!0}function axe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const nxe=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new wi(`${e} must be an integer`);if(t<0)throw new wi(`${e} must be a positive integer`);return t},sxe=e=>{try{return JSON.parse(e)}catch{return}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const ixe=e=>new Promise(t=>setTimeout(t,e));/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const sA="0.0.1";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function lxe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const oxe=()=>{var e,t,r,a,s;const i=lxe();if(i==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sA,"X-Stainless-OS":Z3(Deno.build.os),"X-Stainless-Arch":J3(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:(t=(e=Deno.version)===null||e===void 0?void 0:e.deno)!==null&&t!==void 0?t:"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(i==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sA,"X-Stainless-OS":Z3((r=globalThis.process.platform)!==null&&r!==void 0?r:"unknown"),"X-Stainless-Arch":J3((a=globalThis.process.arch)!==null&&a!==void 0?a:"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":(s=globalThis.process.version)!==null&&s!==void 0?s:"unknown"};const l=cxe();return l?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${l.browser}`,"X-Stainless-Runtime-Version":l.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function cxe(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:r}of e){const a=r.exec(navigator.userAgent);if(a){const s=a[1]||0,i=a[2]||0,l=a[3]||0;return{browser:t,version:`${s}.${i}.${l}`}}}return null}const J3=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",Z3=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let Ix;const dxe=()=>Ix??(Ix=oxe());/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function uxe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function XL(...e){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Axe(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return XL({start(){},async pull(r){const{done:a,value:s}=await t.next();a?r.close():r.enqueue(s)},async cancel(){var r;await((r=t.return)===null||r===void 0?void 0:r.call(t))}})}function JL(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const r=await t.read();return r!=null&&r.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){const r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function fxe(e){var t,r;if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await((r=(t=e[Symbol.asyncIterator]()).return)===null||r===void 0?void 0:r.call(t));return}const a=e.getReader(),s=a.cancel();a.releaseLock(),await s}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const pxe=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const ZL=()=>{var e;if(typeof File>"u"){const{process:t}=globalThis,r=typeof((e=t==null?void 0:t.versions)===null||e===void 0?void 0:e.node)=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(r?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function v2(e,t,r){return ZL(),new File(e,t??"unknown_file",r)}function hxe(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const xxe=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const eQ=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",mxe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&eQ(e),gxe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function bxe(e,t,r){if(ZL(),e=await e,mxe(e))return e instanceof File?e:v2([await e.arrayBuffer()],e.name);if(gxe(e)){const s=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),v2(await xC(s),t,r)}const a=await xC(e);if(t||(t=hxe(e)),!(r!=null&&r.type)){const s=a.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof s=="string"&&(r=Object.assign(Object.assign({},r),{type:s}))}return v2(a,t,r)}async function xC(e){var t,r,a,s,i;let l=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)l.push(e);else if(eQ(e))l.push(e instanceof Blob?e:await e.arrayBuffer());else if(xxe(e))try{for(var o=!0,d=Qi(e),u;u=await d.next(),t=u.done,!t;o=!0){s=u.value,o=!1;const f=s;l.push(...await xC(f))}}catch(f){r={error:f}}finally{try{!o&&!t&&(a=d.return)&&await a.call(d)}finally{if(r)throw r.error}}else{const f=(i=e==null?void 0:e.constructor)===null||i===void 0?void 0:i.name;throw new Error(`Unexpected data type: ${typeof e}${f?`; constructor: ${f}`:""}${vxe(e)}`)}return l}function vxe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(r=>`"${r}"`).join(", ")}]`}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class tQ{constructor(t){this._client=t}}tQ._key=[];/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function rQ(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const eD=Object.freeze(Object.create(null)),yxe=(e=rQ)=>(function(r,...a){if(r.length===1)return r[0];let s=!1;const i=[],l=r.reduce((f,p,x)=>{var m,b,v;/[?#]/.test(p)&&(s=!0);const y=a[x];let k=(s?encodeURIComponent:e)(""+y);return x!==a.length&&(y==null||typeof y=="object"&&y.toString===((v=Object.getPrototypeOf((b=Object.getPrototypeOf((m=y.hasOwnProperty)!==null&&m!==void 0?m:eD))!==null&&b!==void 0?b:eD))===null||v===void 0?void 0:v.toString))&&(k=y+"",i.push({start:f.length+p.length,length:k.length,error:`Value of type ${Object.prototype.toString.call(y).slice(8,-1)} is not a valid path parameter`})),f+p+(x===a.length?"":k)},""),o=l.split(/[?#]/,1)[0],d=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let u;for(;(u=d.exec(o))!==null;)i.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(i.sort((f,p)=>f.start-p.start),i.length>0){let f=0;const p=i.reduce((x,m)=>{const b=" ".repeat(m.start-f),v="^".repeat(m.length);return f=m.start+m.length,x+b+v},"");throw new wi(`Path parameters result in path with invalid segments:
${i.map(x=>x.error).join(`
`)}
${l}
${p}`)}return l}),Dx=yxe(rQ);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class aQ extends tQ{create(t,r){var a;const{api_version:s=this._client.apiVersion}=t,i=Ug(t,["api_version"]);if("model"in i&&"agent_config"in i)throw new wi("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in i&&"generation_config"in i)throw new wi("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(Dx`/${s}/interactions`,Object.assign(Object.assign({body:i},r),{stream:(a=t.stream)!==null&&a!==void 0?a:!1}))}delete(t,r={},a){const{api_version:s=this._client.apiVersion}=r??{};return this._client.delete(Dx`/${s}/interactions/${t}`,a)}cancel(t,r={},a){const{api_version:s=this._client.apiVersion}=r??{};return this._client.post(Dx`/${s}/interactions/${t}/cancel`,a)}get(t,r={},a){var s;const i=r??{},{api_version:l=this._client.apiVersion}=i,o=Ug(i,["api_version"]);return this._client.get(Dx`/${l}/interactions/${t}`,Object.assign(Object.assign({query:o},a),{stream:(s=r==null?void 0:r.stream)!==null&&s!==void 0?s:!1}))}}aQ._key=Object.freeze(["interactions"]);class nQ extends aQ{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function wxe(e){let t=0;for(const s of e)t+=s.length;const r=new Uint8Array(t);let a=0;for(const s of e)r.set(s,a),a+=s.length;return r}let Ux;function Yj(e){let t;return(Ux??(t=new globalThis.TextEncoder,Ux=t.encode.bind(t)))(e)}let Mx;function tD(e){let t;return(Mx??(t=new globalThis.TextDecoder,Mx=t.decode.bind(t)))(e)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class av{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null}decode(t){if(t==null)return[];const r=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Yj(t):t;this.buffer=wxe([this.buffer,r]);const a=[];let s;for(;(s=Nxe(this.buffer,this.carriageReturnIndex))!=null;){if(s.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=s.index;continue}if(this.carriageReturnIndex!=null&&(s.index!==this.carriageReturnIndex+1||s.carriage)){a.push(tD(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null;continue}const i=this.carriageReturnIndex!==null?s.preceding-1:s.preceding,l=tD(this.buffer.subarray(0,i));a.push(l),this.buffer=this.buffer.subarray(s.index),this.carriageReturnIndex=null}return a}flush(){return this.buffer.length?this.decode(`
`):[]}}av.NEWLINE_CHARS=new Set([`
`,"\r"]);av.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Nxe(e,t){for(let s=t??0;s<e.length;s++){if(e[s]===10)return{preceding:s,index:s+1,carriage:!1};if(e[s]===13)return{preceding:s,index:s+1,carriage:!0}}return null}function Cxe(e){for(let a=0;a<e.length-1;a++){if(e[a]===10&&e[a+1]===10||e[a]===13&&e[a+1]===13)return a+2;if(e[a]===13&&e[a+1]===10&&a+3<e.length&&e[a+2]===13&&e[a+3]===10)return a+4}return-1}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Mg={off:0,error:200,warn:300,info:400,debug:500},rD=(e,t,r)=>{if(e){if(axe(Mg,e))return e;Qn(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Mg))}`)}};function bf(){}function Rx(e,t,r){return!t||Mg[e]>Mg[r]?bf:t[e].bind(t)}const kxe={error:bf,warn:bf,info:bf,debug:bf};let aD=new WeakMap;function Qn(e){var t;const r=e.logger,a=(t=e.logLevel)!==null&&t!==void 0?t:"off";if(!r)return kxe;const s=aD.get(r);if(s&&s[0]===a)return s[1];const i={error:Rx("error",r,a),warn:Rx("warn",r,a),info:Rx("info",r,a),debug:Rx("debug",r,a)};return aD.set(r,[a,i]),i}const md=e=>(e.options&&(e.options=Object.assign({},e.options),delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-goog-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class fA{constructor(t,r,a){this.iterator=t,this.controller=r,this.client=a}static fromSSEResponse(t,r,a){let s=!1;const i=a?Qn(a):console;function l(){return Li(this,arguments,function*(){var d,u,f,p;if(s)throw new wi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let x=!1;try{try{for(var m=!0,b=Qi(jxe(t,r)),v;v=yield wt(b.next()),d=v.done,!d;m=!0){p=v.value,m=!1;const y=p;if(!x)if(y.data.startsWith("[DONE]")){x=!0;continue}else try{yield yield wt(JSON.parse(y.data))}catch(k){throw i.error("Could not parse message into JSON:",y.data),i.error("From chunk:",y.raw),k}}}catch(y){u={error:y}}finally{try{!m&&!d&&(f=b.return)&&(yield wt(f.call(b)))}finally{if(u)throw u.error}}x=!0}catch(y){if(AC(y))return yield wt(void 0);throw y}finally{x||r.abort()}})}return new fA(l,r,a)}static fromReadableStream(t,r,a){let s=!1;function i(){return Li(this,arguments,function*(){var d,u,f,p;const x=new av,m=JL(t);try{for(var b=!0,v=Qi(m),y;y=yield wt(v.next()),d=y.done,!d;b=!0){p=y.value,b=!1;const k=p;for(const _ of x.decode(k))yield yield wt(_)}}catch(k){u={error:k}}finally{try{!b&&!d&&(f=v.return)&&(yield wt(f.call(v)))}finally{if(u)throw u.error}}for(const k of x.flush())yield yield wt(k)})}function l(){return Li(this,arguments,function*(){var d,u,f,p;if(s)throw new wi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let x=!1;try{try{for(var m=!0,b=Qi(i()),v;v=yield wt(b.next()),d=v.done,!d;m=!0){p=v.value,m=!1;const y=p;x||y&&(yield yield wt(JSON.parse(y)))}}catch(y){u={error:y}}finally{try{!m&&!d&&(f=b.return)&&(yield wt(f.call(b)))}finally{if(u)throw u.error}}x=!0}catch(y){if(AC(y))return yield wt(void 0);throw y}finally{x||r.abort()}})}return new fA(l,r,a)}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],r=[],a=this.iterator(),s=i=>({next:()=>{if(i.length===0){const l=a.next();t.push(l),r.push(l)}return i.shift()}});return[new fA(()=>s(t),this.controller,this.client),new fA(()=>s(r),this.controller,this.client)]}toReadableStream(){const t=this;let r;return XL({async start(){r=t[Symbol.asyncIterator]()},async pull(a){try{const{value:s,done:i}=await r.next();if(i)return a.close();const l=Yj(JSON.stringify(s)+`
`);a.enqueue(l)}catch(s){a.error(s)}},async cancel(){var a;await((a=r.return)===null||a===void 0?void 0:a.call(r))}})}}function jxe(e,t){return Li(this,arguments,function*(){var a,s,i,l;if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new wi("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new wi("Attempted to iterate over a response with no body");const o=new Sxe,d=new av,u=JL(e.body);try{for(var f=!0,p=Qi(Exe(u)),x;x=yield wt(p.next()),a=x.done,!a;f=!0){l=x.value,f=!1;const m=l;for(const b of d.decode(m)){const v=o.decode(b);v&&(yield yield wt(v))}}}catch(m){s={error:m}}finally{try{!f&&!a&&(i=p.return)&&(yield wt(i.call(p)))}finally{if(s)throw s.error}}for(const m of d.flush()){const b=o.decode(m);b&&(yield yield wt(b))}})}function Exe(e){return Li(this,arguments,function*(){var r,a,s,i;let l=new Uint8Array;try{for(var o=!0,d=Qi(e),u;u=yield wt(d.next()),r=u.done,!r;o=!0){i=u.value,o=!1;const f=i;if(f==null)continue;const p=f instanceof ArrayBuffer?new Uint8Array(f):typeof f=="string"?Yj(f):f;let x=new Uint8Array(l.length+p.length);x.set(l),x.set(p,l.length),l=x;let m;for(;(m=Cxe(l))!==-1;)yield yield wt(l.slice(0,m)),l=l.slice(m)}}catch(f){a={error:f}}finally{try{!o&&!r&&(s=d.return)&&(yield wt(s.call(d)))}finally{if(a)throw a.error}}l.length>0&&(yield yield wt(l))})}class Sxe{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const i={event:this.event,data:this.data.join(`
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(t),t.startsWith(":"))return null;let[r,a,s]=Bxe(t,":");return s.startsWith(" ")&&(s=s.substring(1)),r==="event"?this.event=s:r==="data"&&this.data.push(s),null}}function Bxe(e,t){const r=e.indexOf(t);return r!==-1?[e.substring(0,r),t,e.substring(r+t.length)]:[e,"",""]}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function _xe(e,t){const{response:r,requestLogID:a,retryOfRequestLogID:s,startTime:i}=t,l=await(async()=>{var o;if(t.options.stream)return Qn(e).debug("response",r.status,r.url,r.headers,r.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(r,t.controller,e):fA.fromSSEResponse(r,t.controller,e);if(r.status===204)return null;if(t.options.__binaryResponse)return r;const d=r.headers.get("content-type"),u=(o=d==null?void 0:d.split(";")[0])===null||o===void 0?void 0:o.trim();return(u==null?void 0:u.includes("application/json"))||(u==null?void 0:u.endsWith("+json"))?r.headers.get("content-length")==="0"?void 0:await r.json():await r.text()})();return Qn(e).debug(`[${a}] response parsed`,md({retryOfRequestLogID:s,url:r.url,status:r.status,body:l,durationMs:Date.now()-i})),l}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Xj extends Promise{constructor(t,r,a=_xe){super(s=>{s(null)}),this.responsePromise=r,this.parseResponse=a,this.client=t}_thenUnwrap(t){return new Xj(this.client,this.responsePromise,async(r,a)=>t(await this.parseResponse(r,a),a))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:r}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(this.client,t))),this.parsedPromise}then(t,r){return this.parse().then(t,r)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const sQ=Symbol("brand.privateNullableHeaders");function*Txe(e){if(!e)return;if(sQ in e){const{values:a,nulls:s}=e;yield*a.entries();for(const i of s)yield[i,null];return}let t=!1,r;e instanceof Headers?r=e.entries():X3(e)?r=e:(t=!0,r=Object.entries(e??{}));for(let a of r){const s=a[0];if(typeof s!="string")throw new TypeError("expected header name to be a string");const i=X3(a[1])?a[1]:[a[1]];let l=!1;for(const o of i)o!==void 0&&(t&&!l&&(l=!0,yield[s,null]),yield[s,o])}}const lf=e=>{const t=new Headers,r=new Set;for(const a of e){const s=new Set;for(const[i,l]of Txe(a)){const o=i.toLowerCase();s.has(o)||(t.delete(i),s.add(o)),l===null?(t.delete(i),r.add(o)):(t.append(i,l),r.delete(o))}}return{[sQ]:!0,values:t,nulls:r}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const y2=e=>{var t,r,a,s,i,l;if(typeof globalThis.process<"u")return(a=(r=(t=Yde)===null||t===void 0?void 0:t[e])===null||r===void 0?void 0:r.trim())!==null&&a!==void 0?a:void 0;if(typeof globalThis.Deno<"u")return(l=(i=(s=globalThis.Deno.env)===null||s===void 0?void 0:s.get)===null||i===void 0?void 0:i.call(s,e))===null||l===void 0?void 0:l.trim()};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var iQ;class nv{constructor(t){var r,a,s,i,l,o,d,{baseURL:u=y2("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:f=(r=y2("GEMINI_API_KEY"))!==null&&r!==void 0?r:null,apiVersion:p="v1beta"}=t,x=Ug(t,["baseURL","apiKey","apiVersion"]);const m=Object.assign(Object.assign({apiKey:f,apiVersion:p},x),{baseURL:u||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(a=m.timeout)!==null&&a!==void 0?a:nv.DEFAULT_TIMEOUT,this.logger=(s=m.logger)!==null&&s!==void 0?s:console;const b="warn";this.logLevel=b,this.logLevel=(l=(i=rD(m.logLevel,"ClientOptions.logLevel",this))!==null&&i!==void 0?i:rD(y2("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&l!==void 0?l:b,this.fetchOptions=m.fetchOptions,this.maxRetries=(o=m.maxRetries)!==null&&o!==void 0?o:2,this.fetch=(d=m.fetch)!==null&&d!==void 0?d:uxe(),this.encoder=pxe,this._options=m,this.apiKey=f,this.apiVersion=p,this.clientAdapter=m.clientAdapter}withOptions(t){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),t))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:r}){if(!(t.has("authorization")||t.has("x-goog-api-key"))&&!(this.apiKey&&t.get("x-goog-api-key"))&&!r.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(t){const r=lf([t.headers]);if(!(r.values.has("authorization")||r.values.has("x-goog-api-key"))){if(this.apiKey)return lf([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return lf([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(t){return Object.entries(t).filter(([r,a])=>typeof a<"u").map(([r,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(r)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(r)}=`;throw new wi(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${sA}`}defaultIdempotencyKey(){return`stainless-node-retry-${Xhe()}`}makeStatusError(t,r,a,s){return Yn.generate(t,r,a,s)}buildURL(t,r,a){const s=!this.baseURLOverridden()&&a||this.baseURL,i=Zhe(t)?new URL(t):new URL(s+(s.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),l=this.defaultQuery();return rxe(l)||(r=Object.assign(Object.assign({},l),r)),typeof r=="object"&&r&&!Array.isArray(r)&&(i.search=this.stringifyQuery(r)),i.toString()}async prepareOptions(t){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!t.path.startsWith(`/${this.apiVersion}/projects/`)){const r=t.path.slice(this.apiVersion.length+1);t.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${r}`}}async prepareRequest(t,{url:r,options:a}){}get(t,r){return this.methodRequest("get",t,r)}post(t,r){return this.methodRequest("post",t,r)}patch(t,r){return this.methodRequest("patch",t,r)}put(t,r){return this.methodRequest("put",t,r)}delete(t,r){return this.methodRequest("delete",t,r)}methodRequest(t,r,a){return this.request(Promise.resolve(a).then(s=>Object.assign({method:t,path:r},s)))}request(t,r=null){return new Xj(this,this.makeRequest(t,r,void 0))}async makeRequest(t,r,a){var s,i,l;const o=await t,d=(s=o.maxRetries)!==null&&s!==void 0?s:this.maxRetries;r==null&&(r=d),await this.prepareOptions(o);const{req:u,url:f,timeout:p}=await this.buildRequest(o,{retryCount:d-r});await this.prepareRequest(u,{url:f,options:o});const x="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=a===void 0?"":`, retryOf: ${a}`,b=Date.now();if(Qn(this).debug(`[${x}] sending request`,md({retryOfRequestLogID:a,method:o.method,url:f,options:o,headers:u.headers})),!((i=o.signal)===null||i===void 0)&&i.aborted)throw new pC;const v=new AbortController,y=await this.fetchWithTimeout(f,u,p,v).catch(fC),k=Date.now();if(y instanceof globalThis.Error){const C=`retrying, ${r} attempts remaining`;if(!((l=o.signal)===null||l===void 0)&&l.aborted)throw new pC;const E=AC(y)||/timed? ?out/i.test(String(y)+("cause"in y?String(y.cause):""));if(r)return Qn(this).info(`[${x}] connection ${E?"timed out":"failed"} - ${C}`),Qn(this).debug(`[${x}] connection ${E?"timed out":"failed"} (${C})`,md({retryOfRequestLogID:a,url:f,durationMs:k-b,message:y.message})),this.retryRequest(o,r,a??x);throw Qn(this).info(`[${x}] connection ${E?"timed out":"failed"} - error; no more retries left`),Qn(this).debug(`[${x}] connection ${E?"timed out":"failed"} (error; no more retries left)`,md({retryOfRequestLogID:a,url:f,durationMs:k-b,message:y.message})),E?new HL:new rv({cause:y})}const _=`[${x}${m}] ${u.method} ${f} ${y.ok?"succeeded":"failed"} with status ${y.status} in ${k-b}ms`;if(!y.ok){const C=await this.shouldRetry(y);if(r&&C){const U=`retrying, ${r} attempts remaining`;return await fxe(y.body),Qn(this).info(`${_} - ${U}`),Qn(this).debug(`[${x}] response error (${U})`,md({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,durationMs:k-b})),this.retryRequest(o,r,a??x,y.headers)}const E=C?"error; no more retries left":"error; not retryable";Qn(this).info(`${_} - ${E}`);const T=await y.text().catch(U=>fC(U).message),B=sxe(T),I=B?void 0:T;throw Qn(this).debug(`[${x}] response error (${E})`,md({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,message:I,durationMs:Date.now()-b})),this.makeStatusError(y.status,B,I,y.headers)}return Qn(this).info(_),Qn(this).debug(`[${x}] response start`,md({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,durationMs:k-b})),{response:y,options:o,controller:v,requestLogID:x,retryOfRequestLogID:a,startTime:b}}async fetchWithTimeout(t,r,a,s){const i=r||{},{signal:l,method:o}=i,d=Ug(i,["signal","method"]),u=this._makeAbort(s);l&&l.addEventListener("abort",u,{once:!0});const f=setTimeout(u,a),p=globalThis.ReadableStream&&d.body instanceof globalThis.ReadableStream||typeof d.body=="object"&&d.body!==null&&Symbol.asyncIterator in d.body,x=Object.assign(Object.assign(Object.assign({signal:s.signal},p?{duplex:"half"}:{}),{method:"GET"}),d);o&&(x.method=o.toUpperCase());try{return await this.fetch.call(void 0,t,x)}finally{clearTimeout(f)}}async shouldRetry(t){const r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,r,a,s){var i;let l;const o=s==null?void 0:s.get("retry-after-ms");if(o){const u=parseFloat(o);Number.isNaN(u)||(l=u)}const d=s==null?void 0:s.get("retry-after");if(d&&!l){const u=parseFloat(d);Number.isNaN(u)?l=Date.parse(d)-Date.now():l=u*1e3}if(!(l&&0<=l&&l<60*1e3)){const u=(i=t.maxRetries)!==null&&i!==void 0?i:this.maxRetries;l=this.calculateDefaultRetryTimeoutMillis(r,u)}return await ixe(l),this.makeRequest(t,r-1,a)}calculateDefaultRetryTimeoutMillis(t,r){const i=r-t,l=Math.min(.5*Math.pow(2,i),8),o=1-Math.random()*.25;return l*o*1e3}async buildRequest(t,{retryCount:r=0}={}){var a,s,i;const l=Object.assign({},t),{method:o,path:d,query:u,defaultBaseURL:f}=l,p=this.buildURL(d,u,f);"timeout"in l&&nxe("timeout",l.timeout),l.timeout=(a=l.timeout)!==null&&a!==void 0?a:this.timeout;const{bodyHeaders:x,body:m}=this.buildBody({options:l}),b=await this.buildHeaders({options:t,method:o,bodyHeaders:x,retryCount:r});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:o,headers:b},l.signal&&{signal:l.signal}),globalThis.ReadableStream&&m instanceof globalThis.ReadableStream&&{duplex:"half"}),m&&{body:m}),(s=this.fetchOptions)!==null&&s!==void 0?s:{}),(i=l.fetchOptions)!==null&&i!==void 0?i:{}),url:p,timeout:l.timeout}}async buildHeaders({options:t,method:r,bodyHeaders:a,retryCount:s}){let i={};this.idempotencyHeader&&r!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=t.idempotencyKey);const l=await this.authHeaders(t);let o=lf([i,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s)},t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{}),dxe()),this._options.defaultHeaders,a,t.headers,l]);return this.validateHeaders(o),o.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:r}}){if(!t)return{bodyHeaders:void 0,body:void 0};const a=lf([r]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&a.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:Axe(t)}:typeof t=="object"&&a.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:this.encoder({body:t,headers:a})}}nv.DEFAULT_TIMEOUT=6e4;class nn extends nv{constructor(){super(...arguments),this.interactions=new nQ(this)}}iQ=nn;nn.GeminiNextGenAPIClient=iQ;nn.GeminiNextGenAPIClientError=wi;nn.APIError=Yn;nn.APIConnectionError=rv;nn.APIConnectionTimeoutError=HL;nn.APIUserAbortError=pC;nn.NotFoundError=GL;nn.ConflictError=KL;nn.RateLimitError=WL;nn.BadRequestError=zL;nn.AuthenticationError=$L;nn.InternalServerError=YL;nn.PermissionDeniedError=VL;nn.UnprocessableEntityError=qL;nn.toFile=bxe;nn.Interactions=nQ;/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Fxe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function Ixe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function Dxe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function Uxe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function Mxe(e,t,r){const a={};if(w(e,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const s=w(e,["tunedModelDisplayName"]);if(t!==void 0&&s!=null&&N(t,["displayName"],s),w(e,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const i=w(e,["epochCount"]);t!==void 0&&i!=null&&N(t,["tuningTask","hyperparameters","epochCount"],i);const l=w(e,["learningRateMultiplier"]);if(l!=null&&N(a,["tuningTask","hyperparameters","learningRateMultiplier"],l),w(e,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(w(e,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(w(e,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");if(w(e,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is not supported in Gemini API.");if(w(e,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is not supported in Gemini API.");const o=w(e,["batchSize"]);t!==void 0&&o!=null&&N(t,["tuningTask","hyperparameters","batchSize"],o);const d=w(e,["learningRate"]);if(t!==void 0&&d!=null&&N(t,["tuningTask","hyperparameters","learningRate"],d),w(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(w(e,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");if(w(e,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is not supported in Gemini API.");if(w(e,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is not supported in Gemini API.");if(w(e,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is not supported in Gemini API.");if(w(e,["outputUri"])!==void 0)throw new Error("outputUri parameter is not supported in Gemini API.");if(w(e,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is not supported in Gemini API.");return a}function Rxe(e,t,r){const a={};let s=w(r,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec"],w2(B))}else if(s==="PREFERENCE_TUNING"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec"],w2(B))}else if(s==="DISTILLATION"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&N(t,["distillationSpec"],w2(B))}const i=w(e,["tunedModelDisplayName"]);t!==void 0&&i!=null&&N(t,["tunedModelDisplayName"],i);const l=w(e,["description"]);t!==void 0&&l!=null&&N(t,["description"],l);let o=w(r,["config","method"]);if(o===void 0&&(o="SUPERVISED_FINE_TUNING"),o==="SUPERVISED_FINE_TUNING"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec","hyperParameters","epochCount"],B)}else if(o==="PREFERENCE_TUNING"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","epochCount"],B)}else if(o==="DISTILLATION"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&N(t,["distillationSpec","hyperParameters","epochCount"],B)}let d=w(r,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],B)}else if(d==="PREFERENCE_TUNING"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],B)}else if(d==="DISTILLATION"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&N(t,["distillationSpec","hyperParameters","learningRateMultiplier"],B)}let u=w(r,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec","exportLastCheckpointOnly"],B)}else if(u==="PREFERENCE_TUNING"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","exportLastCheckpointOnly"],B)}else if(u==="DISTILLATION"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&N(t,["distillationSpec","exportLastCheckpointOnly"],B)}let f=w(r,["config","method"]);if(f===void 0&&(f="SUPERVISED_FINE_TUNING"),f==="SUPERVISED_FINE_TUNING"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec","hyperParameters","adapterSize"],B)}else if(f==="PREFERENCE_TUNING"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","adapterSize"],B)}else if(f==="DISTILLATION"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&N(t,["distillationSpec","hyperParameters","adapterSize"],B)}let p=w(r,["config","method"]);if(p===void 0&&(p="SUPERVISED_FINE_TUNING"),p==="SUPERVISED_FINE_TUNING"){const B=w(e,["tuningMode"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec","tuningMode"],B)}const x=w(e,["customBaseModel"]);t!==void 0&&x!=null&&N(t,["customBaseModel"],x);let m=w(r,["config","method"]);if(m===void 0&&(m="SUPERVISED_FINE_TUNING"),m==="SUPERVISED_FINE_TUNING"){const B=w(e,["batchSize"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec","hyperParameters","batchSize"],B)}let b=w(r,["config","method"]);if(b===void 0&&(b="SUPERVISED_FINE_TUNING"),b==="SUPERVISED_FINE_TUNING"){const B=w(e,["learningRate"]);t!==void 0&&B!=null&&N(t,["supervisedTuningSpec","hyperParameters","learningRate"],B)}const v=w(e,["labels"]);t!==void 0&&v!=null&&N(t,["labels"],v);const y=w(e,["beta"]);t!==void 0&&y!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","beta"],y);const k=w(e,["baseTeacherModel"]);t!==void 0&&k!=null&&N(t,["distillationSpec","baseTeacherModel"],k);const _=w(e,["tunedTeacherModelSource"]);t!==void 0&&_!=null&&N(t,["distillationSpec","tunedTeacherModelSource"],_);const C=w(e,["sftLossWeightMultiplier"]);t!==void 0&&C!=null&&N(t,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],C);const E=w(e,["outputUri"]);t!==void 0&&E!=null&&N(t,["outputUri"],E);const T=w(e,["encryptionSpec"]);return t!==void 0&&T!=null&&N(t,["encryptionSpec"],T),a}function Oxe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["preTunedModel"]);s!=null&&N(r,["preTunedModel"],s);const i=w(e,["trainingDataset"]);i!=null&&Wxe(i);const l=w(e,["config"]);return l!=null&&Mxe(l,r),r}function Pxe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["preTunedModel"]);s!=null&&N(r,["preTunedModel"],s);const i=w(e,["trainingDataset"]);i!=null&&Yxe(i,r,t);const l=w(e,["config"]);return l!=null&&Rxe(l,r,t),r}function Lxe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function Qxe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function Hxe(e,t,r){const a={},s=w(e,["pageSize"]);t!==void 0&&s!=null&&N(t,["_query","pageSize"],s);const i=w(e,["pageToken"]);t!==void 0&&i!=null&&N(t,["_query","pageToken"],i);const l=w(e,["filter"]);return t!==void 0&&l!=null&&N(t,["_query","filter"],l),a}function zxe(e,t,r){const a={},s=w(e,["pageSize"]);t!==void 0&&s!=null&&N(t,["_query","pageSize"],s);const i=w(e,["pageToken"]);t!==void 0&&i!=null&&N(t,["_query","pageToken"],i);const l=w(e,["filter"]);return t!==void 0&&l!=null&&N(t,["_query","filter"],l),a}function $xe(e,t){const r={},a=w(e,["config"]);return a!=null&&Hxe(a,r),r}function Vxe(e,t){const r={},a=w(e,["config"]);return a!=null&&zxe(a,r),r}function Gxe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["tunedModels"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(o=>lQ(o))),N(r,["tuningJobs"],l)}return r}function Kxe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["tuningJobs"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(o=>mC(o))),N(r,["tuningJobs"],l)}return r}function qxe(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["model"],a);const s=w(e,["name"]);return s!=null&&N(r,["endpoint"],s),r}function Wxe(e,t){const r={};if(w(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(w(e,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const a=w(e,["examples"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),N(r,["examples","examples"],s)}return r}function Yxe(e,t,r){const a={};let s=w(r,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&N(t,["supervisedTuningSpec","trainingDatasetUri"],l)}else if(s==="PREFERENCE_TUNING"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&N(t,["preferenceOptimizationSpec","trainingDatasetUri"],l)}else if(s==="DISTILLATION"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&N(t,["distillationSpec","promptDatasetUri"],l)}let i=w(r,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&N(t,["supervisedTuningSpec","trainingDatasetUri"],l)}else if(i==="PREFERENCE_TUNING"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&N(t,["preferenceOptimizationSpec","trainingDatasetUri"],l)}else if(i==="DISTILLATION"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&N(t,["distillationSpec","promptDatasetUri"],l)}if(w(e,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return a}function lQ(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["state"]);i!=null&&N(r,["state"],NL(i));const l=w(e,["createTime"]);l!=null&&N(r,["createTime"],l);const o=w(e,["tuningTask","startTime"]);o!=null&&N(r,["startTime"],o);const d=w(e,["tuningTask","completeTime"]);d!=null&&N(r,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&N(r,["updateTime"],u);const f=w(e,["description"]);f!=null&&N(r,["description"],f);const p=w(e,["baseModel"]);p!=null&&N(r,["baseModel"],p);const x=w(e,["_self"]);return x!=null&&N(r,["tunedModel"],qxe(x)),r}function mC(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["state"]);i!=null&&N(r,["state"],NL(i));const l=w(e,["createTime"]);l!=null&&N(r,["createTime"],l);const o=w(e,["startTime"]);o!=null&&N(r,["startTime"],o);const d=w(e,["endTime"]);d!=null&&N(r,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&N(r,["updateTime"],u);const f=w(e,["error"]);f!=null&&N(r,["error"],f);const p=w(e,["description"]);p!=null&&N(r,["description"],p);const x=w(e,["baseModel"]);x!=null&&N(r,["baseModel"],x);const m=w(e,["tunedModel"]);m!=null&&N(r,["tunedModel"],m);const b=w(e,["preTunedModel"]);b!=null&&N(r,["preTunedModel"],b);const v=w(e,["supervisedTuningSpec"]);v!=null&&N(r,["supervisedTuningSpec"],v);const y=w(e,["preferenceOptimizationSpec"]);y!=null&&N(r,["preferenceOptimizationSpec"],y);const k=w(e,["distillationSpec"]);k!=null&&N(r,["distillationSpec"],k);const _=w(e,["tuningDataStats"]);_!=null&&N(r,["tuningDataStats"],_);const C=w(e,["encryptionSpec"]);C!=null&&N(r,["encryptionSpec"],C);const E=w(e,["partnerModelTuningSpec"]);E!=null&&N(r,["partnerModelTuningSpec"],E);const T=w(e,["customBaseModel"]);T!=null&&N(r,["customBaseModel"],T);const B=w(e,["experiment"]);B!=null&&N(r,["experiment"],B);const I=w(e,["labels"]);I!=null&&N(r,["labels"],I);const M=w(e,["outputUri"]);M!=null&&N(r,["outputUri"],M);const U=w(e,["pipelineJob"]);U!=null&&N(r,["pipelineJob"],U);const D=w(e,["serviceAccount"]);D!=null&&N(r,["serviceAccount"],D);const L=w(e,["tunedModelDisplayName"]);L!=null&&N(r,["tunedModelDisplayName"],L);const R=w(e,["veoTuningSpec"]);return R!=null&&N(r,["veoTuningSpec"],R),r}function Xxe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["metadata"]);i!=null&&N(r,["metadata"],i);const l=w(e,["done"]);l!=null&&N(r,["done"],l);const o=w(e,["error"]);return o!=null&&N(r,["error"],o),r}function w2(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["validationDatasetUri"],a);const s=w(e,["vertexDatasetResource"]);return s!=null&&N(r,["validationDatasetUri"],s),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Jxe extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.PAGED_ITEM_TUNING_JOBS,a=>this.listInternal(a),await this.listInternal(r),r),this.get=async r=>await this.getInternal(r),this.tune=async r=>{var a;if(this.apiClient.isVertexAI())if(r.baseModel.startsWith("projects/")){const s={tunedModelName:r.baseModel};!((a=r.config)===null||a===void 0)&&a.preTunedModelCheckpointId&&(s.checkpointId=r.config.preTunedModelCheckpointId);const i=Object.assign(Object.assign({},r),{preTunedModel:s});return i.baseModel=void 0,await this.tuneInternal(i)}else{const s=Object.assign({},r);return await this.tuneInternal(s)}else{const s=Object.assign({},r),i=await this.tuneMldevInternal(s);let l="";return i.metadata!==void 0&&i.metadata.tunedModel!==void 0?l=i.metadata.tunedModel:i.name!==void 0&&i.name.includes("/operations/")&&(l=i.name.split("/operations/")[0]),{name:l,state:nC.JOB_STATE_QUEUED}}}}async getInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Qxe(t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>mC(f))}else{const u=Lxe(t);return o=Ze("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>lQ(f))}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Vxe(t);return o=Ze("tuningJobs",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Kxe(f),x=new _3;return Object.assign(x,p),x})}else{const u=$xe(t);return o=Ze("tunedModels",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Gxe(f),x=new _3;return Object.assign(x,p),x})}}async cancel(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Ixe(t);return o=Ze("{name}:cancel",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Uxe(f),x=new T3;return Object.assign(x,p),x})}else{const u=Fxe(t);return o=Ze("{name}:cancel",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Dxe(f),x=new T3;return Object.assign(x,p),x})}}async tuneInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Pxe(t,t);return i=Ze("tuningJobs",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>mC(d))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Oxe(t);return i=Ze("tunedModels",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>Xxe(d))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Zxe{async download(t,r){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}}const eme=1024*1024*8,tme=3,rme=1e3,ame=2,Rg="x-goog-upload-status";async function nme(e,t,r){var a;const s=await oQ(e,t,r),i=await(s==null?void 0:s.json());if(((a=s==null?void 0:s.headers)===null||a===void 0?void 0:a[Rg])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return i.file}async function sme(e,t,r){var a;const s=await oQ(e,t,r),i=await(s==null?void 0:s.json());if(((a=s==null?void 0:s.headers)===null||a===void 0?void 0:a[Rg])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const l=mL(i),o=new $j;return Object.assign(o,l),o}async function oQ(e,t,r){var a,s;let i=0,l=0,o=new iC(new Response),d="upload";for(i=e.size;l<i;){const u=Math.min(eme,i-l),f=e.slice(l,l+u);l+u>=i&&(d+=", finalize");let p=0,x=rme;for(;p<tme&&(o=await r.request({path:"",body:f,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:t,headers:{"X-Goog-Upload-Command":d,"X-Goog-Upload-Offset":String(l),"Content-Length":String(u)}}}),!(!((a=o==null?void 0:o.headers)===null||a===void 0)&&a[Rg]));)p++,await lme(x),x=x*ame;if(l+=u,((s=o==null?void 0:o.headers)===null||s===void 0?void 0:s[Rg])!=="active")break;if(i<=l)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return o}async function ime(e){return{size:e.size,type:e.type}}function lme(e){return new Promise(t=>setTimeout(t,e))}class ome{async upload(t,r,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await nme(t,r,a)}async uploadToFileSearchStore(t,r,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await sme(t,r,a)}async stat(t){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await ime(t)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class cme{create(t,r,a){return new dme(t,r,a)}}class dme{constructor(t,r,a){this.url=t,this.headers=r,this.callbacks=a}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(t){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(t)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const nD="x-goog-api-key";class ume{constructor(t){this.apiKey=t}async addAuthHeaders(t,r){if(t.get(nD)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");t.append(nD,this.apiKey)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Ame="gl-node/";class fme{get interactions(){var t;if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const r=this.httpOptions;r!=null&&r.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const a=new nn({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:r==null?void 0:r.timeout,maxRetries:(t=r==null?void 0:r.retryOptions)===null||t===void 0?void 0:t.attempts});return this._interactions=a.interactions,this._interactions}constructor(t){var r;if(t.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(t.project||t.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(r=t.vertexai)!==null&&r!==void 0?r:!1,this.apiKey=t.apiKey;const a=eue(t.httpOptions,t.vertexai,void 0,void 0);a&&(t.httpOptions?t.httpOptions.baseUrl=a:t.httpOptions={baseUrl:a}),this.apiVersion=t.apiVersion,this.httpOptions=t.httpOptions;const s=new ume(this.apiKey);this.apiClient=new ihe({auth:s,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:Ame+"web",uploader:new ome,downloader:new Zxe}),this.models=new khe(this.apiClient),this.live=new bhe(this.apiClient,s,new cme),this.batches=new TAe(this.apiClient),this.chats=new A0e(this.models,this.apiClient),this.caches=new c0e(this.apiClient),this.files=new C0e(this.apiClient),this.operations=new jhe(this.apiClient),this.authTokens=new Hhe(this.apiClient),this.tunings=new Jxe(this.apiClient),this.fileSearchStores=new Yhe(this.apiClient)}}async function pme(e){try{const t=new fme({apiKey:void 0}),r=`Actúa como un Auditor Contable Senior y Arquitecto de Sistemas. 
    Analiza los siguientes datos financieros del Condominio Tejar y genera un dictamen profesional breve en formato HTML.
    Resalta hallazgos, riesgos y recomendaciones operativas.
    
    Datos: ${JSON.stringify(e)}
    
    Instrucciones de Diseño:
    1. Usa un tono experto y asertivo.
    2. Divide en secciones claras usando clases de Tailwind CSS (text-slate-800, font-black, etc).
    3. Resalta las discrepancias en rojo y los éxitos en verde esmeralda.
    4. Termina con una breve nota sobre la integridad del rastro de auditoría del sistema SAC 2026.`;return(await t.models.generateContent({model:"gemini-3-pro-preview",contents:r})).text||"<div class='p-6 text-amber-600 bg-amber-50 rounded-3xl border border-amber-200'>La IA no pudo procesar el dictamen en este momento.</div>"}catch(t){return console.error("Gemini Audit Error:",t),"<div class='p-6 text-red-600 bg-red-50 rounded-3xl border border-red-200'>Fallo crítico en el motor de IA. Verifique su conexión y cuotas de API.</div>"}}const ya=e=>e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),hme=({user:e})=>{const{fees:t,pendingBills:r,transactions:a,refreshData:s,loading:i,financialTotals:l}=ht(),[o,d]=j.useState(new Date().getMonth()),[u,f]=j.useState(new Date().getFullYear()),[p,x]=j.useState(null),[m,b]=j.useState(!1);j.useEffect(()=>{s()},[]);const v=j.useMemo(()=>{let _=0,C=0,E=0;t.forEach(M=>{M.month===o&&M.year===u&&(M.debts||[]).forEach(U=>{(U.payments||[]).forEach(D=>{const L=Number(D.amount)||0;_+=L;const R=(D.method||"").toLowerCase();R.includes("efectivo")||R.includes("divisa")?E+=L:C+=L})})}),a.forEach(M=>{const U=(M.description||"").toUpperCase();if(M.type==="Ingreso"&&(U.includes("RECUPERACIÓN DEUDA HISTÓRICA")||U.includes("RECUPERACIÓN DEUDA ANTERIOR"))){const[D,L]=M.date.split("-").map(Number);if(D===u&&L-1===o){const R=Number(M.amount)||0;_+=R,U.includes("(EFECTIVO/CAJA)")?E+=R:C+=R}}});let T=0,B=0;a.forEach(M=>{if(M.type==="Egreso"){const[U,D]=M.date.split("-").map(Number);U===u&&D-1===o&&(T+=Number(M.amount)||0)}}),r.forEach(M=>{if(M.status==="Pagado"&&M.paidDate&&(M.paymentSource||"").toLowerCase()==="efectivo"){const[U,D]=M.paidDate.split("-").map(Number);U===u&&D-1===o&&(B+=Number(M.amount)||0)}});const I=T+B;return{ingresos:{total:_,banco:C,oficina:E},egresos:{total:I,banco:T,oficina:B},cajaChica:{anterior:(l==null?void 0:l.initialCashUsd)||0,ingresos:E,egresos:B,final:(l==null?void 0:l.initialCashUsd)||0}}},[o,u,t,r,a,l]),y=async()=>{b(!0);try{const _=await pme({periodo:`${Ue[o]} ${u}`,conciliacion_ingresos:v.ingresos,conciliacion_egresos:v.egresos,caja_chica:v.cajaChica,disponibilidad_efectivo_usd:(l==null?void 0:l.initialCashUsd)||0});x(_)}catch{alert("Error al conectar con el servicio de IA.")}finally{b(!1)}},k=()=>{const _=`
        <!DOCTYPE html>
        <html lang="es">
        <head>
            <meta charset="UTF-8">
            <title>Auditoría Financiera - ${Ue[o]} ${u}</title>
            <style>
                body { font-family: Arial, sans-serif; padding: 40px; line-height: 1.6; color: #1e293b; }
                .header { background: #0A2647; color: white; padding: 30px; border-radius: 10px; margin-bottom: 30px; }
                h1 { margin: 0; font-size: 24px; }
                .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }
                .card { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
                .card-header { background: #5B9BD5; color: white; padding: 10px; text-align: center; font-weight: bold; }
                .card-body { padding: 20px; }
                .row { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid #f1f5f9; padding-bottom: 5px; }
                .total { font-weight: bold; font-size: 18px; color: #2563eb; }
                .caja-chica { background: #f1f5f9; padding: 30px; border-radius: 10px; }
                .footer { margin-top: 50px; text-align: center; font-size: 12px; color: #64748b; }
            </style>
        </head>
        <body>
            <div class="header">
                <h1>AUDITORÍA FINANCIERA - ${Ue[o]} ${u}</h1>
                <p>Condominio Residencial El Tejar | SAC 2026</p>
            </div>

            <div class="grid">
                <div class="card">
                    <div class="card-header">INGRESOS</div>
                    <div class="card-body">
                        <div class="row total"><span>Total Cobranza:</span><span>$${ya(v.ingresos.total)}</span></div>
                        <div class="row"><span>Banco:</span><span>$${ya(v.ingresos.banco)}</span></div>
                        <div class="row"><span>Oficina:</span><span>$${ya(v.ingresos.oficina)}</span></div>
                    </div>
                </div>
                <div class="card">
                    <div class="card-header">EGRESOS</div>
                    <div class="card-body">
                        <div class="row total"><span>Total Egresos:</span><span>$${ya(v.egresos.total)}</span></div>
                        <div class="row"><span>Banco:</span><span>$${ya(v.egresos.banco)}</span></div>
                        <div class="row"><span>Oficina:</span><span>$${ya(v.egresos.oficina)}</span></div>
                    </div>
                </div>
            </div>

            <div class="caja-chica">
                <h2 style="text-align:center; font-size: 16px; margin-bottom: 20px;">BALANCE DE CAJA CHICA</h2>
                <div class="row"><span>Saldo Inicial:</span><span>$${ya(v.cajaChica.anterior)}</span></div>
                <div class="row" style="color: #059669;"><span>(+) Ingresos Efectivo:</span><span>$${ya(v.cajaChica.ingresos)}</span></div>
                <div class="row" style="color: #dc2626;"><span>(-) Egresos Efectivo:</span><span>$${ya(v.cajaChica.egresos)}</span></div>
                <div class="row" style="font-weight:bold; font-size: 20px; margin-top: 10px; border-top: 2px solid #cbd5e1; padding-top: 10px;">
                    <span>SALDO FINAL:</span><span>$${ya(v.cajaChica.final)}</span>
                </div>
            </div>

            <div class="footer">
                Reporte generado por SAC Kernel V5.6 el ${new Date().toLocaleString()}
            </div>
        </body>
        </html>
    `,C=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(C),T=document.createElement("a");T.href=E,T.download=`Auditoria_${Ue[o]}_${u}.html`,T.click(),URL.revokeObjectURL(E)};return n.jsxs("div",{className:"min-h-screen bg-[#F5F5F5] font-sans pb-20",children:[n.jsxs("div",{className:"max-w-[900px] mx-auto mb-6 flex flex-col md:flex-row justify-between items-center pt-8 gap-4 px-4 no-print",children:[n.jsxs("div",{className:"flex gap-2 bg-white p-2 rounded-2xl border border-slate-200 shadow-sm w-full md:w-auto",children:[n.jsx("select",{value:o,onChange:_=>d(Number(_.target.value)),className:"bg-transparent border-none text-[11px] font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((_,C)=>n.jsx("option",{value:C,children:_},C))}),n.jsx("div",{className:"w-px h-4 bg-slate-200 self-center"}),n.jsx("input",{type:"number",value:u,onChange:_=>f(Number(_.target.value)),className:"bg-transparent border-none text-[11px] font-black text-blue-600 outline-none w-16 text-center"})]}),n.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[n.jsxs("button",{onClick:k,className:"flex-1 md:flex-none bg-blue-600 text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-blue-700 shadow-sm",children:[n.jsx(Jd,{size:16})," HTML"]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 md:flex-none bg-white border border-slate-200 text-slate-600 px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-slate-50 shadow-sm",children:[n.jsx(yt,{size:16})," Imprimir"]}),n.jsxs("button",{onClick:y,disabled:m,className:"flex-1 md:flex-none bg-[#0A2647] text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center justify-center gap-2 shadow-lg active:scale-95 disabled:opacity-50",children:[m?n.jsx(ot,{className:"animate-spin",size:16}):n.jsx(V_,{size:16}),"Auditoría IA"]})]})]}),n.jsxs("div",{className:`max-w-[900px] mx-auto bg-white shadow-2xl rounded-sm overflow-hidden flex flex-col min-h-[900px] print:shadow-none print:m-0 print:w-full ${p?"no-print":""}`,id:"printable-audit",children:[n.jsxs("div",{className:"bg-[#0A2647] p-10 flex justify-between items-center text-white border-b-4 border-[#2563eb]",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-white rounded-full flex items-center justify-center border-4 border-[#2563eb] shadow-xl",children:n.jsx("span",{className:"text-[#0A2647] font-black text-2xl italic tracking-tighter",children:"TM"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black tracking-tighter leading-none uppercase",children:"AUDITORÍA FINANCIERA V5.6"}),n.jsx("p",{className:"text-[11px] font-bold text-blue-400 uppercase tracking-[0.3em] mt-1",children:"SISTEMA ADMINISTRATIVO SAC 2026"})]})]}),n.jsxs("div",{className:"text-right border-l border-white/10 pl-8",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Periodo Fiscal"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter uppercase",children:[Ue[o]," ",u]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white border-2 border-slate-100 rounded-2xl overflow-hidden shadow-sm flex flex-col",children:[n.jsxs("div",{className:"bg-[#5B9BD5] p-3 text-center text-white flex items-center justify-center gap-2",children:[n.jsx(ha,{size:16}),n.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest",children:"Conciliación de Ingresos"})]}),n.jsxs("div",{className:"p-8 flex-1 space-y-5",children:[n.jsxs("div",{className:"flex justify-between items-center border-b pb-2",children:[n.jsx("span",{className:"text-xs font-black text-slate-800 uppercase",children:"Cobranza Consolidada:"}),n.jsxs("span",{className:"text-lg font-black text-blue-600",children:["$",ya(v.ingresos.total)]})]}),n.jsxs("div",{className:"space-y-2 pl-4 border-l-2 border-slate-100",children:[n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Banco (Transferencias):"}),n.jsxs("span",{children:["$",ya(v.ingresos.banco)]})]}),n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Oficina (Efectivo):"}),n.jsxs("span",{children:["$",ya(v.ingresos.oficina)]})]})]})]}),n.jsxs("div",{className:"p-4 bg-slate-50 border-t flex justify-between items-center px-8",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest",children:"ESTADO:"}),n.jsxs("div",{className:"flex items-center gap-1.5 text-emerald-600 font-black text-[10px] uppercase",children:["VERIFICADO ",n.jsx(K_,{size:14})]})]})]}),n.jsxs("div",{className:"bg-white border-2 border-slate-100 rounded-2xl overflow-hidden shadow-sm flex flex-col",children:[n.jsxs("div",{className:"bg-[#5B9BD5] p-3 text-center text-white flex items-center justify-center gap-2",children:[n.jsx(db,{size:16}),n.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest",children:"Conciliación de Egresos"})]}),n.jsxs("div",{className:"p-8 flex-1 space-y-5",children:[n.jsxs("div",{className:"flex justify-between items-center border-b pb-2",children:[n.jsx("span",{className:"text-xs font-black text-slate-800 uppercase",children:"Egresos Consolidados:"}),n.jsxs("span",{className:"text-lg font-black text-rose-600",children:["$",ya(v.egresos.total)]})]}),n.jsxs("div",{className:"space-y-2 pl-4 border-l-2 border-slate-100",children:[n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Banco (Libro Diario):"}),n.jsxs("span",{children:["$",ya(v.egresos.banco)]})]}),n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Oficina (Facturas):"}),n.jsxs("span",{children:["$",ya(v.egresos.oficina)]})]})]})]}),n.jsxs("div",{className:"p-4 bg-slate-50 border-t flex justify-between items-center px-8",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest",children:"ESTADO:"}),n.jsxs("div",{className:"flex items-center gap-1.5 text-emerald-600 font-black text-[10px] uppercase",children:["VERIFICADO ",n.jsx(K_,{size:14})]})]})]})]}),n.jsxs("div",{className:"max-w-[700px] mx-auto bg-[#ECECEC] border-2 border-slate-200 rounded-sm overflow-hidden shadow-lg mt-10",children:[n.jsxs("div",{className:"bg-[#0A2647] py-3 text-center text-white flex items-center justify-center gap-3",children:[n.jsx(xr,{size:18}),n.jsx("span",{className:"text-[12px] font-black uppercase tracking-[0.3em]",children:"Balance de Caja Chica (Efectivo)"})]}),n.jsxs("div",{className:"p-10 space-y-8 font-mono",children:[n.jsxs("div",{className:"flex justify-between items-center text-slate-600 border-b border-slate-300 pb-4",children:[n.jsx("span",{className:"text-xs font-black uppercase",children:"SALDO INICIAL"}),n.jsxs("span",{className:"text-xl font-black text-slate-800",children:["$",ya(v.cajaChica.anterior)]})]}),n.jsxs("div",{className:"flex justify-between items-center text-emerald-600",children:[n.jsx("span",{className:"text-xs font-black uppercase",children:"(+) COBRANZA EFECTIVO"}),n.jsxs("span",{className:"text-xl font-black",children:["$",ya(v.cajaChica.ingresos)]})]}),n.jsxs("div",{className:"flex justify-between items-center text-red-600 border-b border-slate-300 pb-4",children:[n.jsx("span",{className:"text-xs font-black uppercase",children:"(-) PAGOS EFECTIVO"}),n.jsxs("span",{className:"text-xl font-black",children:["$",ya(v.cajaChica.egresos)]})]}),n.jsxs("div",{className:"pt-4 flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-black text-slate-900 uppercase",children:"SALDO EN EFECTIVO"}),n.jsxs("span",{className:"text-3xl font-black text-slate-900",children:["$",ya(v.cajaChica.final)]})]})]})]}),n.jsx("div",{className:"pt-10 border-t border-slate-200 text-center",children:n.jsxs("div",{className:"inline-flex items-center gap-3 px-8 py-3 bg-blue-50 text-blue-700 rounded-full border border-blue-100",children:[n.jsx(Ea,{size:24}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Certificación de integridad Kernel V4.0.86 - 100% Auditado"})]})})]}),n.jsxs("div",{className:"bg-[#1a1a1a] p-8 flex justify-between items-center text-white/60",children:[n.jsx("div",{className:"text-xs font-black uppercase tracking-widest",children:"TecnoMath SAC 2026"}),n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-widest",children:"Arquitecto: Andres Mathison • Cod: 4.0.86-PRO"})]})]}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] w-full max-w-4xl h-[90vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95",children:[n.jsxs("div",{className:"p-8 border-b flex justify-between items-center bg-slate-50 no-print",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center text-white",children:n.jsx(V_,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight",children:"Dictamen Gemini AI"}),n.jsx("p",{className:"text-[10px] text-blue-600 font-black uppercase tracking-widest",children:"Análisis Robótico de Auditoría"})]})]}),n.jsx("button",{onClick:()=>x(null),className:"p-3 bg-slate-900 text-white rounded-xl",children:n.jsx(ft,{size:20})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-12 bg-white prose prose-slate max-w-none custom-scrollbar",dangerouslySetInnerHTML:{__html:p}})]})})]})},xme=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(!1),[o,d]=j.useState(null),[u,f]=j.useState(""),[p,x]=j.useState({type:"Casa",status:"Ocupada",aliquot:0,hasUncommonExpense:!1,creditBalance:0,initialDebt:0}),m=["admin","programmer","board"].includes(e.role),b=async()=>{s(!0);try{const E=await we.getProperties();r(E)}catch(E){console.error(E)}finally{s(!1)}};j.useEffect(()=>{b()},[]);const v=E=>{E?(d(E),x(E)):(d(null),x({type:"Casa",status:"Ocupada",aliquot:0,code:"",towerBlock:"",floor:"",number:"",hasUncommonExpense:!1,creditBalance:0,initialDebt:0})),l(!0)},y=async E=>{if(confirm("¿Desea eliminar este registro?"))try{await we.deleteProperty(E),b()}catch{alert("Error")}},k=async E=>{E.preventDefault();try{await we.saveProperty(p),l(!1),b()}catch{alert("Error")}},_=()=>{if(t.length===0)return;const E=`codigo,tipo,numero,alicuota,es_gnc,deuda_inicial,saldo_favor,estatus
`,T=t.map(D=>[D.code,D.type,D.number,D.aliquot,D.hasUncommonExpense?1:0,D.initialDebt,D.creditBalance,D.status]),B=E+T.map(D=>D.join(",")).join(`
`),I=new Blob([B],{type:"text/csv;charset=utf-8;"}),M=URL.createObjectURL(I),U=document.createElement("a");U.setAttribute("href",M),U.setAttribute("download","sac_propiedades_mirror.csv"),document.body.appendChild(U),U.click(),document.body.removeChild(U)},C=t.filter(E=>E.code.toLowerCase().includes(u.toLowerCase())||E.number.toLowerCase().includes(u.toLowerCase()));return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Catálogo de Unidades"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Gestión de alícuotas y estatus habitacional."})]}),n.jsx("div",{className:"flex gap-3 w-full sm:w-auto",children:m&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:_,className:"flex-1 sm:flex-none bg-emerald-600 hover:bg-emerald-700 text-white px-6 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-emerald-500/20 transition-all active:scale-95 gap-2 text-xs uppercase tracking-widest",title:"Exportar archivo mirror para Carga Masiva",children:[n.jsx(Yi,{size:18})," CSV"]}),n.jsxs("button",{onClick:()=>v(),className:"flex-[2] sm:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-blue-500/20 transition-all active:scale-95",children:[n.jsx(Cn,{className:"w-5 h-5 mr-2"}),"Nueva Unidad"]})]})})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-6 lg:p-8 border-b border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6",children:[n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar unidad por código...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none transition-all font-bold text-slate-800",value:u,onChange:E=>f(E.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-black text-slate-400 uppercase tracking-widest bg-slate-50 px-5 py-2 rounded-full",children:["TOTAL REGISTRADO: ",t.length]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Código"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Alícuota"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Saldos"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Estado"}),m&&n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsxs("td",{colSpan:6,className:"px-8 py-20 text-center",children:[n.jsx(Vi,{className:"w-10 h-10 text-blue-600 animate-spin mx-auto mb-4"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Consultando servidor..."})]})}):C.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"px-8 py-20 text-center text-slate-400 font-medium italic",children:"No se encontraron registros."})}):C.map(E=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:E.code}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-slate-700 font-bold text-sm",children:[E.type," ",E.number]}),E.hasUncommonExpense&&n.jsx("span",{className:"bg-indigo-50 text-indigo-600 p-1 rounded-md",title:"Gasto No Común",children:n.jsx(Lc,{size:12,fill:"currentColor"})})]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("span",{className:"font-mono text-blue-600 font-black",children:[E.aliquot,"%"]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex flex-col gap-1",children:[Number(E.initialDebt)>0&&n.jsxs("span",{className:"text-[10px] font-black text-red-500 uppercase tracking-tighter",children:["Debe: $",Number(E.initialDebt).toFixed(2)]}),Number(E.creditBalance)>0&&n.jsxs("span",{className:"text-[10px] font-black text-blue-600 uppercase tracking-tighter",children:["Favor: $",Number(E.creditBalance).toFixed(2)]}),Number(E.initialDebt)===0&&Number(E.creditBalance)===0&&n.jsx("span",{className:"text-slate-300 text-xs",children:"-"})]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest border ${E.status==="Ocupada"?"bg-blue-50 text-blue-600 border-blue-100":E.status==="Vacía"?"bg-slate-100 text-slate-500 border-slate-200":"bg-red-50 text-red-600 border-red-100"}`,children:E.status})}),m&&n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2 opacity-10 lg:opacity-0 lg:group-hover:opacity-100 transition-opacity",children:[n.jsx("button",{onClick:()=>v(E),className:"p-2.5 bg-slate-100 hover:bg-blue-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(vl,{size:18})}),n.jsx("button",{onClick:()=>y(E.id),className:"p-2.5 bg-slate-100 hover:bg-red-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(Ta,{size:18})})]})})]},E.id))})]})})]}),i&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-md flex items-center justify-center z-[100] p-0 sm:p-4",children:n.jsxs("div",{className:"bg-white rounded-none sm:rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl overflow-y-auto h-full sm:h-auto max-h-screen sm:max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-blue-200",children:n.jsx(Gr,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:o?"Editar Unidad":"Nueva Unidad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Complete los parámetros técnicos."})]})]}),n.jsx("button",{onClick:()=>l(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-slate-200 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:k,className:"space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Código Identificador"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:p.code,onChange:E=>x({...p,code:E.target.value}),placeholder:"Ej: PH-1"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tipo de Inmueble"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold appearance-none",value:p.type,onChange:E=>x({...p,type:E.target.value}),children:[n.jsx("option",{value:"Apartamento",children:"Apartamento"}),n.jsx("option",{value:"Casa",children:"Casa"}),n.jsx("option",{value:"Local",children:"Local"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Número / Apt"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:p.number,onChange:E=>x({...p,number:E.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Alícuota (%)"}),n.jsx("input",{required:!0,type:"number",step:"0.000001",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:p.aliquot,onChange:E=>x({...p,aliquot:parseFloat(E.target.value)})})]}),n.jsxs("div",{className:"md:col-span-2 bg-slate-50 p-8 rounded-[2rem] border border-slate-100 space-y-6",children:[n.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-3 text-sm uppercase tracking-tight",children:[n.jsx(Tc,{className:"w-5 h-5 text-blue-600"})," Gestión de Saldos Migrados"]}),n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black text-red-500 uppercase tracking-widest",children:"Deuda Anterior ($)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-slate-200 rounded-xl px-5 py-3 text-red-600 font-bold outline-none focus:border-red-500",value:p.initialDebt,onChange:E=>x({...p,initialDebt:parseFloat(E.target.value)})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest",children:"Saldo a Favor ($)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-slate-200 rounded-xl px-5 py-3 text-blue-600 font-bold outline-none focus:border-blue-500",value:p.creditBalance,onChange:E=>x({...p,creditBalance:parseFloat(E.target.value)})})]})]})]}),n.jsx("div",{className:"md:col-span-2",children:n.jsxs("label",{className:`flex items-center gap-4 p-6 rounded-[2rem] border transition-all cursor-pointer ${p.hasUncommonExpense?"bg-indigo-50 border-indigo-200":"bg-slate-50 border-slate-200 hover:bg-slate-100"}`,children:[n.jsx("input",{type:"checkbox",className:"w-6 h-6 rounded-lg text-indigo-600 focus:ring-indigo-500 border-slate-300",checked:p.hasUncommonExpense||!1,onChange:E=>x({...p,hasUncommonExpense:E.target.checked})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-sm font-black text-slate-900 block",children:"Aplicar Gasto No Común"}),n.jsx("span",{className:"text-[10px] text-slate-500 font-bold uppercase tracking-widest",children:"Cuotas especiales para servicios exclusivos."})]})]})})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>l(!1),className:"order-2 sm:order-1 flex-1 px-8 py-5 bg-slate-100 hover:bg-slate-200 text-slate-600 font-black rounded-2xl transition-all",children:"Descartar"}),n.jsxs("button",{type:"submit",className:"order-1 sm:order-2 flex-[2] bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-2xl font-black shadow-xl shadow-blue-600/20 flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(qn,{size:20})," GUARDAR CONFIGURACIÓN"]})]})]})]})})]})},mme=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState([]),[i,l]=j.useState([]),[o,d]=j.useState(!0),[u,f]=j.useState(!1),[p,x]=j.useState(null),[m,b]=j.useState(null),[v,y]=j.useState(""),[k,_]=j.useState(""),[C,E]=j.useState(0),[T,B]=j.useState(""),[I,M]=j.useState(!1),U=["programmer","admin"].includes(e.role),D=async()=>{d(!0);try{const[W,z,Z]=await Promise.all([we.getResidents(),we.getProperties(),we.getUsers()]);r(W),s(z),l(Z),z.length>0&&E(z[0].id)}catch(W){console.error(W)}finally{d(!1)}};j.useEffect(()=>{D()},[]);const L=W=>{var z;W?(x(W),y(W.cedula),_(W.fullName),b(null),B(W.phone),E(W.propertyId),M(W.isOwner)):(x(null),b(null),y(""),_(""),B(""),E(((z=a[0])==null?void 0:z.id)||0),M(!1)),f(!0)},R=W=>{const z=Number(W),Z=i.find(Y=>Y.id===z);Z?(b(z),y(Z.cedula||"S/C"),_(Z.fullName),B(Z.phone||""),Z.role==="owner"&&M(!0)):(b(null),y(""),_(""),B(""))},Q=async W=>{if(confirm("¿Desea desvincular a este residente?"))try{await we.deleteResident(W),D()}catch{alert("Error al eliminar")}},G=async W=>{W.preventDefault();try{if(p)await we.saveResident({id:p.id,propertyId:C,phone:T,isOwner:I});else{if(!m){alert("Debe seleccionar un usuario válido.");return}await we.saveResident({userId:m,propertyId:C,phone:T,isOwner:I})}f(!1),D()}catch(z){alert(z.message||"Error al guardar asignación")}},K=i.filter(W=>W.cedula&&W.cedula.length>0);return o?n.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-4 border-blue-100 border-t-blue-600 rounded-full animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Cargando Residentes..."})]}):n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Gestión de Residentes"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Asignación de propietarios e inquilinos a unidades."})]}),U&&n.jsxs("button",{onClick:()=>L(),className:"w-full md:w-auto bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-blue-500/20 transition-all active:scale-95",children:[n.jsx(oN,{className:"w-5 h-5 mr-2"}),"Asignar Residente"]})]}),n.jsx("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Residente"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Cédula"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Propiedad"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Teléfono"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Rol"}),U&&n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:t.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"px-8 py-20 text-center text-slate-400 font-medium italic",children:"No hay residentes asignados."})}):t.map(W=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:W.fullName}),n.jsx("td",{className:"px-8 py-6 text-slate-500 font-medium",children:W.cedula}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("span",{className:"text-slate-700 font-bold text-sm",children:[W.propertyType," ",W.propertyNumber," (",W.propertyCode,")"]})}),n.jsx("td",{className:"px-8 py-6 text-slate-500",children:W.phone}),n.jsx("td",{className:"px-8 py-6",children:W.isOwner?n.jsx("span",{className:"px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest bg-emerald-50 text-emerald-600 border border-emerald-100",children:"Propietario"}):n.jsx("span",{className:"px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest bg-slate-100 text-slate-500 border border-slate-200",children:"Inquilino"})}),U&&n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2 opacity-100 lg:opacity-0 lg:group-hover:opacity-100 transition-opacity",children:[n.jsx("button",{onClick:()=>L(W),className:"p-2.5 bg-slate-100 hover:bg-blue-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(vl,{size:18})}),n.jsx("button",{onClick:()=>Q(W.id),className:"p-2.5 bg-slate-100 hover:bg-red-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(GK,{size:18})})]})})]},W.id))})]})})}),u&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-md flex items-center justify-center z-[100] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl overflow-y-auto max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-blue-200",children:n.jsx(oN,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:p?"Editar Asignación":"Nueva Asignación"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Vincule un usuario a una unidad inmobiliaria."})]})]}),n.jsx("button",{onClick:()=>f(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-slate-200 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:G,className:"space-y-8",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100",children:[n.jsxs("h4",{className:"text-xs font-black text-blue-600 mb-4 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(jA,{className:"w-4 h-4"})," 1. Selección de Usuario"]}),p?n.jsxs("div",{className:"mb-6 p-4 bg-blue-600 text-white rounded-2xl shadow-lg shadow-blue-200",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-70",children:"Residente Actual"}),n.jsx("p",{className:"text-lg font-black",children:k}),n.jsxs("p",{className:"text-xs font-bold opacity-80",children:["C.I: ",v]})]}):n.jsxs("div",{className:"mb-6",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Buscar Usuario del Sistema"}),n.jsxs("div",{className:"relative",children:[n.jsxs("select",{required:!0,className:"w-full bg-white border border-slate-200 rounded-2xl px-10 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold appearance-none",onChange:W=>R(W.target.value),defaultValue:"",children:[n.jsx("option",{value:"",disabled:!0,children:"-- Seleccione por Cédula / Nombre --"}),K.map(W=>n.jsxs("option",{value:W.id,children:[W.cedula," - ",W.fullName]},W.id))]}),n.jsx(Xt,{className:"w-4 h-4 text-slate-400 absolute left-4 top-1/2 -translate-y-1/2"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Nombre"}),n.jsx("input",{disabled:!0,type:"text",className:"w-full bg-slate-100 border border-slate-200 rounded-xl px-4 py-3 text-sm text-slate-500 font-bold",value:k})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Documento"}),n.jsx("input",{disabled:!0,type:"text",className:"w-full bg-slate-100 border border-slate-200 rounded-xl px-4 py-3 text-sm text-slate-500 font-bold",value:v})]})]})]}),n.jsxs("div",{className:"bg-emerald-50 p-6 rounded-[2rem] border border-emerald-100",children:[n.jsxs("h4",{className:"text-xs font-black text-emerald-600 mb-4 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(pG,{className:"w-4 h-4"})," 2. Datos de Residencia"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Propiedad Asignada"}),n.jsx("select",{className:"w-full bg-white border border-slate-200 rounded-2xl px-5 py-4 focus:ring-2 focus:ring-emerald-500 outline-none text-slate-900 font-bold appearance-none",value:C,onChange:W=>E(Number(W.target.value)),children:a.map(W=>n.jsxs("option",{value:W.id,children:[W.type," ",W.number," - ",W.code]},W.id))})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Teléfono de Contacto"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-2xl px-5 py-4 focus:ring-2 focus:ring-emerald-500 outline-none text-slate-900 font-bold",value:T,onChange:W=>B(W.target.value)})]}),n.jsxs("div",{className:"md:col-span-2 pt-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-4 block",children:"Rol del Usuario en esta Propiedad"}),n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("label",{className:`flex-1 flex items-center justify-center gap-3 p-4 rounded-2xl border transition-all cursor-pointer ${I?"bg-emerald-600 text-white border-emerald-600 shadow-lg shadow-emerald-200":"bg-white text-slate-500 border-slate-200"}`,children:[n.jsx("input",{type:"radio",className:"hidden",name:"role",checked:I,onChange:()=>M(!0)}),n.jsx("span",{className:"text-sm font-black uppercase tracking-widest",children:"Propietario"})]}),n.jsxs("label",{className:`flex-1 flex items-center justify-center gap-3 p-4 rounded-2xl border transition-all cursor-pointer ${I?"bg-white text-slate-500 border-slate-200":"bg-blue-600 text-white border-blue-600 shadow-lg shadow-blue-200"}`,children:[n.jsx("input",{type:"radio",className:"hidden",name:"role",checked:!I,onChange:()=>M(!1)}),n.jsx("span",{className:"text-sm font-black uppercase tracking-widest",children:"Inquilino"})]})]})]})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>f(!1),className:"order-2 sm:order-1 flex-1 px-8 py-5 bg-slate-100 hover:bg-slate-200 text-slate-600 font-black rounded-2xl transition-all",children:"Cancelar"}),n.jsxs("button",{type:"submit",className:"order-1 sm:order-2 flex-[2] bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-2xl font-black shadow-xl shadow-blue-600/20 flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(qn,{size:20})," ",p?"ACTUALIZAR ASIGNACIÓN":"CONFIRMAR ASIGNACIÓN"]})]})]})]})})]})},gme=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(!1),[o,d]=j.useState(""),[u,f]=j.useState(null),[p,x]=j.useState(null),[m,b]=j.useState(""),[v,y]=j.useState(""),[k,_]=j.useState(""),[C,E]=j.useState(""),[T,B]=j.useState(""),[I,M]=j.useState(""),[U,D]=j.useState(""),[L,R]=j.useState("owner"),[Q,G]=j.useState(""),[K,W]=j.useState("Activo"),[z,Z]=j.useState(null),Y=async()=>{s(!0);try{const oe=await we.getUsers();r(oe)}catch(oe){console.error(oe)}finally{s(!1)}};j.useEffect(()=>{Y()},[]);const te=async oe=>{f(oe);try{const ne=await(await we.sendWelcomeEmail(oe)).json();ne.status==="success"?alert(`¡ENVÍO EXITOSO!
`+(ne.message||"Las credenciales han sido enviadas.")):alert(`ERROR EN EL ENVÍO:
`+(ne.message||ne.error||"No se pudo procesar la solicitud."))}catch(ce){alert(`FALLO DE CONEXIÓN:
`+(ce.message||"No se pudo contactar con el motor de correos."))}finally{f(null)}},O=async oe=>{const ce=prompt("Indique los días de duración para este periodo Demo (1-10):","3");if(ce===null)return;const ne=parseInt(ce);if(isNaN(ne)||ne<1||ne>10){alert("Valor inválido. Ingrese un número entre 1 y 10.");return}x(oe.id);try{(await fetch(`${ye}/save_user.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...oe,role:"demo",activate_demo_days:ne,status:"active"})})).ok?(alert(`Periodo Demo activado por ${ne} días exitosamente.`),Y()):alert("Error al activar demo en el servidor.")}catch{alert("Fallo de red.")}finally{x(null)}},P=()=>{if(t.length===0)return;const oe=`cedula,nombre_completo,correo,telefono,rol,telegram_id
`,ce=t.map(pe=>[pe.cedula||pe.username,pe.fullName,pe.email,pe.phone,pe.role,pe.telegramChatId||""]),ne=oe+ce.map(pe=>pe.join(",")).join(`
`),le=new Blob([ne],{type:"text/csv;charset=utf-8;"}),ge=URL.createObjectURL(le),X=document.createElement("a");X.setAttribute("href",ge),X.setAttribute("download","sac_usuarios_mirror.csv"),document.body.appendChild(X),X.click(),document.body.removeChild(X)};if(e.role!=="programmer"&&e.role!=="admin")return n.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh] px-4",children:n.jsxs("div",{className:"bg-red-50 border border-red-100 p-10 rounded-[3rem] text-center max-w-lg shadow-xl",children:[n.jsx("div",{className:"w-20 h-20 bg-red-500 rounded-3xl flex items-center justify-center text-white mx-auto mb-6 shadow-xl shadow-red-200",children:n.jsx(hs,{size:40})}),n.jsx("h3",{className:"text-2xl font-black text-red-700 tracking-tight mb-2",children:"Acceso Restringido"}),n.jsx("p",{className:"text-red-600/70 font-medium",children:"Módulo exclusivo para el Personal Administrativo."})]})});const q=oe=>{if(oe){Z(oe.id);const ce=(oe.fullName||"").split(" ");b(ce[0]||""),y(ce.slice(1).join(" ")||""),_(oe.cedula||oe.username),E(oe.phone||""),B(oe.email||""),M(oe.telegramChatId||""),D(""),R(oe.role),G(oe.relationship||""),W(oe.status==="Activo"||oe.status==="active"?"Activo":"Inactivo")}else Z(null),b(""),y(""),_(""),E(""),B(""),M(""),D(""),R("owner"),G(""),W("Activo");l(!0)},H=async oe=>{if(oe===e.id)return alert("No puedes eliminar tu propia cuenta en sesión.");if(confirm("¿Desea eliminar este usuario permanentemente?"))try{await we.deleteUser(oe),Y()}catch{alert("Error al eliminar")}},J=async oe=>{oe.preventDefault();const ce=`${m} ${v}`.trim(),ne={id:z,username:k,fullName:ce,cedula:k,phone:C,email:T,telegramChatId:I,password:U||void 0,role:L,relationship:Q,status:K==="Activo"?"active":"inactive"};try{await we.saveUser(ne),l(!1),Y(),alert("Usuario guardado con éxito.")}catch(le){alert(le.message||"Error al guardar usuario")}},ae=t.filter(oe=>(oe.fullName||"").toLowerCase().includes(o.toLowerCase())||(oe.cedula||"").toLowerCase().includes(o.toLowerCase()));return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Gestión de Usuarios"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Control maestro de credenciales y notificaciones."})]}),n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsxs("button",{onClick:P,className:"flex-1 md:flex-none bg-emerald-600 hover:bg-emerald-700 text-white px-6 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-emerald-500/20 transition-all active:scale-95 gap-2 text-xs uppercase tracking-widest",title:"Exportar archivo mirror para Carga Masiva",children:[n.jsx(Yi,{size:18})," CSV"]}),n.jsxs("button",{onClick:()=>q(),className:"flex-[2] md:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl transition-all active:scale-95",children:[n.jsx(oN,{className:"w-5 h-5 mr-2"}),"Nuevo Usuario"]})]})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsx("div",{className:"p-6 lg:p-8 border-b border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6",children:n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por nombre o cédula...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-bold",value:o,onChange:oe=>d(oe.target.value)})]})}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Nombre Completo"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Usuario / C.I"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Rol"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones Maestras"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:ae.map(oe=>{const ce=oe.role==="demo"&&oe.expiresAt&&new Date(oe.expiresAt)<new Date;return n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-colors group ${ce?"opacity-60 bg-red-50/20":""}`,children:[n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center font-black text-xs ${oe.role==="programmer"?"bg-blue-600 text-white":"bg-slate-100 text-slate-500"}`,children:(oe.fullName||"?")[0]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900",children:oe.fullName||"Sin Nombre"}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:oe.email||"Sin Email"})]})]})}),n.jsx("td",{className:"px-8 py-6 text-slate-500 font-bold",children:oe.username}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:`w-fit px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest border ${oe.role==="programmer"?"bg-blue-50 text-blue-600 border-blue-100":oe.role==="demo"?ce?"bg-red-600 text-white":"bg-amber-50 text-amber-600 border-amber-100":"bg-slate-100 text-slate-500 border-slate-200"}`,children:oe.role}),oe.role==="demo"&&oe.expiresAt&&n.jsx("span",{className:`text-[8px] font-bold uppercase ${ce?"text-red-500":"text-slate-400"}`,children:ce?"Expirado":`Exp: ${oe.expiresAt}`})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[e.role==="programmer"&&n.jsx("button",{onClick:()=>O(oe),disabled:p===oe.id,className:"p-2.5 bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white rounded-xl transition-all",title:"Activar Periodo Demo",children:p===oe.id?n.jsx(Vi,{size:18,className:"animate-spin"}):n.jsx(Oc,{size:18})}),n.jsx("button",{onClick:()=>te(oe.id),disabled:u===oe.id,className:"p-2.5 bg-amber-50 text-amber-600 hover:bg-amber-600 hover:text-white rounded-xl transition-all disabled:opacity-50",title:"Enviar Bienvenida",children:u===oe.id?n.jsx(Vi,{size:18,className:"animate-spin"}):n.jsx(Qr,{size:18})}),n.jsx("button",{onClick:()=>q(oe),className:"p-2.5 bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white rounded-xl transition-all",title:"Editar Perfil",children:n.jsx(vl,{size:18})}),n.jsx("button",{onClick:()=>H(oe.id),className:"p-2.5 bg-red-50 text-red-600 hover:bg-red-600 hover:text-white rounded-xl transition-all",title:"Eliminar",children:n.jsx(Ta,{size:18})})]})})]},oe.id)})})]})})]}),i&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-3xl shadow-2xl overflow-y-auto max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:z?"Editar Perfil de Usuario":"Nuevo Usuario"}),n.jsx("button",{onClick:()=>l(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:J,className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Nombres"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-bold",value:m,onChange:oe=>b(oe.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Apellidos"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-bold",value:v,onChange:oe=>y(oe.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Cédula / Login"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black",value:k,onChange:oe=>_(oe.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Rol"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none",value:L,onChange:oe=>R(oe.target.value),children:[n.jsx("option",{value:"admin",children:"Administrador"}),n.jsx("option",{value:"board",children:"Junta"}),n.jsx("option",{value:"owner",children:"Propietario"}),n.jsx("option",{value:"family",children:"Familiar"}),n.jsx("option",{value:"guest",children:"Invitado"}),n.jsx("option",{value:"demo",children:"Demo (Temporal)"}),n.jsx("option",{value:"programmer",children:"Programador (Core)"})]})]}),n.jsxs("div",{className:"md:col-span-2 bg-slate-50 p-6 rounded-[2rem] border border-slate-100",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(QG,{size:14})," Canales de Notificación"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1",children:"Correo Electrónico"}),n.jsxs("div",{className:"relative",children:[n.jsx(Qr,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:16}),n.jsx("input",{type:"email",className:"w-full bg-white border border-slate-200 rounded-xl pl-12 pr-4 py-3 text-sm font-bold outline-none focus:ring-2 focus:ring-blue-500",value:T,onChange:oe=>B(oe.target.value),placeholder:"email@ejemplo.com"})]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1",children:"Teléfono WhatsApp (Intl)"}),n.jsxs("div",{className:"relative",children:[n.jsx(ik,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:16}),n.jsx("input",{type:"tel",className:"w-full bg-white border border-slate-200 rounded-xl pl-12 pr-4 py-3 text-sm font-bold outline-none focus:ring-2 focus:ring-blue-500",value:C,onChange:oe=>E(oe.target.value),placeholder:"Ej: +58412... o +1..."})]}),n.jsx("p",{className:"text-[8px] text-slate-400 font-bold uppercase tracking-widest mt-1 ml-1",children:"Incluya el signo + y el código de país."})]}),n.jsxs("div",{className:"md:col-span-2 space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1",children:"Telegram Chat ID (Para el Bot)"}),n.jsxs("div",{className:"relative",children:[n.jsx(pK,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:16}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl pl-12 pr-4 py-3 text-sm font-bold outline-none focus:ring-2 focus:ring-blue-500",value:I,onChange:oe=>M(oe.target.value),placeholder:"Ej: 123456789"})]})]})]})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-blue-600 mb-2 block",children:"Nueva Contraseña (Se guardará como HASH)"}),n.jsxs("div",{className:"relative",children:[n.jsx(jA,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-blue-300",size:16}),n.jsx("input",{type:"password",placeholder:z?"Dejar vacío para no cambiar":"Mínimo 8 caracteres",className:"w-full bg-blue-50 border border-blue-100 rounded-2xl pl-12 pr-4 py-4 font-bold text-slate-800",value:U,onChange:oe=>D(oe.target.value)})]})]})]}),n.jsxs("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all flex items-center justify-center gap-3",children:[n.jsx(qn,{size:18})," ",z?"ACTUALIZAR USUARIO":"CREAR USUARIO SEGURO"]})]})]})})]})},Ua=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},Ku=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},bme=({user:e,onNavigate:t})=>{const{fees:r,residents:a,properties:s,pendingBills:i,providers:l,addPendingBill:o,payPendingBill:d,deletePendingBill:u,updatePendingBill:f,exchangeRateHistory:p,refreshData:x}=ht(),[m,b]=j.useState("payable"),[v,y]=j.useState(new Date().getMonth()),[k,_]=j.useState(new Date().getFullYear()),[C,E]=j.useState(""),[T,B]=j.useState(!1),[I,M]=j.useState(!1),[U,D]=j.useState(!1),[L,R]=j.useState(null),[Q,G]=j.useState(null),[K,W]=j.useState(!1),[z,Z]=j.useState(null),[Y,te]=j.useState(!1),O=async xe=>{if(!xe||xe==="S/R"||xe.length<3){Z(null);return}try{const et=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${xe}`)).json();et.isDuplicate?Z(et):Z(null)}catch(qe){console.error("Error checking duplicate:",qe)}},P=()=>{const xe=window.open("","","width=900,height=900");if(!xe)return;const qe=Wr.items.map(et=>`
        <tr>
            <td style="padding:10px; border-bottom:1px solid #eee;">${et.provider}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; font-size:10px;">${et.description}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; text-align:center;">${et.status}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Ua(et.amount)}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Ua(Number(et.amount)-(Number(et.paid_amount_usd)||0))}</td>
        </tr>
    `).join("");xe.document.write(`
        <html>
        <head>
            <title>Cuentas por Pagar - ${Ue[v]} ${k}</title>
            <style>
                body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                .header { text-align: center; border-bottom: 4px solid #e11d48; padding-bottom: 20px; margin-bottom: 30px; }
                h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #9f1239; }
                table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                th { text-align: left; padding: 12px; background: #9f1239; color: white; font-size: 11px; text-transform: uppercase; }
                .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
            </style>
        </head>
        <body>
            <div class="header">
                <h1>RELACIÓN DE CUENTAS POR PAGAR</h1>
                <p>Periodo: ${Ue[v]} ${k}</p>
                <p>Condominio Residencial El Tejar | SAC 2026</p>
            </div>
            <table>
                <thead>
                    <tr>
                        <th>Proveedor</th>
                        <th>Concepto</th>
                        <th>Estatus</th>
                        <th>Total USD</th>
                        <th>Pendiente USD</th>
                    </tr>
                </thead>
                <tbody>${qe}</tbody>
            </table>
            <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.70 MC/MB</div>
        </body>
        </html>
    `),xe.document.close(),xe.print()},q=()=>{const xe=Wr.items.map(se=>`
        <tr>
            <td>${se.provider}</td>
            <td>${se.description}</td>
            <td>${se.status}</td>
            <td>$${Ua(se.amount)}</td>
            <td>$${Ua(Number(se.amount)-(Number(se.paid_amount_usd)||0))}</td>
            <td>${se.dueDate}</td>
        </tr>
    `).join(""),qe=`
        <!DOCTYPE html>
        <html lang="es">
        <head>
            <meta charset="UTF-8">
            <title>Cuentas por Pagar - Exportación</title>
            <style>
                body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                h1 { color: #9f1239; border-bottom: 2px solid #e11d48; padding-bottom: 10px; }
                table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                tr:nth-child(even) { background-color: #f9fafb; }
            </style>
        </head>
        <body>
            <h1>Relación de Cuentas por Pagar</h1>
            <p>Periodo: ${Ue[v]} ${k}</p>
            <p>Fecha de generación: ${new Date().toLocaleString()}</p>
            <table>
                <thead>
                    <tr>
                        <th>Proveedor</th>
                        <th>Concepto</th>
                        <th>Estatus</th>
                        <th>Total USD</th>
                        <th>Pendiente USD</th>
                        <th>Vencimiento</th>
                    </tr>
                </thead>
                <tbody>${xe}</tbody>
            </table>
        </body>
        </html>
    `,et=new Blob([qe],{type:"text/html"}),ee=URL.createObjectURL(et),de=document.createElement("a");de.href=ee,de.download=`Cuentas_por_Pagar_${Ue[v]}_${k}.html`,de.click(),URL.revokeObjectURL(ee)},[H,J]=j.useState(!1),[ae,oe]=j.useState(2),[ce,ne]=j.useState([]),[le,ge]=j.useState({status:"Pendiente",dueDate:Er(),creationDate:Er(),provider:"",description:"",amountBs:0,prefill_fee:!1,fee_category:"variable",is_uncommon:!1,is_special:!1,is_silent:!1,special_props_json:[],target_month:new Date().getMonth(),target_year:new Date().getFullYear()}),[X,pe]=j.useState("am"),[be,me]=j.useState(null),[_e,Te]=j.useState(""),[Xe,At]=j.useState(""),[kt,Bt]=j.useState("Banco"),[Kr,qr]=j.useState(Er()),[_t,Ir]=j.useState(!1),[vr,Fa]=j.useState(!1),[xt,dr]=j.useState([]),[rt,Ct]=j.useState("pm"),[Vt,jt]=j.useState(""),[er,Dr]=j.useState(!1),zr=j.useMemo(()=>Vt?l.filter(xe=>xe.name.toLowerCase().includes(Vt.toLowerCase())||xe.rif.toLowerCase().includes(Vt.toLowerCase())):[],[l,Vt]),Jn=(xe,qe="pm")=>{const et=p.find(de=>de.date===xe);if(!et)return 45;if(qe==="parallel")return Number(et.parallelValue)||45;const ee=qe==="am"?Number(et.amValue)||Number(et.pmValue):Number(et.pmValue)||Number(et.amValue);return Number(ee)||45},$s=j.useMemo(()=>Jn(le.creationDate||Er(),X),[le.creationDate,X,p]),Zi=j.useMemo(()=>$s<=0?0:Number(le.amountBs)/Number($s),[le.amountBs,$s]),bs=j.useMemo(()=>{if(!p||p.length===0)return 45;const xe=p[0];return Number(xe.pmValue)>0?Number(xe.pmValue):Number(xe.amValue)},[p]),ji=j.useMemo(()=>{let xe=0;const qe=[],et=r.find(ee=>ee.month===v&&ee.year===k);return et&&et.debts.forEach(ee=>{const de=(Number(ee.amountUsd)||0)-(Number(ee.paidAmount)||0);if(Math.abs(de)>.005){const se=s.find(Ae=>Ae.id===ee.propertyId),ie=a.find(Ae=>Ae.propertyId===ee.propertyId&&Ae.isOwner);(!C||(se==null?void 0:se.code.toLowerCase().includes(C.toLowerCase()))||(ie==null?void 0:ie.fullName.toLowerCase().includes(C.toLowerCase())))&&(qe.push({prop:se?`${se.type} ${se.number}`:`ID ${ee.propertyId}`,code:(se==null?void 0:se.code)||"S/I",owner:ie?ie.fullName:"Sin Asignar",amount:de,amountBs:de*bs,status:ee.status}),xe+=de)}}),{totalDebt:xe,items:qe.sort((ee,de)=>de.amount-ee.amount)}},[r,s,a,v,k,bs,C]),Wr=j.useMemo(()=>{const xe=i.filter(ie=>{const[ue,Ae]=ie.dueDate.split("-").map(Number),Ne=ie.target_month!==void 0&&ie.target_month!==null?ie.target_month:Ae-1,Me=ie.target_year!==void 0&&ie.target_year!==null?ie.target_year:ue,Ce=!C||ie.provider.toLowerCase().includes(C.toLowerCase())||ie.description.toLowerCase().includes(C.toLowerCase());return Me===k&&Ne===v&&Ce}),qe=xe.reduce((ie,ue)=>ie+Number(ue.amount),0),et=xe.reduce((ie,ue)=>ie+Number(ue.amountBs),0),ee=xe.reduce((ie,ue)=>ie+(Number(ue.paid_amount_usd)||0),0),de=xe.reduce((ie,ue)=>ie+(Number(ue.paid_amount_bs)||0),0);return{pendingTotal:qe-ee,totalUsd:qe,totalBs:et,paidUsd:ee,paidBs:de,items:xe.sort((ie,ue)=>new Date(ie.dueDate).getTime()-new Date(ue.dueDate).getTime())}},[i,v,k,C]),sn=xe=>{J(!1),oe(2),ne([]),xe?(G(xe.id),ge({...xe,prefill_fee:!!xe.prefill_fee,is_uncommon:!!xe.is_uncommon,is_special:!!xe.is_special,is_silent:!!xe.is_silent,special_props_json:xe.special_props_json||[],target_month:xe.target_month??new Date().getMonth(),target_year:xe.target_year??new Date().getFullYear()}),jt(xe.provider)):(G(null),ge({status:"Pendiente",dueDate:Er(),creationDate:Er(),provider:"",description:"",amountBs:0,prefill_fee:!1,fee_category:"variable",is_uncommon:!1,is_special:!1,is_silent:!1,special_props_json:[],target_month:new Date().getMonth(),target_year:new Date().getFullYear()}),jt("")),B(!0),Dr(!1)},el=async xe=>{if(xe.preventDefault(),!le.provider)return alert("Seleccione un proveedor.");if(H&&ce.length!==ae)return alert(`Debe seleccionar exactamente ${ae} meses para el fraccionamiento.`);const qe={...le,id:Q||void 0,amount:Number(Zi.toFixed(2)),creationRate:$s,is_fractioned:H,fraction_parts:ae,fraction_months:ce};try{const et=await fetch(`${ye}/save_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(et.ok)B(!1),x();else{const ee=await et.json();alert("Error: "+ee.error)}}catch{alert("Error de conexión.")}},Ei=xe=>{ce.includes(xe)?ne(qe=>qe.filter(et=>et!==xe)):ce.length<ae&&ne(qe=>[...qe,xe].sort((et,ee)=>et-ee))},qc=xe=>{const qe=Number(xe.amount)-(Number(xe.paid_amount_usd)||0),et=Jn(Er(),"pm");me(xe),Te(Number(qe*et).toFixed(2)),At(""),Bt("Banco"),qr(Er()),Ir(!!xe.is_silent),Fa(!1),dr([{amountBs:(qe*et).toFixed(2),ref:"",date:Er()}]),M(!0)},Po=()=>{dr([...xt,{amountBs:"0.00",ref:"",date:Er()}])},Dl=xe=>{xt.length>1&&dr(xt.filter((qe,et)=>et!==xe))},$e=(xe,qe,et)=>{const ee=[...xt];ee[xe]={...ee[xe],[qe]:et},dr(ee)},Tt=async xe=>{if(xe.preventDefault(),!be)return;const qe=e.role==="programmer"||e.role==="admin";if(vr){for(const ee of xt)if(ee.ref&&ee.ref!=="S/R"&&ee.ref.length>=3&&(await(await fetch(`${ye}/check_duplicate_reference.php?reference=${ee.ref}`)).json()).isDuplicate&&!Y){alert(qe?`El código de transferencia ${ee.ref} ya existe en el sistema. Verifique los detalles en el formulario y marque la casilla de autorización si desea proceder.`:`El código de transferencia ${ee.ref} ya ha sido usado. Por favor, envíe el comprobante a la administración para su verificación manual.`);return}xt.reduce((ee,de)=>ee+parseFloat(de.amountBs||"0"),0);const et=xt.map(ee=>{const de=Jn(ee.date,"pm");return{...ee,amount_bs:parseFloat(ee.amountBs),amount_usd:Yr(parseFloat(ee.amountBs)/de,2)}});try{if(!(await fetch(`${ye}/pay_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:be.id,is_multiple:!0,payments:et,source:kt,is_silent:_t,force_close:U})})).ok)throw new Error("Kernel Error");M(!1),D(!1),te(!1),Z(null),x(),alert("Múltiples Abonos Registrados")}catch(ee){alert("Error al liquidar factura: "+(ee.message||"Fallo desconocido"))}}else{if(Xe&&Xe!=="S/R"&&Xe.length>=3&&(await(await fetch(`${ye}/check_duplicate_reference.php?reference=${Xe}`)).json()).isDuplicate&&!Y){alert(qe?`El código de transferencia ${Xe} ya existe en el sistema. Verifique los detalles en el formulario y marque la casilla de autorización si desea proceder.`:`El código de transferencia ${Xe} ya ha sido usado. Por favor, envíe el comprobante a la administración para su verificación manual.`);return}const et=Jn(Kr,rt),ee=parseFloat(_e),de=Yr(ee/et,2);try{if(!(await fetch(`${ye}/pay_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:be.id,amount_bs:ee,amount_usd:de,reference:Xe||"S/R",source:kt,date:Kr,is_silent:_t,force_close:U})})).ok)throw new Error("Kernel Error");M(!1),D(!1),te(!1),Z(null),x(),alert(U||de>=Number(be.amount)-(Number(be.paid_amount_usd)||0)?"Factura Liquidada Completa":"Abono Parcial Registrado")}catch(se){alert("Error al liquidar factura: "+(se.message||"Fallo desconocido"))}}},Yr=(xe,qe)=>{const et=Math.pow(10,qe);return Math.round(xe*et)/et},Ia=j.useMemo(()=>[...s].sort((xe,qe)=>xe.code.localeCompare(qe.code,void 0,{numeric:!0})),[s]);return n.jsxs("div",{className:`max-w-7xl mx-auto space-y-8 animate-in fade-in duration-700 pb-20 balance-root-container ${K?"is-printing-report":""}`,children:[n.jsx("div",{className:`p-10 lg:p-14 rounded-[4rem] text-white shadow-2xl relative overflow-hidden transition-all duration-700 ${m==="receivable"?"bg-gradient-to-br from-emerald-600 to-teal-800 shadow-emerald-500/20":"bg-gradient-to-br from-rose-600 to-red-800 shadow-red-500/20"}`,children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-white/10 w-fit px-5 py-2 rounded-full backdrop-blur-md border border-white/20 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Fp,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Estado de Cartera Kernel V4.1.70 MC/MB"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:[m==="receivable"?"Cuentas por":"Relación de"," ",n.jsx("br",{}),n.jsx("span",{className:m==="receivable"?"text-emerald-300":"text-rose-300",children:m==="receivable"?"Cobrar":"Egresos"})]})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("span",{className:`text-[10px] font-black uppercase tracking-widest mb-4 px-5 py-2 rounded-full border ${m==="receivable"?"text-emerald-600 border-emerald-100 bg-emerald-50":"text-rose-600 border-rose-100 bg-rose-50"}`,children:m==="receivable"?"VALOR POR RECAUDAR":"DEUDA PENDIENTE PROVEEDORES"}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("span",{className:`text-2xl font-black mt-2 ${m==="receivable"?"text-emerald-600":"text-rose-600"}`,children:"$"}),n.jsx("span",{className:"text-7xl lg:text-8xl font-black tracking-tighter text-slate-900",children:(m==="receivable"?ji.totalDebt:Wr.pendingTotal).toLocaleString(void 0,{minimumFractionDigits:2})})]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-8"}),n.jsxs("div",{className:"flex gap-3 w-full",children:[n.jsx("button",{onClick:()=>m==="receivable"?window.print():P(),className:"flex-1 p-4 bg-slate-50 text-slate-400 hover:bg-slate-100 rounded-2xl transition-all flex items-center justify-center shadow-sm",children:n.jsx(yt,{size:20})}),m==="payable"&&n.jsxs("div",{className:"flex-[4] flex gap-2",children:[n.jsxs("button",{onClick:q,className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white font-black py-4 rounded-2xl shadow-xl shadow-blue-200 transition-all flex items-center justify-center gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(Jd,{size:18})," HTML"]}),n.jsxs("button",{onClick:()=>W(!0),className:"flex-1 bg-slate-800 hover:bg-slate-900 text-white font-black py-4 rounded-2xl shadow-xl transition-all flex items-center justify-center gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(yt,{size:18})," PAGOS"]}),n.jsxs("button",{onClick:()=>sn(),className:"flex-[1.5] bg-rose-600 hover:bg-rose-700 text-white font-black py-4 rounded-2xl shadow-xl shadow-rose-200 transition-all flex items-center justify-center gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(Cn,{size:18})," FACTURA"]})]})]})]})]})}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-center gap-6 bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm no-print",children:[n.jsxs("div",{className:"flex p-1.5 bg-slate-100 rounded-[1.8rem] w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>b("receivable"),className:`flex-1 lg:flex-none px-10 py-3.5 rounded-full text-[10px] font-black uppercase tracking-[0.2em] transition-all ${m==="receivable"?"bg-white text-emerald-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Cuentas por Cobrar"}),n.jsx("button",{onClick:()=>b("payable"),className:`flex-1 lg:flex-none px-10 py-3.5 rounded-full text-[10px] font-black uppercase tracking-[0.2em] transition-all ${m==="payable"?"bg-white text-rose-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Cuentas por Pagar"})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-slate-50 p-2 rounded-2xl border border-slate-100 flex gap-2 w-full sm:w-auto shadow-inner",children:[n.jsx("select",{value:v,onChange:xe=>y(Number(xe.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-4 py-2 cursor-pointer",children:Ue.map((xe,qe)=>n.jsx("option",{value:qe,children:xe},qe))}),n.jsx("input",{type:"number",value:k,onChange:xe=>_(Number(xe.target.value)),className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-20 text-center py-2"})]}),n.jsxs("div",{className:"relative w-full sm:w-72",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{type:"text",placeholder:"Buscar registro...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-3.5 text-xs focus:ring-2 focus:ring-blue-500 outline-none transition-all font-bold",value:C,onChange:xe=>E(xe.target.value)})]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:m==="receivable"?"Unidad / Propietario":"Proveedor / Concepto"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:m==="receivable"?"Estado Cobro":"Balance Liquidación"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:m==="receivable"?"Deuda Acumulada":"Importe USD"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:m==="receivable"?ji.items.map((xe,qe)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-900 text-lg",children:xe.code}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:xe.owner})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${xe.amount<0?"bg-blue-50 text-blue-600 border-blue-100":xe.status==="Pendiente"?"bg-red-50 text-red-600 border-red-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:xe.amount<0?"REEMBOLSO":xe.status})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsx("p",{className:`font-black text-xl tracking-tighter ${xe.amount<0?"text-blue-600":"text-slate-900"}`,children:xe.amount<0?`(${Ua(Math.abs(xe.amount))})`:`$${Ua(xe.amount)}`})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsx("button",{className:"p-3 bg-slate-100 text-slate-400 hover:bg-emerald-600 hover:text-white rounded-xl shadow-sm",children:n.jsx(nK,{size:18})})})]},qe)):Wr.items.map(xe=>{const qe=Number(xe.paid_amount_usd)||0,et=Number(xe.amount),ee=et-qe,de=qe>0&&qe<et;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 shadow-sm ${xe.prefill_fee?"bg-blue-600 text-white":"bg-slate-50 text-slate-400"}`,children:xe.prefill_fee?n.jsx(sa,{size:24}):n.jsx(Gr,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-lg uppercase leading-none truncate",children:xe.provider}),n.jsx("p",{className:"text-xs font-bold text-slate-500 mt-1 uppercase line-clamp-1 italic opacity-70",children:xe.description})]})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-1",children:[n.jsxs("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase border flex items-center justify-center gap-1.5 w-fit mx-auto ${xe.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":xe.status==="Parcial"?"bg-amber-50 text-amber-600 border-amber-100 animate-pulse":"bg-slate-100 text-slate-500"}`,children:[xe.status==="Pagado"&&n.jsx(Wi,{size:12}),xe.status]}),de&&n.jsx("div",{className:"w-24 h-1.5 bg-slate-100 rounded-full mt-2 overflow-hidden border",children:n.jsx("div",{className:"h-full bg-amber-500",style:{width:`${qe/et*100}%`}})})]})}),n.jsxs("td",{className:"px-10 py-6 text-right",children:[n.jsxs("p",{className:"font-black text-xl tracking-tighter text-slate-900",children:["$",Ua(ee)]}),n.jsxs("p",{className:"text-[9px] font-bold text-blue-600 uppercase mt-0.5",children:["≈ Bs. ",Ku(ee*bs)]}),qe>0&&n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Pagado: $",Ua(qe)," de $",Ua(et)]})]}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[xe.status!=="Pagado"&&n.jsx("button",{onClick:()=>qc(xe),className:"px-6 py-2.5 bg-emerald-600 hover:bg-emerald-700 text-white rounded-xl text-[10px] font-black uppercase tracking-widest shadow-lg active:scale-95",children:"ABONAR"}),qe>0&&n.jsx("button",{onClick:()=>alert("Historial de abonos detallado disponible en Auditoría Bancaria"),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ba,{size:18})}),n.jsx("button",{onClick:()=>sn(xe),className:"p-3 bg-slate-100 text-slate-400 hover:bg-blue-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(vl,{size:18})}),n.jsx("button",{onClick:()=>R({id:xe.id,provider:xe.provider}),className:"p-3 bg-slate-100 text-slate-400 hover:bg-red-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(Ta,{size:18})})]})})]},xe.id)})})]})})}),L&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/80 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-sm shadow-2xl animate-in zoom-in-95 duration-200 text-center relative overflow-hidden",children:[n.jsx("div",{className:"w-20 h-20 bg-red-50 text-red-600 rounded-3xl flex items-center justify-center mx-auto mb-6",children:n.jsx(hs,{size:40})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight mb-2",children:"¿Eliminar Registro?"}),n.jsxs("p",{className:"text-slate-500 font-medium text-sm leading-relaxed mb-10 px-2",children:["Está a punto de borrar permanentemente el registro de ",n.jsxs("span",{className:"font-black text-slate-800 uppercase",children:['"',L.provider,'"']}),"."]}),n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("button",{onClick:async()=>{await u(L.id),R(null),x()},className:"w-full bg-red-600 hover:bg-red-700 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl transition-all active:scale-95",children:"SÍ, CONFIRMAR BORRADO"}),n.jsx("button",{onClick:()=>R(null),className:"w-full py-4 text-slate-400 hover:text-slate-600 font-black text-[10px] uppercase transition-colors",children:"CANCELAR"})]})]})}),T&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-5xl shadow-2xl overflow-y-auto max-h-[95vh] custom-scrollbar animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"mb-10 flex justify-between items-center border-b border-slate-100 pb-6",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:Q?"Editar Egresos":"Nuevo Registro de Egreso"}),n.jsx("p",{className:"text-slate-400 font-medium mt-1",children:"Configure los parámetros contables de este compromiso de pago."})]}),n.jsx("button",{onClick:()=>B(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:el,className:"space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"relative",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Proveedor Autorizado"}),n.jsxs("div",{className:"relative",children:[n.jsx(ub,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-5 py-4 font-bold text-slate-800 outline-none focus:ring-2 focus:ring-blue-500",value:Vt,onChange:xe=>{jt(xe.target.value),ge({...le,provider:xe.target.value}),Dr(!0)},onFocus:()=>Dr(!0),placeholder:"Buscar o escribir nombre..."}),er&&(Vt.length>0||zr.length>0)&&n.jsx("div",{className:"absolute left-0 right-0 top-full mt-2 bg-white rounded-2xl shadow-2xl border border-slate-100 z-50 overflow-hidden",children:n.jsx("div",{className:"max-h-[160px] overflow-y-auto custom-scrollbar",children:zr.map(xe=>n.jsx("button",{type:"button",onClick:()=>{ge({...le,provider:xe.name}),jt(xe.name),Dr(!1)},className:"w-full px-6 py-4 text-left hover:bg-slate-50 border-b border-slate-50 last:border-0 font-black text-sm uppercase text-slate-700",children:xe.name},xe.rif))})})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Concepto / Glosa"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900",value:le.description,onChange:xe=>ge({...le,description:xe.target.value.toUpperCase()}),placeholder:"EJ: REPARACIÓN DE BOMBA DE AGUA"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Fecha Contable"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:le.creationDate,onChange:xe=>ge({...le,creationDate:xe.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Vencimiento"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:le.dueDate,onChange:xe=>ge({...le,dueDate:xe.target.value})})]})]}),n.jsxs("div",{className:"p-6 bg-emerald-50 border border-emerald-100 rounded-[2.5rem] shadow-inner space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase tracking-widest block text-emerald-600",children:"Importe Factura (Bolívares)"}),n.jsxs("div",{className:"flex p-1 bg-white/50 rounded-xl border border-emerald-100 scale-90 origin-right",children:[n.jsx("button",{type:"button",onClick:()=>pe("am"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${X==="am"?"bg-emerald-600 text-white shadow-md":"text-emerald-400 hover:text-emerald-600"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>pe("pm"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${X==="pm"?"bg-emerald-600 text-white shadow-md":"text-emerald-400 hover:text-emerald-600"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>pe("parallel"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${X==="parallel"?"bg-emerald-600 text-white shadow-md":"text-emerald-400 hover:text-emerald-600"}`,children:"Paralelo"})]})]}),n.jsxs("div",{className:"bg-white rounded-2xl px-5 py-4 flex items-center gap-3 border border-slate-200",children:[n.jsx("span",{className:"font-black text-slate-300",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-2xl font-black outline-none text-slate-900",value:le.amountBs||"",onChange:xe=>ge({...le,amountBs:parseFloat(xe.target.value)}),placeholder:"0,00"})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsxs("span",{className:"text-[9px] font-black text-emerald-600 uppercase",children:["Equivalente USD (@",$s.toFixed(2),"):"]}),n.jsxs("span",{className:"text-xl font-black text-slate-800",children:["$",Ua(Zi)]})]})]})]}),n.jsx("div",{className:"bg-slate-900 rounded-[3rem] p-10 text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600",children:n.jsxs("div",{className:"relative z-10 space-y-8",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("h4",{className:"text-lg font-black tracking-tight flex items-center gap-3",children:[n.jsx(sa,{className:"text-blue-400"})," Auto-Facturación"]}),n.jsx("button",{type:"button",onClick:()=>ge({...le,prefill_fee:!le.prefill_fee}),className:`w-16 h-8 rounded-full transition-all relative ${le.prefill_fee?"bg-blue-600":"bg-slate-700"}`,children:n.jsx("div",{className:`absolute top-1 w-6 h-6 bg-white rounded-full transition-all ${le.prefill_fee?"left-9 shadow-lg":"left-1"}`})})]}),le.prefill_fee?n.jsxs("div",{className:"space-y-8 animate-in fade-in zoom-in-95 duration-500",children:[n.jsxs("div",{className:"p-6 bg-white/5 border border-white/10 rounded-3xl space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("h5",{className:"text-[11px] font-black uppercase text-blue-400 flex items-center gap-2",children:[n.jsx(uK,{size:14})," ¿Fraccionar este Pago?"]}),n.jsx("button",{type:"button",onClick:()=>J(!H),className:`w-12 h-6 rounded-full transition-all relative ${H?"bg-emerald-600":"bg-slate-700"}`,children:n.jsx("div",{className:`absolute top-1 w-4 h-4 bg-white rounded-full transition-all ${H?"left-7 shadow-lg":"left-1"}`})})]}),H?n.jsxs("div",{className:"space-y-6 animate-in slide-in-from-top-2",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-500 mb-2 block",children:"Número de Partes"}),n.jsx("select",{className:"w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 font-black text-white",value:ae,onChange:xe=>{oe(parseInt(xe.target.value)),ne([])},children:[2,3,4,5,6,8,10,12].map(xe=>n.jsxs("option",{value:xe,className:"text-slate-900",children:[xe," Partes"]},xe))})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-500 mb-2 block",children:"Monto por Fracción"}),n.jsxs("p",{className:"text-xl font-black text-emerald-400",children:["$",Ua(Zi/ae)]})]})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest mb-3 block text-center",children:["Seleccione los ",ae," meses de aplicación"]}),n.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:Ue.map((xe,qe)=>n.jsx("button",{type:"button",onClick:()=>Ei(qe),className:`py-2 rounded-lg text-[8px] font-black border transition-all ${ce.includes(qe)?"bg-blue-600 border-blue-500 text-white":"bg-white/5 border-white/10 text-slate-500"}`,children:xe.substring(0,3).toUpperCase()},qe))})]})]}):n.jsxs("div",{className:"grid grid-cols-2 gap-4 animate-in fade-in",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest ml-1 mb-2 block",children:"Mes a Facturar"}),n.jsx("select",{className:"w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 font-black text-white outline-none",value:le.target_month,onChange:xe=>ge({...le,target_month:parseInt(xe.target.value)}),children:Ue.map((xe,qe)=>n.jsx("option",{value:qe,children:xe},qe))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest ml-1 mb-2 block",children:"Año de Cobro"}),n.jsx("input",{type:"number",className:"w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 font-black text-white outline-none",value:le.target_year,onChange:xe=>ge({...le,target_year:parseInt(xe.target.value)})})]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest ml-1 mb-2 block",children:"Ubicación en Planilla"}),n.jsx("div",{className:"flex gap-2",children:["fixed","variable","other"].map(xe=>n.jsx("button",{type:"button",onClick:()=>ge({...le,fee_category:xe}),className:`flex-1 py-3 rounded-xl text-[9px] font-black uppercase border transition-all ${le.fee_category===xe?"bg-blue-600 border-blue-600 text-white shadow-lg":"bg-white/5 border-white/10 text-slate-400 hover:text-white"}`,children:xe==="fixed"?"Fijo":xe==="variable"?"Variable":"Otros"},xe))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("button",{type:"button",onClick:()=>ge({...le,is_uncommon:!le.is_uncommon}),className:`p-5 rounded-2xl border transition-all flex flex-col items-center gap-2 ${le.is_uncommon?"bg-indigo-600 border-indigo-500 shadow-xl":"bg-white/5 border-white/10 text-slate-400"}`,children:[n.jsx(Lc,{size:20,fill:le.is_uncommon?"currentColor":"none"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Gasto GNC"})]}),n.jsxs("button",{type:"button",onClick:()=>ge({...le,is_special:!le.is_special}),className:`p-5 rounded-2xl border transition-all flex flex-col items-center gap-2 ${le.is_special?"bg-amber-600 border-amber-500 shadow-xl":"bg-white/5 border-white/10 text-slate-400"}`,children:[n.jsx(lk,{size:20}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Especial"})]})]}),n.jsxs("div",{className:"p-6 bg-white/5 border border-white/10 rounded-3xl flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(sa,{size:20,className:"text-amber-400"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-white",children:"Silent Offset Mode"}),n.jsx("p",{className:"text-[8px] font-bold text-slate-500 uppercase tracking-widest",children:"Sin Efecto en Banco"})]})]}),n.jsx("button",{type:"button",onClick:()=>ge({...le,is_silent:!le.is_silent}),className:`w-14 h-7 rounded-full transition-all relative ${le.is_silent?"bg-amber-600":"bg-slate-700"}`,children:n.jsx("div",{className:`absolute top-1 w-5 h-5 bg-white rounded-full transition-all ${le.is_silent?"left-8 shadow-lg":"left-1"}`})})]}),le.is_special&&n.jsxs("div",{className:"p-6 bg-white/5 border border-white/10 rounded-3xl animate-in slide-in-from-top-2",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase mb-4 text-center",children:"Unidades Beneficiarias"}),n.jsx("div",{className:"grid grid-cols-5 gap-1 max-h-[150px] overflow-y-auto custom-scrollbar pr-2",children:Ia.map(xe=>{var qe;return n.jsx("button",{type:"button",onClick:()=>{const et=le.special_props_json||[];ge({...le,special_props_json:et.includes(xe.id)?et.filter(ee=>ee!==xe.id):[...et,xe.id]})},className:`py-2 rounded-lg text-[8px] font-black border transition-all ${(qe=le.special_props_json)!=null&&qe.includes(xe.id)?"bg-blue-600 border-blue-500 text-white":"bg-white/5 border-white/10 text-slate-500 hover:text-white"}`,children:xe.code.split("-")[1]||xe.code},xe.id)})})]})]}):n.jsxs("div",{className:"py-20 text-center opacity-30",children:[n.jsx(hs,{size:48,className:"mx-auto mb-4"}),n.jsx("p",{className:"text-xs font-black uppercase tracking-[0.2em]",children:"Modo Manual Activado"}),n.jsx("p",{className:"text-[9px] mt-2 italic",children:"Este gasto no se incluirá en el pre-llenado de cuotas."})]})]})})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl active:scale-95 transition-all",children:"SELLAR COMPROMISO CONTABLE"})]})]})}),I&&be&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 sm:p-12 w-full max-w-lg shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[95vh] custom-scrollbar",children:[n.jsx("button",{onClick:()=>M(!1),className:"absolute top-8 right-8 p-2 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-white transition-all",children:n.jsx(ft,{size:20})}),n.jsx("div",{className:"mb-10",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-emerald-600 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx($i,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Amortizar Factura"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-1",children:["Proveedor: ",be.provider]})]})]})}),n.jsxs("form",{onSubmit:Tt,className:"space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-100 rounded-2xl",children:[n.jsx("span",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Deuda Total"}),n.jsxs("span",{className:"text-sm font-black text-slate-900",children:["$ ",Ua(be.amount)]})]}),n.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-100 rounded-2xl",children:[n.jsx("span",{className:"text-[8px] font-black text-emerald-600 uppercase tracking-widest block mb-1",children:"Saldo Restante"}),n.jsxs("span",{className:"text-sm font-black text-emerald-700",children:["$ ",Ua(Number(be.amount)-(Number(be.paid_amount_usd)||0))]})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 bg-blue-50 border border-blue-100 rounded-2xl",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Pc,{size:16,className:"text-blue-600"}),n.jsx("span",{className:"text-[9px] font-black text-blue-700 uppercase",children:"Múltiples Referencias"})]}),n.jsx("button",{type:"button",onClick:()=>Fa(!vr),className:`w-10 h-5 rounded-full transition-all relative ${vr?"bg-blue-600":"bg-slate-300"}`,children:n.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all shadow-sm ${vr?"left-5":"left-0.5"}`})})]}),vr?n.jsxs("div",{className:"space-y-4",children:[xt.map((xe,qe)=>n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-200 rounded-2xl space-y-3 relative group",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-400 ml-1",children:"Monto Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full bg-white border border-slate-200 rounded-lg px-3 py-2 font-black text-xs",value:xe.amountBs,onChange:et=>$e(qe,"amountBs",et.target.value)})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-400 ml-1",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-white border border-slate-200 rounded-lg px-3 py-2 font-black text-xs",value:xe.ref,onChange:et=>{$e(qe,"ref",et.target.value),et.target.value.length>=3&&O(et.target.value)},placeholder:"Ref"})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-400 ml-1",children:"Fecha"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-white border border-slate-200 rounded-lg px-2 py-2 font-black text-[10px]",value:xe.date,onChange:et=>$e(qe,"date",et.target.value)})]})]}),xt.length>1&&n.jsx("button",{type:"button",onClick:()=>Dl(qe),className:"absolute -top-2 -right-2 w-6 h-6 bg-red-500 text-white rounded-full flex items-center justify-center shadow-lg opacity-0 group-hover:opacity-100 transition-all",children:n.jsx(ft,{size:12})})]},qe)),n.jsxs("button",{type:"button",onClick:Po,className:"w-full py-3 border-2 border-dashed border-slate-200 rounded-2xl text-slate-400 hover:text-blue-600 hover:border-blue-200 transition-all flex items-center justify-center gap-2 text-[10px] font-black uppercase tracking-widest",children:[n.jsx(Cn,{size:14})," Añadir Referencia"]}),n.jsxs("div",{className:"p-4 bg-blue-600 rounded-2xl text-white flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Total Acumulado:"}),n.jsxs("span",{className:"text-lg font-black",children:["Bs. ",xt.reduce((xe,qe)=>xe+parseFloat(qe.amountBs||"0"),0).toLocaleString("es-VE",{minimumFractionDigits:2})]})]})]}):n.jsxs("div",{className:"p-8 bg-blue-600 rounded-[2.5rem] text-white shadow-xl relative overflow-hidden",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-200",children:"Monto del Abono (Bolívares)"}),n.jsxs("div",{className:"flex p-1 bg-white/10 rounded-xl border border-white/20 scale-90 origin-right",children:[n.jsx("button",{type:"button",onClick:()=>Ct("am"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${rt==="am"?"bg-white text-blue-600 shadow-md":"text-blue-200 hover:text-white"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>Ct("pm"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${rt==="pm"?"bg-white text-blue-600 shadow-md":"text-blue-200 hover:text-white"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>Ct("parallel"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${rt==="parallel"?"bg-white text-blue-600 shadow-md":"text-blue-200 hover:text-white"}`,children:"Paralelo"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 border-b-2 border-blue-400 pb-2",children:[n.jsx("span",{className:"text-2xl font-black opacity-50",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"bg-transparent w-full text-4xl font-black outline-none placeholder:text-blue-400",value:_e,onChange:xe=>Te(xe.target.value)})]}),n.jsxs("div",{className:"mt-6 flex justify-between items-center relative z-10",children:[n.jsx("span",{className:"text-[10px] font-bold text-blue-100",children:"Equivalente Aproximado:"}),n.jsxs("span",{className:"text-xl font-black",children:["$ ",Ua(parseFloat(_e)/Jn(Kr,rt))]})]}),n.jsx(La,{size:100,className:"absolute right-[-20px] bottom-[-20px] opacity-10"})]}),!vr&&n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 ml-1",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-5 py-3.5 font-black text-xs",value:Xe,onChange:xe=>{At(xe.target.value),xe.target.value.length>=3&&O(xe.target.value)},placeholder:"000000"})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 ml-1",children:"Fecha Pago"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 font-black text-xs",value:Kr,onChange:xe=>qr(xe.target.value)})]})]}),z&&n.jsxs("div",{className:"p-6 bg-amber-50 border-2 border-amber-200 rounded-[2rem] space-y-4 animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-amber-500 rounded-2xl flex items-center justify-center text-white shadow-lg shrink-0",children:n.jsx(na,{size:24})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"text-sm font-black text-amber-900 uppercase tracking-tight",children:"Referencia Duplicada Detectada"}),n.jsx("p",{className:"text-[10px] font-bold text-amber-700 mt-1 leading-relaxed",children:e.role==="programmer"||e.role==="admin"?"Este código ya ha sido utilizado en el sistema. Verifique la información a continuación.":"Este código ya ha sido reportado anteriormente. Por favor, contacte a la administración para verificar su pago."})]})]}),(e.role==="programmer"||e.role==="admin")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bg-white/60 rounded-2xl p-4 space-y-3",children:[n.jsxs("p",{className:"text-[9px] font-black text-amber-900 uppercase border-b border-amber-200 pb-2 flex items-center gap-2",children:[n.jsx(Nn,{size:12})," Detalles del Hallazgo:"]}),n.jsx("div",{className:"space-y-2 max-h-[120px] overflow-y-auto custom-scrollbar pr-2",children:z.matches.map((xe,qe)=>n.jsxs("div",{className:"text-[9px] font-bold text-slate-700 bg-white p-2 rounded-lg border border-amber-100 flex justify-between",children:[n.jsxs("span",{children:[xe.table==="payment_reports"?"Reporte":xe.table==="payments"?"Pago":xe.table==="bank_transactions"?"Banco":"CxP",": ",xe.details]}),n.jsx("span",{className:"text-amber-600",children:xe.date})]},qe))})]}),n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-white rounded-2xl border-2 border-amber-200 shadow-sm",children:[n.jsx("input",{type:"checkbox",id:"authDuplicateBalance",checked:Y,onChange:xe=>te(xe.target.checked),className:"w-5 h-5 rounded-lg border-amber-300 text-amber-600 focus:ring-amber-500"}),n.jsx("label",{htmlFor:"authDuplicateBalance",className:"text-[10px] font-black text-amber-900 uppercase cursor-pointer select-none",children:"Autorizo el uso de esta referencia duplicada"})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 ml-1",children:"Origen de Fondos"}),n.jsx("div",{className:"flex gap-3",children:["Banco","Efectivo","Otro"].map(xe=>n.jsx("button",{type:"button",onClick:()=>Bt(xe),className:`flex-1 py-3 rounded-xl font-black text-[9px] uppercase transition-all ${kt===xe?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 border border-slate-100"}`,children:xe},xe))})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-amber-50 border border-amber-100 rounded-2xl",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(sa,{size:16,className:"text-amber-600"}),n.jsx("span",{className:"text-[9px] font-black text-amber-700 uppercase",children:"Silent Offset Mode"})]}),n.jsx("button",{type:"button",onClick:()=>Ir(!_t),className:`w-10 h-5 rounded-full transition-all relative ${_t?"bg-amber-600":"bg-slate-300"}`,children:n.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all shadow-sm ${_t?"left-5":"left-0.5"}`})})]}),n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-rose-50 border border-rose-100 rounded-2xl",children:[n.jsx("input",{type:"checkbox",id:"forceClose",checked:U,onChange:xe=>D(xe.target.checked),className:"w-5 h-5 rounded-lg border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("label",{htmlFor:"forceClose",className:"text-[10px] font-black text-rose-700 uppercase cursor-pointer select-none",children:"Cerrar cuenta con este pago (Total)"})]})]}),n.jsx("button",{type:"submit",className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl active:scale-95 transition-all",children:"PROCESAR LIQUIDACIÓN"})]})]})}),K&&n.jsxs("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:[n.jsxs("div",{className:"bg-white w-full max-w-5xl max-h-[90vh] rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50 no-print",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tighter uppercase",children:"Reporte Detallado CxP"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-1",children:["Periodo: ",Ue[v]," ",k]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("button",{onClick:()=>window.print(),className:"bg-slate-900 text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2 hover:bg-slate-800 transition-all",children:[n.jsx(yt,{size:16})," Imprimir / PDF"]}),n.jsx("button",{onClick:()=>W(!1),className:"p-3 bg-white text-slate-400 hover:text-slate-600 rounded-xl border border-slate-200 transition-all",children:n.jsx(ft,{size:20})})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-8 custom-scrollbar",children:n.jsxs("div",{id:"printable-report",className:"space-y-8",children:[n.jsxs("div",{className:"text-center border-b-4 border-slate-900 pb-6 mb-8 hidden print:block",children:[n.jsx("h1",{className:"text-3xl font-black uppercase tracking-tighter",children:"Reporte Detallado de Cuentas por Pagar"}),n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-[0.3em] mt-2",children:"Condominio El Tejar • Kernel V4.1.70 MC/MB"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-4",children:["Periodo: ",Ue[v]," ",k]})]}),n.jsxs("table",{className:"w-full border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b-2 border-slate-900",children:[n.jsx("th",{className:"py-4 text-left text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Proveedor / Concepto"}),n.jsx("th",{className:"py-4 text-center text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Vencimiento"}),n.jsx("th",{className:"py-4 text-right text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Monto USD"}),n.jsx("th",{className:"py-4 text-right text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Monto BS"}),n.jsx("th",{className:"py-4 text-center text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Estatus"})]})}),n.jsx("tbody",{children:Wr.items.map(xe=>n.jsxs(Bp.Fragment,{children:[n.jsxs("tr",{className:"border-b border-slate-100 bg-slate-50/50",children:[n.jsxs("td",{className:"py-4",children:[n.jsx("p",{className:"text-xs font-black text-slate-900 uppercase",children:xe.provider}),n.jsx("p",{className:"text-[10px] font-bold text-slate-500 mt-0.5",children:xe.description})]}),n.jsx("td",{className:"py-4 text-center text-[10px] font-bold text-slate-600",children:xe.dueDate}),n.jsxs("td",{className:"py-4 text-right text-xs font-black text-slate-900",children:["$ ",Ua(xe.amount)]}),n.jsxs("td",{className:"py-4 text-right text-xs font-black text-slate-600",children:["Bs. ",Ku(xe.amountBs)]}),n.jsx("td",{className:"py-4 text-center",children:n.jsx("span",{className:`px-3 py-1 rounded-full text-[8px] font-black uppercase tracking-widest ${xe.status==="Pagado"?"bg-emerald-100 text-emerald-700":xe.status==="Parcial"?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:xe.status})})]}),xe.payments&&xe.payments.length>0&&n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-2 px-8",children:n.jsxs("div",{className:"bg-white border border-slate-100 rounded-xl p-4 space-y-2",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-600 uppercase tracking-widest",children:"Historial de Pagos:"}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-50",children:[n.jsx("th",{className:"py-2 text-left text-[8px] font-black text-slate-400 uppercase",children:"Fecha"}),n.jsx("th",{className:"py-2 text-left text-[8px] font-black text-slate-400 uppercase",children:"Referencia"}),n.jsx("th",{className:"py-2 text-left text-[8px] font-black text-slate-400 uppercase",children:"Origen"}),n.jsx("th",{className:"py-2 text-right text-[8px] font-black text-slate-400 uppercase",children:"Monto USD"}),n.jsx("th",{className:"py-2 text-right text-[8px] font-black text-slate-400 uppercase",children:"Monto BS"})]})}),n.jsx("tbody",{children:xe.payments.map(qe=>n.jsxs("tr",{className:"border-b border-slate-50 last:border-0",children:[n.jsx("td",{className:"py-2 text-[9px] font-bold text-slate-600",children:qe.payment_date}),n.jsx("td",{className:"py-2 text-[9px] font-black text-slate-900",children:qe.reference}),n.jsx("td",{className:"py-2 text-[9px] font-bold text-slate-500",children:qe.source}),n.jsxs("td",{className:"py-2 text-right text-[9px] font-black text-slate-900",children:["$ ",Ua(qe.amount_usd)]}),n.jsxs("td",{className:"py-2 text-right text-[9px] font-black text-slate-600",children:["Bs. ",Ku(qe.amount_bs)]})]},qe.id))})]})]})})})]},xe.id))})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-8 pt-8 border-t-2 border-slate-900",children:[n.jsxs("div",{className:"p-6 bg-slate-900 rounded-[2rem] text-white",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 mb-2",children:"Total Facturado"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter",children:["$ ",Ua(Wr.totalUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 mt-1",children:["Bs. ",Ku(Wr.totalBs)]})]}),n.jsxs("div",{className:"p-6 bg-emerald-600 rounded-[2rem] text-white",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-emerald-200 mb-2",children:"Total Pagado"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter",children:["$ ",Ua(Wr.paidUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-emerald-200 mt-1",children:["Bs. ",Ku(Wr.paidBs)]})]}),n.jsxs("div",{className:"p-6 bg-rose-600 rounded-[2rem] text-white",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-rose-200 mb-2",children:"Saldo Pendiente"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter",children:["$ ",Ua(Wr.totalUsd-Wr.paidUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-rose-200 mt-1",children:["Bs. ",Ku(Wr.totalBs-Wr.paidBs)]})]})]}),n.jsxs("div",{className:"mt-20 flex justify-around items-end text-center print:mt-40",children:[n.jsx("div",{className:"w-48 border-t border-slate-900 pt-4",children:n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Administración"})}),n.jsx("div",{className:"w-48 border-t border-slate-900 pt-4",children:n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Junta de Condominio"})})]}),n.jsxs("div",{className:"text-right text-[8px] font-bold text-slate-400 uppercase tracking-widest mt-8",children:["Generado el: ",new Date().toLocaleString()," • Kernel V4.1.70 MC/MB"]})]})})]}),n.jsx("style",{children:`
            @media print {
              .no-print { display: none !important; }
              body { background: white !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; }
              html { overflow: visible !important; height: auto !important; }
              
              /* Hide everything by default */
              body > #root > div > aside,
              body > #root > div > div > header,
              body > #root > div > div > main > div > div.balance-root-container:not(.is-printing-report) {
                display: none !important;
              }

              /* Hide non-report content inside Balance when printing report */
              .balance-root-container.is-printing-report > *:not(.fixed) {
                display: none !important;
              }

              #printable-report { 
                display: block !important; 
                width: 100% !important; 
                padding: 0 !important; 
                margin: 0 !important; 
                overflow: visible !important;
                position: relative !important;
              }

              .fixed { 
                position: static !important; 
                display: block !important; 
                visibility: visible !important;
                opacity: 1 !important;
                background: white !important; 
                z-index: auto !important; 
                padding: 0 !important; 
                margin: 0 !important;
                overflow: visible !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                width: 100% !important;
                height: auto !important;
              }

              .bg-white { background: white !important; }
              .bg-slate-50 { background: #f8fafc !important; }
              .bg-slate-900 { background: #0f172a !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
              .bg-emerald-600 { background: #059669 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
              .bg-rose-600 { background: #e11d48 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
              
              .shadow-2xl, .shadow-xl, .shadow-lg, .shadow-md, .shadow-sm { box-shadow: none !important; }
              .rounded-[2.5rem], .rounded-[2rem], .rounded-2xl, .rounded-xl { border-radius: 0 !important; border: 1px solid #e2e8f0 !important; }
              
              .overflow-hidden, .overflow-y-auto { 
                overflow: visible !important; 
                height: auto !important; 
                max-height: none !important; 
              }
              
              .max-h-[90vh], .max-h-[95vh] { max-height: none !important; }
              .p-8, .p-6, .p-4 { padding: 10px !important; }
              
              table { 
                border-collapse: collapse !important; 
                width: 100% !important; 
                page-break-inside: auto !important; 
                table-layout: auto !important;
              }
              
              tr { page-break-inside: auto !important; page-break-after: auto !important; }
              th, td { border: 1px solid #e2e8f0 !important; padding: 8px !important; page-break-inside: avoid !important; }
              
              .hidden.print\\:block { display: block !important; }
              * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; transition: none !important; animation: none !important; }
              
              /* Ensure the modal content takes full width */
              .max-w-5xl { max-width: 100% !important; width: 100% !important; }
            }
          `})]})]})};/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var Og={};Og.version="0.18.5";var cQ=1252,vme=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Jj={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},Zj=function(e){vme.indexOf(e)!=-1&&(cQ=Jj[0]=e)};function yme(){Zj(1252)}var Mi=function(e){Zj(e)};function eE(){Mi(1200),yme()}function sD(e){for(var t=[],r=0,a=e.length;r<a;++r)t[r]=e.charCodeAt(r);return t}function wme(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return t.join("")}function dQ(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return t.join("")}var vf=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return t==255&&r==254?wme(e.slice(2)):t==254&&r==255?dQ(e.slice(2)):t==65279?e.slice(1):e},Ox=function(t){return String.fromCharCode(t)},iD=function(t){return String.fromCharCode(t)},Ap,vc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function fp(e){for(var t="",r=0,a=0,s=0,i=0,l=0,o=0,d=0,u=0;u<e.length;)r=e.charCodeAt(u++),i=r>>2,a=e.charCodeAt(u++),l=(r&3)<<4|a>>4,s=e.charCodeAt(u++),o=(a&15)<<2|s>>6,d=s&63,isNaN(a)?o=d=64:isNaN(s)&&(d=64),t+=vc.charAt(i)+vc.charAt(l)+vc.charAt(o)+vc.charAt(d);return t}function Qs(e){var t="",r=0,a=0,s=0,i=0,l=0,o=0,d=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var u=0;u<e.length;)i=vc.indexOf(e.charAt(u++)),l=vc.indexOf(e.charAt(u++)),r=i<<2|l>>4,t+=String.fromCharCode(r),o=vc.indexOf(e.charAt(u++)),a=(l&15)<<4|o>>2,o!==64&&(t+=String.fromCharCode(a)),d=vc.indexOf(e.charAt(u++)),s=(o&3)<<6|d,d!==64&&(t+=String.fromCharCode(s));return t}var Dt=(function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node})(),Mo=(function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(t,r){return r?new Buffer(t,r):new Buffer(t)}:Buffer.from.bind(Buffer)}return function(){}})();function Ic(e){return Dt?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function lD(e){return Dt?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var Is=function(t){return Dt?Mo(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function sv(e){if(typeof ArrayBuffer>"u")return Is(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),a=0;a!=e.length;++a)r[a]=e.charCodeAt(a)&255;return t}function Vc(e){if(Array.isArray(e))return e.map(function(a){return String.fromCharCode(a)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function Nme(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}function tE(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return tE(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var Xa=Dt?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Mo(t)}))}:function(e){if(typeof Uint8Array<"u"){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var a=new Uint8Array(r),s=0;for(t=0,r=0;t<e.length;r+=s,++t)if(s=e[t].length,e[t]instanceof Uint8Array)a.set(e[t],r);else{if(typeof e[t]=="string")throw"wtf";a.set(new Uint8Array(e[t]),r)}return a}return[].concat.apply([],e.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Cme(e){for(var t=[],r=0,a=e.length+250,s=Ic(e.length+255),i=0;i<e.length;++i){var l=e.charCodeAt(i);if(l<128)s[r++]=l;else if(l<2048)s[r++]=192|l>>6&31,s[r++]=128|l&63;else if(l>=55296&&l<57344){l=(l&1023)+64;var o=e.charCodeAt(++i)&1023;s[r++]=240|l>>8&7,s[r++]=128|l>>2&63,s[r++]=128|o>>6&15|(l&3)<<4,s[r++]=128|o&63}else s[r++]=224|l>>12&15,s[r++]=128|l>>6&63,s[r++]=128|l&63;r>a&&(t.push(s.slice(0,r)),r=0,s=Ic(65535),a=65530)}return t.push(s.slice(0,r)),Xa(t)}var Kn=/\u0000/g,yf=/[\u0001-\u0006]/g;function vA(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function Ri(e,t){var r=""+e;return r.length>=t?r:ra("0",t-r.length)+r}function rE(e,t){var r=""+e;return r.length>=t?r:ra(" ",t-r.length)+r}function Pg(e,t){var r=""+e;return r.length>=t?r:r+ra(" ",t-r.length)}function kme(e,t){var r=""+Math.round(e);return r.length>=t?r:ra("0",t-r.length)+r}function jme(e,t){var r=""+e;return r.length>=t?r:ra("0",t-r.length)+r}var oD=Math.pow(2,32);function qu(e,t){if(e>oD||e<-oD)return kme(e,t);var r=Math.round(e);return jme(r,t)}function Lg(e,t){return t=t||0,e.length>=7+t&&(e.charCodeAt(t)|32)===103&&(e.charCodeAt(t+1)|32)===101&&(e.charCodeAt(t+2)|32)===110&&(e.charCodeAt(t+3)|32)===101&&(e.charCodeAt(t+4)|32)===114&&(e.charCodeAt(t+5)|32)===97&&(e.charCodeAt(t+6)|32)===108}var cD=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],N2=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function Eme(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var gt={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},dD={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Sme={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function Qg(e,t,r){for(var a=e<0?-1:1,s=e*a,i=0,l=1,o=0,d=1,u=0,f=0,p=Math.floor(s);u<t&&(p=Math.floor(s),o=p*l+i,f=p*u+d,!(s-p<5e-8));)s=1/(s-p),i=l,l=o,d=u,u=f;if(f>t&&(u>t?(f=d,o=i):(f=u,o=l)),!r)return[0,a*o,f];var x=Math.floor(a*o/f);return[x,a*o-x*f,f]}function Cd(e,t,r){if(e>2958465||e<0)return null;var a=e|0,s=Math.floor(86400*(e-a)),i=0,l=[],o={D:a,T:s,u:86400*(e-a)-s,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),t&&t.date1904&&(a+=1462),o.u>.9999&&(o.u=0,++s==86400&&(o.T=s=0,++a,++o.D)),a===60)l=r?[1317,10,29]:[1900,2,29],i=3;else if(a===0)l=r?[1317,8,29]:[1900,1,0],i=6;else{a>60&&--a;var d=new Date(1900,0,1);d.setDate(d.getDate()+a-1),l=[d.getFullYear(),d.getMonth()+1,d.getDate()],i=d.getDay(),a<60&&(i=(i+6)%7),r&&(i=Dme(d,l))}return o.y=l[0],o.m=l[1],o.d=l[2],o.S=s%60,s=Math.floor(s/60),o.M=s%60,s=Math.floor(s/60),o.H=s,o.q=i,o}var uQ=new Date(1899,11,31,0,0,0),Bme=uQ.getTime(),_me=new Date(1900,2,1,0,0,0);function AQ(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=_me&&(r+=1440*60*1e3),(r-(Bme+(e.getTimezoneOffset()-uQ.getTimezoneOffset())*6e4))/(1440*60*1e3)}function aE(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function Tme(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Fme(e){var t=e<0?12:11,r=aE(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function Ime(e){var t=aE(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function pp(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return t>=-4&&t<=-1?r=e.toPrecision(10+t):Math.abs(t)<=9?r=Fme(e):t===10?r=e.toFixed(10).substr(0,12):r=Ime(e),aE(Tme(r.toUpperCase()))}function Vd(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):pp(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return Ni(14,AQ(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function Dme(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function Ume(e,t,r,a){var s="",i=0,l=0,o=r.y,d,u=0;switch(e){case 98:o=r.y+543;case 121:switch(t.length){case 1:case 2:d=o%100,u=2;break;default:d=o%1e4,u=4;break}break;case 109:switch(t.length){case 1:case 2:d=r.m,u=t.length;break;case 3:return N2[r.m-1][1];case 5:return N2[r.m-1][0];default:return N2[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:d=r.d,u=t.length;break;case 3:return cD[r.q][0];default:return cD[r.q][1]}break;case 104:switch(t.length){case 1:case 2:d=1+(r.H+11)%12,u=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:d=r.H,u=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:d=r.M,u=t.length;break;default:throw"bad minute format: "+t}break;case 115:if(t!="s"&&t!="ss"&&t!=".0"&&t!=".00"&&t!=".000")throw"bad second format: "+t;return r.u===0&&(t=="s"||t=="ss")?Ri(r.S,t.length):(a>=2?l=a===3?1e3:100:l=a===1?10:1,i=Math.round(l*(r.S+r.u)),i>=60*l&&(i=0),t==="s"?i===0?"0":""+i/l:(s=Ri(i,2+a),t==="ss"?s.substr(0,2):"."+s.substr(2,t.length-1)));case 90:switch(t){case"[h]":case"[hh]":d=r.D*24+r.H;break;case"[m]":case"[mm]":d=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":d=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}u=t.length===3?1:2;break;case 101:d=o,u=1;break}var f=u>0?Ri(d,u):"";return f}function yc(e){var t=3;if(e.length<=t)return e;for(var r=e.length%t,a=e.substr(0,r);r!=e.length;r+=t)a+=(a.length>0?",":"")+e.substr(r,t);return a}var fQ=/%/g;function Mme(e,t,r){var a=t.replace(fQ,""),s=t.length-a.length;return co(e,a,r*Math.pow(10,2*s))+ra("%",s)}function Rme(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return co(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function pQ(e,t){var r,a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+pQ(e,-t);var s=e.indexOf(".");s===-1&&(s=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%s;if(i<0&&(i+=s),r=(t/Math.pow(10,i)).toPrecision(a+1+(s+i)%s),r.indexOf("e")===-1){var l=Math.floor(Math.log(t)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(l-r.length+i):r+="E+"+(l-i);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,s)+"."+r.substr(2+s),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,d,u,f){return d+u+f.substr(0,(s+i)%s)+"."+f.substr(i)+"E"})}else r=t.toExponential(a);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var hQ=/# (\?+)( ?)\/( ?)(\d+)/;function Ome(e,t,r){var a=parseInt(e[4],10),s=Math.round(t*a),i=Math.floor(s/a),l=s-i*a,o=a;return r+(i===0?"":""+i)+" "+(l===0?ra(" ",e[1].length+1+e[4].length):rE(l,e[1].length)+e[2]+"/"+e[3]+Ri(o,e[4].length))}function Pme(e,t,r){return r+(t===0?"":""+t)+ra(" ",e[1].length+2+e[4].length)}var xQ=/^#*0*\.([0#]+)/,mQ=/\).*[0#]/,gQ=/\(###\) ###\\?-####/;function zn(e){for(var t="",r,a=0;a!=e.length;++a)switch(r=e.charCodeAt(a)){case 35:break;case 63:t+=" ";break;case 48:t+="0";break;default:t+=String.fromCharCode(r)}return t}function uD(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function AD(e,t){var r=e-Math.floor(e),a=Math.pow(10,t);return t<(""+Math.round(r*a)).length?0:Math.round(r*a)}function Lme(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function Qme(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function si(e,t,r){if(e.charCodeAt(0)===40&&!t.match(mQ)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?si("n",a,r):"("+si("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return Rme(e,t,r);if(t.indexOf("%")!==-1)return Mme(e,t,r);if(t.indexOf("E")!==-1)return pQ(t,r);if(t.charCodeAt(0)===36)return"$"+si(e,t.substr(t.charAt(1)==" "?2:1),r);var s,i,l,o,d=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+qu(d,t.length);if(t.match(/^[#?]+$/))return s=qu(r,0),s==="0"&&(s=""),s.length>t.length?s:zn(t.substr(0,t.length-s.length))+s;if(i=t.match(hQ))return Ome(i,d,u);if(t.match(/^#+0+$/))return u+qu(d,t.length-t.indexOf("0"));if(i=t.match(xQ))return s=uD(r,i[1].length).replace(/^([^\.]+)$/,"$1."+zn(i[1])).replace(/\.$/,"."+zn(i[1])).replace(/\.(\d*)$/,function(b,v){return"."+v+ra("0",zn(i[1]).length-v.length)}),t.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return u+uD(d,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return u+yc(qu(d,0));if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+si(e,t,-r):yc(""+(Math.floor(r)+Lme(r,i[1].length)))+"."+Ri(AD(r,i[1].length),i[1].length);if(i=t.match(/^#,#*,#0/))return si(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return s=vA(si(e,t.replace(/[\\-]/g,""),r)),l=0,vA(vA(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(gQ))return s=si(e,"##########",r),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var f="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(i[4].length,7),o=Qg(d,Math.pow(10,l)-1,!1),s=""+u,f=co("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),s+=f+i[2]+"/"+i[3],f=Pg(o[2],l),f.length<i[4].length&&(f=zn(i[4].substr(i[4].length-f.length))+f),s+=f,s;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(Math.max(i[1].length,i[4].length),7),o=Qg(d,Math.pow(10,l)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?rE(o[1],l)+i[2]+"/"+i[3]+Pg(o[2],l):ra(" ",2*l+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return s=qu(r,0),t.length<=s.length?s:zn(t.substr(0,t.length-s.length))+s;if(i=t.match(/^([#0?]+)\.([#0]+)$/)){s=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),l=s.indexOf(".");var p=t.indexOf(".")-l,x=t.length-s.length-p;return zn(t.substr(0,p)+s+t.substr(t.length-x))}if(i=t.match(/^00,000\.([#0]*0)$/))return l=AD(r,i[1].length),r<0?"-"+si(e,t,-r):yc(Qme(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(b){return"00,"+(b.length<3?Ri(0,3-b.length):"")+b})+"."+Ri(l,i[1].length);switch(t){case"###,##0.00":return si(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var m=yc(qu(d,0));return m!=="0"?u+m:"";case"###,###.00":return si(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return si(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function Hme(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return co(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function zme(e,t,r){var a=t.replace(fQ,""),s=t.length-a.length;return co(e,a,r*Math.pow(10,2*s))+ra("%",s)}function bQ(e,t){var r,a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+bQ(e,-t);var s=e.indexOf(".");s===-1&&(s=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%s;if(i<0&&(i+=s),r=(t/Math.pow(10,i)).toPrecision(a+1+(s+i)%s),!r.match(/[Ee]/)){var l=Math.floor(Math.log(t)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(l-r.length+i):r+="E+"+(l-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,d,u,f){return d+u+f.substr(0,(s+i)%s)+"."+f.substr(i)+"E"})}else r=t.toExponential(a);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function Al(e,t,r){if(e.charCodeAt(0)===40&&!t.match(mQ)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Al("n",a,r):"("+Al("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return Hme(e,t,r);if(t.indexOf("%")!==-1)return zme(e,t,r);if(t.indexOf("E")!==-1)return bQ(t,r);if(t.charCodeAt(0)===36)return"$"+Al(e,t.substr(t.charAt(1)==" "?2:1),r);var s,i,l,o,d=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+Ri(d,t.length);if(t.match(/^[#?]+$/))return s=""+r,r===0&&(s=""),s.length>t.length?s:zn(t.substr(0,t.length-s.length))+s;if(i=t.match(hQ))return Pme(i,d,u);if(t.match(/^#+0+$/))return u+Ri(d,t.length-t.indexOf("0"));if(i=t.match(xQ))return s=(""+r).replace(/^([^\.]+)$/,"$1."+zn(i[1])).replace(/\.$/,"."+zn(i[1])),s=s.replace(/\.(\d*)$/,function(b,v){return"."+v+ra("0",zn(i[1]).length-v.length)}),t.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return u+(""+d).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return u+yc(""+d);if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Al(e,t,-r):yc(""+r)+"."+ra("0",i[1].length);if(i=t.match(/^#,#*,#0/))return Al(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return s=vA(Al(e,t.replace(/[\\-]/g,""),r)),l=0,vA(vA(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(gQ))return s=Al(e,"##########",r),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var f="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(i[4].length,7),o=Qg(d,Math.pow(10,l)-1,!1),s=""+u,f=co("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),s+=f+i[2]+"/"+i[3],f=Pg(o[2],l),f.length<i[4].length&&(f=zn(i[4].substr(i[4].length-f.length))+f),s+=f,s;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(Math.max(i[1].length,i[4].length),7),o=Qg(d,Math.pow(10,l)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?rE(o[1],l)+i[2]+"/"+i[3]+Pg(o[2],l):ra(" ",2*l+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return s=""+r,t.length<=s.length?s:zn(t.substr(0,t.length-s.length))+s;if(i=t.match(/^([#0]+)\.([#0]+)$/)){s=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),l=s.indexOf(".");var p=t.indexOf(".")-l,x=t.length-s.length-p;return zn(t.substr(0,p)+s+t.substr(t.length-x))}if(i=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Al(e,t,-r):yc(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(b){return"00,"+(b.length<3?Ri(0,3-b.length):"")+b})+"."+Ri(0,i[1].length);switch(t){case"###,###":case"##,###":case"#,###":var m=yc(""+d);return m!=="0"?u+m:"";default:if(t.match(/\.[0#?]*$/))return Al(e,t.slice(0,t.lastIndexOf(".")),r)+zn(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function co(e,t,r){return(r|0)===r?Al(e,t,r):si(e,t,r)}function $me(e){for(var t=[],r=!1,a=0,s=0;a<e.length;++a)switch(e.charCodeAt(a)){case 34:r=!r;break;case 95:case 42:case 92:++a;break;case 59:t[t.length]=e.substr(s,a-s),s=a+1}if(t[t.length]=e.substr(s),r===!0)throw new Error("Format |"+e+"| unterminated string ");return t}var vQ=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function e0(e){for(var t=0,r="",a="";t<e.length;)switch(r=e.charAt(t)){case"G":Lg(e,t)&&(t+=6),t++;break;case'"':for(;e.charCodeAt(++t)!==34&&t<e.length;);++t;break;case"\\":t+=2;break;case"_":t+=2;break;case"@":++t;break;case"B":case"b":if(e.charAt(t+1)==="1"||e.charAt(t+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(t,3).toUpperCase()==="A/P"||e.substr(t,5).toUpperCase()==="AM/PM"||e.substr(t,5).toUpperCase()==="上午/下午")return!0;++t;break;case"[":for(a=r;e.charAt(t++)!=="]"&&t<e.length;)a+=e.charAt(t);if(a.match(vQ))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||r=="\\"&&e.charAt(t+1)=="-"&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t,(e.charAt(t)==" "||e.charAt(t)=="*")&&++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;case" ":++t;break;default:++t;break}return!1}function Vme(e,t,r,a){for(var s=[],i="",l=0,o="",d="t",u,f,p,x="H";l<e.length;)switch(o=e.charAt(l)){case"G":if(!Lg(e,l))throw new Error("unrecognized character "+o+" in "+e);s[s.length]={t:"G",v:"General"},l+=7;break;case'"':for(i="";(p=e.charCodeAt(++l))!==34&&l<e.length;)i+=String.fromCharCode(p);s[s.length]={t:"t",v:i},++l;break;case"\\":var m=e.charAt(++l),b=m==="("||m===")"?m:"t";s[s.length]={t:b,v:m},++l;break;case"_":s[s.length]={t:"t",v:" "},l+=2;break;case"@":s[s.length]={t:"T",v:t},++l;break;case"B":case"b":if(e.charAt(l+1)==="1"||e.charAt(l+1)==="2"){if(u==null&&(u=Cd(t,r,e.charAt(l+1)==="2"),u==null))return"";s[s.length]={t:"X",v:e.substr(l,2)},d=o,l+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":o=o.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0||u==null&&(u=Cd(t,r),u==null))return"";for(i=o;++l<e.length&&e.charAt(l).toLowerCase()===o;)i+=o;o==="m"&&d.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=x),s[s.length]={t:o,v:i},d=o;break;case"A":case"a":case"上":var v={t:o,v:o};if(u==null&&(u=Cd(t,r)),e.substr(l,3).toUpperCase()==="A/P"?(u!=null&&(v.v=u.H>=12?"P":"A"),v.t="T",x="h",l+=3):e.substr(l,5).toUpperCase()==="AM/PM"?(u!=null&&(v.v=u.H>=12?"PM":"AM"),v.t="T",l+=5,x="h"):e.substr(l,5).toUpperCase()==="上午/下午"?(u!=null&&(v.v=u.H>=12?"下午":"上午"),v.t="T",l+=5,x="h"):(v.t="t",++l),u==null&&v.t==="T")return"";s[s.length]=v,d=o;break;case"[":for(i=o;e.charAt(l++)!=="]"&&l<e.length;)i+=e.charAt(l);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(vQ)){if(u==null&&(u=Cd(t,r),u==null))return"";s[s.length]={t:"Z",v:i.toLowerCase()},d=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",e0(e)||(s[s.length]={t:"t",v:i}));break;case".":if(u!=null){for(i=o;++l<e.length&&(o=e.charAt(l))==="0";)i+=o;s[s.length]={t:"s",v:i};break}case"0":case"#":for(i=o;++l<e.length&&"0#?.,E+-%".indexOf(o=e.charAt(l))>-1;)i+=o;s[s.length]={t:"n",v:i};break;case"?":for(i=o;e.charAt(++l)===o;)i+=o;s[s.length]={t:o,v:i},d=o;break;case"*":++l,(e.charAt(l)==" "||e.charAt(l)=="*")&&++l;break;case"(":case")":s[s.length]={t:a===1?"t":o,v:o},++l;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=o;l<e.length&&"0123456789".indexOf(e.charAt(++l))>-1;)i+=e.charAt(l);s[s.length]={t:"D",v:i};break;case" ":s[s.length]={t:o,v:o},++l;break;case"$":s[s.length]={t:"t",v:"$"},++l;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+e);s[s.length]={t:"t",v:o},++l;break}var y=0,k=0,_;for(l=s.length-1,d="t";l>=0;--l)switch(s[l].t){case"h":case"H":s[l].t=x,d="h",y<1&&(y=1);break;case"s":(_=s[l].v.match(/\.0+$/))&&(k=Math.max(k,_[0].length-1)),y<3&&(y=3);case"d":case"y":case"M":case"e":d=s[l].t;break;case"m":d==="s"&&(s[l].t="M",y<2&&(y=2));break;case"X":break;case"Z":y<1&&s[l].v.match(/[Hh]/)&&(y=1),y<2&&s[l].v.match(/[Mm]/)&&(y=2),y<3&&s[l].v.match(/[Ss]/)&&(y=3)}switch(y){case 0:break;case 1:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M),u.M>=60&&(u.M=0,++u.H);break;case 2:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M);break}var C="",E;for(l=0;l<s.length;++l)switch(s[l].t){case"t":case"T":case" ":case"D":break;case"X":s[l].v="",s[l].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[l].v=Ume(s[l].t.charCodeAt(0),s[l].v,u,k),s[l].t="t";break;case"n":case"?":for(E=l+1;s[E]!=null&&((o=s[E].t)==="?"||o==="D"||(o===" "||o==="t")&&s[E+1]!=null&&(s[E+1].t==="?"||s[E+1].t==="t"&&s[E+1].v==="/")||s[l].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(s[E].v==="/"||s[E].v===" "&&s[E+1]!=null&&s[E+1].t=="?"));)s[l].v+=s[E].v,s[E]={v:"",t:";"},++E;C+=s[l].v,l=E-1;break;case"G":s[l].t="t",s[l].v=Vd(t,r);break}var T="",B,I;if(C.length>0){C.charCodeAt(0)==40?(B=t<0&&C.charCodeAt(0)===45?-t:t,I=co("n",C,B)):(B=t<0&&a>1?-t:t,I=co("n",C,B),B<0&&s[0]&&s[0].t=="t"&&(I=I.substr(1),s[0].v="-"+s[0].v)),E=I.length-1;var M=s.length;for(l=0;l<s.length;++l)if(s[l]!=null&&s[l].t!="t"&&s[l].v.indexOf(".")>-1){M=l;break}var U=s.length;if(M===s.length&&I.indexOf("E")===-1){for(l=s.length-1;l>=0;--l)s[l]==null||"n?".indexOf(s[l].t)===-1||(E>=s[l].v.length-1?(E-=s[l].v.length,s[l].v=I.substr(E+1,s[l].v.length)):E<0?s[l].v="":(s[l].v=I.substr(0,E+1),E=-1),s[l].t="t",U=l);E>=0&&U<s.length&&(s[U].v=I.substr(0,E+1)+s[U].v)}else if(M!==s.length&&I.indexOf("E")===-1){for(E=I.indexOf(".")-1,l=M;l>=0;--l)if(!(s[l]==null||"n?".indexOf(s[l].t)===-1)){for(f=s[l].v.indexOf(".")>-1&&l===M?s[l].v.indexOf(".")-1:s[l].v.length-1,T=s[l].v.substr(f+1);f>=0;--f)E>=0&&(s[l].v.charAt(f)==="0"||s[l].v.charAt(f)==="#")&&(T=I.charAt(E--)+T);s[l].v=T,s[l].t="t",U=l}for(E>=0&&U<s.length&&(s[U].v=I.substr(0,E+1)+s[U].v),E=I.indexOf(".")+1,l=M;l<s.length;++l)if(!(s[l]==null||"n?(".indexOf(s[l].t)===-1&&l!==M)){for(f=s[l].v.indexOf(".")>-1&&l===M?s[l].v.indexOf(".")+1:0,T=s[l].v.substr(0,f);f<s[l].v.length;++f)E<I.length&&(T+=I.charAt(E++));s[l].v=T,s[l].t="t",U=l}}}for(l=0;l<s.length;++l)s[l]!=null&&"n?".indexOf(s[l].t)>-1&&(B=a>1&&t<0&&l>0&&s[l-1].v==="-"?-t:t,s[l].v=co(s[l].t,s[l].v,B),s[l].t="t");var D="";for(l=0;l!==s.length;++l)s[l]!=null&&(D+=s[l].v);return D}var fD=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function pD(e,t){if(t==null)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function Gme(e,t){var r=$me(e),a=r.length,s=r[a-1].indexOf("@");if(a<4&&s>-1&&--a,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof t!="number")return[4,r.length===4||s>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=s>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=s>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=s>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var i=t>0?r[0]:t<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[a,i];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var l=r[0].match(fD),o=r[1].match(fD);return pD(t,l)?[a,r[0]]:pD(t,o)?[a,r[1]]:[a,r[l!=null&&o!=null?2:1]]}return[a,i]}function Ni(e,t,r){r==null&&(r={});var a="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?a=r.dateNF:a=e;break;case"number":e==14&&r.dateNF?a=r.dateNF:a=(r.table!=null?r.table:gt)[e],a==null&&(a=r.table&&r.table[dD[e]]||gt[dD[e]]),a==null&&(a=Sme[e]||"General");break}if(Lg(a,0))return Vd(t,r);t instanceof Date&&(t=AQ(t,r.date1904));var s=Gme(a,t);if(Lg(s[1]))return Vd(t,r);if(t===!0)t="TRUE";else if(t===!1)t="FALSE";else if(t===""||t==null)return"";return Vme(s[1],t,r,s[0])}function uo(e,t){if(typeof t!="number"){t=+t||-1;for(var r=0;r<392;++r){if(gt[r]==null){t<0&&(t=r);continue}if(gt[r]==e){t=r;break}}t<0&&(t=391)}return gt[t]=e,t}function iv(e){for(var t=0;t!=392;++t)e[t]!==void 0&&uo(e[t],t)}function t0(){gt=Eme()}var Kme={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},yQ=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function qme(e){var t=typeof e=="number"?gt[e]:e;return t=t.replace(yQ,"(\\d+)"),new RegExp("^"+t+"$")}function Wme(e,t,r){var a=-1,s=-1,i=-1,l=-1,o=-1,d=-1;(t.match(yQ)||[]).forEach(function(p,x){var m=parseInt(r[x+1],10);switch(p.toLowerCase().charAt(0)){case"y":a=m;break;case"d":i=m;break;case"h":l=m;break;case"s":d=m;break;case"m":l>=0?o=m:s=m;break}}),d>=0&&o==-1&&s>=0&&(o=s,s=-1);var u=(""+(a>=0?a:new Date().getFullYear())).slice(-4)+"-"+("00"+(s>=1?s:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);u.length==7&&(u="0"+u),u.length==8&&(u="20"+u);var f=("00"+(l>=0?l:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(d>=0?d:0)).slice(-2);return l==-1&&o==-1&&d==-1?u:a==-1&&s==-1&&i==-1?f:u+"T"+f}var Yme=(function(){var e={};e.version="1.2.0";function t(){for(var I=0,M=new Array(256),U=0;U!=256;++U)I=U,I=I&1?-306674912^I>>>1:I>>>1,I=I&1?-306674912^I>>>1:I>>>1,I=I&1?-306674912^I>>>1:I>>>1,I=I&1?-306674912^I>>>1:I>>>1,I=I&1?-306674912^I>>>1:I>>>1,I=I&1?-306674912^I>>>1:I>>>1,I=I&1?-306674912^I>>>1:I>>>1,I=I&1?-306674912^I>>>1:I>>>1,M[U]=I;return typeof Int32Array<"u"?new Int32Array(M):M}var r=t();function a(I){var M=0,U=0,D=0,L=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(D=0;D!=256;++D)L[D]=I[D];for(D=0;D!=256;++D)for(U=I[D],M=256+D;M<4096;M+=256)U=L[M]=U>>>8^I[U&255];var R=[];for(D=1;D!=16;++D)R[D-1]=typeof Int32Array<"u"?L.subarray(D*256,D*256+256):L.slice(D*256,D*256+256);return R}var s=a(r),i=s[0],l=s[1],o=s[2],d=s[3],u=s[4],f=s[5],p=s[6],x=s[7],m=s[8],b=s[9],v=s[10],y=s[11],k=s[12],_=s[13],C=s[14];function E(I,M){for(var U=M^-1,D=0,L=I.length;D<L;)U=U>>>8^r[(U^I.charCodeAt(D++))&255];return~U}function T(I,M){for(var U=M^-1,D=I.length-15,L=0;L<D;)U=C[I[L++]^U&255]^_[I[L++]^U>>8&255]^k[I[L++]^U>>16&255]^y[I[L++]^U>>>24]^v[I[L++]]^b[I[L++]]^m[I[L++]]^x[I[L++]]^p[I[L++]]^f[I[L++]]^u[I[L++]]^d[I[L++]]^o[I[L++]]^l[I[L++]]^i[I[L++]]^r[I[L++]];for(D+=15;L<D;)U=U>>>8^r[(U^I[L++])&255];return~U}function B(I,M){for(var U=M^-1,D=0,L=I.length,R=0,Q=0;D<L;)R=I.charCodeAt(D++),R<128?U=U>>>8^r[(U^R)&255]:R<2048?(U=U>>>8^r[(U^(192|R>>6&31))&255],U=U>>>8^r[(U^(128|R&63))&255]):R>=55296&&R<57344?(R=(R&1023)+64,Q=I.charCodeAt(D++)&1023,U=U>>>8^r[(U^(240|R>>8&7))&255],U=U>>>8^r[(U^(128|R>>2&63))&255],U=U>>>8^r[(U^(128|Q>>6&15|(R&3)<<4))&255],U=U>>>8^r[(U^(128|Q&63))&255]):(U=U>>>8^r[(U^(224|R>>12&15))&255],U=U>>>8^r[(U^(128|R>>6&63))&255],U=U>>>8^r[(U^(128|R&63))&255]);return~U}return e.table=r,e.bstr=E,e.buf=T,e.str=B,e})(),ut=(function(){var t={};t.version="1.2.1";function r(ee,de){for(var se=ee.split("/"),ie=de.split("/"),ue=0,Ae=0,Ne=Math.min(se.length,ie.length);ue<Ne;++ue){if(Ae=se[ue].length-ie[ue].length)return Ae;if(se[ue]!=ie[ue])return se[ue]<ie[ue]?-1:1}return se.length-ie.length}function a(ee){if(ee.charAt(ee.length-1)=="/")return ee.slice(0,-1).indexOf("/")===-1?ee:a(ee.slice(0,-1));var de=ee.lastIndexOf("/");return de===-1?ee:ee.slice(0,de+1)}function s(ee){if(ee.charAt(ee.length-1)=="/")return s(ee.slice(0,-1));var de=ee.lastIndexOf("/");return de===-1?ee:ee.slice(de+1)}function i(ee,de){typeof de=="string"&&(de=new Date(de));var se=de.getHours();se=se<<6|de.getMinutes(),se=se<<5|de.getSeconds()>>>1,ee.write_shift(2,se);var ie=de.getFullYear()-1980;ie=ie<<4|de.getMonth()+1,ie=ie<<5|de.getDate(),ee.write_shift(2,ie)}function l(ee){var de=ee.read_shift(2)&65535,se=ee.read_shift(2)&65535,ie=new Date,ue=se&31;se>>>=5;var Ae=se&15;se>>>=4,ie.setMilliseconds(0),ie.setFullYear(se+1980),ie.setMonth(Ae-1),ie.setDate(ue);var Ne=de&31;de>>>=5;var Me=de&63;return de>>>=6,ie.setHours(de),ie.setMinutes(Me),ie.setSeconds(Ne<<1),ie}function o(ee){xn(ee,0);for(var de={},se=0;ee.l<=ee.length-4;){var ie=ee.read_shift(2),ue=ee.read_shift(2),Ae=ee.l+ue,Ne={};switch(ie){case 21589:se=ee.read_shift(1),se&1&&(Ne.mtime=ee.read_shift(4)),ue>5&&(se&2&&(Ne.atime=ee.read_shift(4)),se&4&&(Ne.ctime=ee.read_shift(4))),Ne.mtime&&(Ne.mt=new Date(Ne.mtime*1e3));break}ee.l=Ae,de[ie]=Ne}return de}var d;function u(){return d||(d={})}function f(ee,de){if(ee[0]==80&&ee[1]==75)return bs(ee,de);if((ee[0]|32)==109&&(ee[1]|32)==105)return $e(ee,de);if(ee.length<512)throw new Error("CFB file size "+ee.length+" < 512");var se=3,ie=512,ue=0,Ae=0,Ne=0,Me=0,Ce=0,Ee=[],Se=ee.slice(0,512);xn(Se,0);var He=p(Se);switch(se=He[0],se){case 3:ie=512;break;case 4:ie=4096;break;case 0:if(He[1]==0)return bs(ee,de);default:throw new Error("Major Version: Expected 3 or 4 saw "+se)}ie!==512&&(Se=ee.slice(0,ie),xn(Se,28));var Ge=ee.slice(0,ie);x(Se,se);var Je=Se.read_shift(4,"i");if(se===3&&Je!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Je);Se.l+=4,Ne=Se.read_shift(4,"i"),Se.l+=4,Se.chk("00100000","Mini Stream Cutoff Size: "),Me=Se.read_shift(4,"i"),ue=Se.read_shift(4,"i"),Ce=Se.read_shift(4,"i"),Ae=Se.read_shift(4,"i");for(var ze=-1,Ye=0;Ye<109&&(ze=Se.read_shift(4,"i"),!(ze<0));++Ye)Ee[Ye]=ze;var it=m(ee,ie);y(Ce,Ae,it,ie,Ee);var yr=_(it,Ne,Ee,ie);yr[Ne].name="!Directory",ue>0&&Me!==Q&&(yr[Me].name="!MiniFAT"),yr[Ee[0]].name="!FAT",yr.fat_addrs=Ee,yr.ssz=ie;var wr={},Ur=[],Vs=[],Wc=[];C(Ne,yr,it,Ur,ue,wr,Vs,Me),b(Vs,Wc,Ur),Ur.shift();var Lo={FileIndex:Vs,FullPaths:Wc};return de&&de.raw&&(Lo.raw={header:Ge,sectors:it}),Lo}function p(ee){if(ee[ee.l]==80&&ee[ee.l+1]==75)return[0,0];ee.chk(G,"Header Signature: "),ee.l+=16;var de=ee.read_shift(2,"u");return[ee.read_shift(2,"u"),de]}function x(ee,de){var se=9;switch(ee.l+=2,se=ee.read_shift(2)){case 9:if(de!=3)throw new Error("Sector Shift: Expected 9 saw "+se);break;case 12:if(de!=4)throw new Error("Sector Shift: Expected 12 saw "+se);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+se)}ee.chk("0600","Mini Sector Shift: "),ee.chk("000000000000","Reserved: ")}function m(ee,de){for(var se=Math.ceil(ee.length/de)-1,ie=[],ue=1;ue<se;++ue)ie[ue-1]=ee.slice(ue*de,(ue+1)*de);return ie[se-1]=ee.slice(se*de),ie}function b(ee,de,se){for(var ie=0,ue=0,Ae=0,Ne=0,Me=0,Ce=se.length,Ee=[],Se=[];ie<Ce;++ie)Ee[ie]=Se[ie]=ie,de[ie]=se[ie];for(;Me<Se.length;++Me)ie=Se[Me],ue=ee[ie].L,Ae=ee[ie].R,Ne=ee[ie].C,Ee[ie]===ie&&(ue!==-1&&Ee[ue]!==ue&&(Ee[ie]=Ee[ue]),Ae!==-1&&Ee[Ae]!==Ae&&(Ee[ie]=Ee[Ae])),Ne!==-1&&(Ee[Ne]=ie),ue!==-1&&ie!=Ee[ie]&&(Ee[ue]=Ee[ie],Se.lastIndexOf(ue)<Me&&Se.push(ue)),Ae!==-1&&ie!=Ee[ie]&&(Ee[Ae]=Ee[ie],Se.lastIndexOf(Ae)<Me&&Se.push(Ae));for(ie=1;ie<Ce;++ie)Ee[ie]===ie&&(Ae!==-1&&Ee[Ae]!==Ae?Ee[ie]=Ee[Ae]:ue!==-1&&Ee[ue]!==ue&&(Ee[ie]=Ee[ue]));for(ie=1;ie<Ce;++ie)if(ee[ie].type!==0){if(Me=ie,Me!=Ee[Me])do Me=Ee[Me],de[ie]=de[Me]+"/"+de[ie];while(Me!==0&&Ee[Me]!==-1&&Me!=Ee[Me]);Ee[ie]=-1}for(de[0]+="/",ie=1;ie<Ce;++ie)ee[ie].type!==2&&(de[ie]+="/")}function v(ee,de,se){for(var ie=ee.start,ue=ee.size,Ae=[],Ne=ie;se&&ue>0&&Ne>=0;)Ae.push(de.slice(Ne*R,Ne*R+R)),ue-=R,Ne=gd(se,Ne*4);return Ae.length===0?Re(0):Xa(Ae).slice(0,ee.size)}function y(ee,de,se,ie,ue){var Ae=Q;if(ee===Q){if(de!==0)throw new Error("DIFAT chain shorter than expected")}else if(ee!==-1){var Ne=se[ee],Me=(ie>>>2)-1;if(!Ne)return;for(var Ce=0;Ce<Me&&(Ae=gd(Ne,Ce*4))!==Q;++Ce)ue.push(Ae);y(gd(Ne,ie-4),de-1,se,ie,ue)}}function k(ee,de,se,ie,ue){var Ae=[],Ne=[];ue||(ue=[]);var Me=ie-1,Ce=0,Ee=0;for(Ce=de;Ce>=0;){ue[Ce]=!0,Ae[Ae.length]=Ce,Ne.push(ee[Ce]);var Se=se[Math.floor(Ce*4/ie)];if(Ee=Ce*4&Me,ie<4+Ee)throw new Error("FAT boundary crossed: "+Ce+" 4 "+ie);if(!ee[Se])break;Ce=gd(ee[Se],Ee)}return{nodes:Ae,data:jD([Ne])}}function _(ee,de,se,ie){var ue=ee.length,Ae=[],Ne=[],Me=[],Ce=[],Ee=ie-1,Se=0,He=0,Ge=0,Je=0;for(Se=0;Se<ue;++Se)if(Me=[],Ge=Se+de,Ge>=ue&&(Ge-=ue),!Ne[Ge]){Ce=[];var ze=[];for(He=Ge;He>=0;){ze[He]=!0,Ne[He]=!0,Me[Me.length]=He,Ce.push(ee[He]);var Ye=se[Math.floor(He*4/ie)];if(Je=He*4&Ee,ie<4+Je)throw new Error("FAT boundary crossed: "+He+" 4 "+ie);if(!ee[Ye]||(He=gd(ee[Ye],Je),ze[He]))break}Ae[Ge]={nodes:Me,data:jD([Ce])}}return Ae}function C(ee,de,se,ie,ue,Ae,Ne,Me){for(var Ce=0,Ee=ie.length?2:0,Se=de[ee].data,He=0,Ge=0,Je;He<Se.length;He+=128){var ze=Se.slice(He,He+128);xn(ze,64),Ge=ze.read_shift(2),Je=dE(ze,0,Ge-Ee),ie.push(Je);var Ye={name:Je,type:ze.read_shift(1),color:ze.read_shift(1),L:ze.read_shift(4,"i"),R:ze.read_shift(4,"i"),C:ze.read_shift(4,"i"),clsid:ze.read_shift(16),state:ze.read_shift(4,"i"),start:0,size:0},it=ze.read_shift(2)+ze.read_shift(2)+ze.read_shift(2)+ze.read_shift(2);it!==0&&(Ye.ct=E(ze,ze.l-8));var yr=ze.read_shift(2)+ze.read_shift(2)+ze.read_shift(2)+ze.read_shift(2);yr!==0&&(Ye.mt=E(ze,ze.l-8)),Ye.start=ze.read_shift(4,"i"),Ye.size=ze.read_shift(4,"i"),Ye.size<0&&Ye.start<0&&(Ye.size=Ye.type=0,Ye.start=Q,Ye.name=""),Ye.type===5?(Ce=Ye.start,ue>0&&Ce!==Q&&(de[Ce].name="!StreamData")):Ye.size>=4096?(Ye.storage="fat",de[Ye.start]===void 0&&(de[Ye.start]=k(se,Ye.start,de.fat_addrs,de.ssz)),de[Ye.start].name=Ye.name,Ye.content=de[Ye.start].data.slice(0,Ye.size)):(Ye.storage="minifat",Ye.size<0?Ye.size=0:Ce!==Q&&Ye.start!==Q&&de[Ce]&&(Ye.content=v(Ye,de[Ce].data,(de[Me]||{}).data))),Ye.content&&xn(Ye.content,0),Ae[Je]=Ye,Ne.push(Ye)}}function E(ee,de){return new Date((Ts(ee,de+4)/1e7*Math.pow(2,32)+Ts(ee,de)/1e7-11644473600)*1e3)}function T(ee,de){return u(),f(d.readFileSync(ee),de)}function B(ee,de){var se=de&&de.type;switch(se||Dt&&Buffer.isBuffer(ee)&&(se="buffer"),se||"base64"){case"file":return T(ee,de);case"base64":return f(Is(Qs(ee)),de);case"binary":return f(Is(ee),de)}return f(ee,de)}function I(ee,de){var se=de||{},ie=se.root||"Root Entry";if(ee.FullPaths||(ee.FullPaths=[]),ee.FileIndex||(ee.FileIndex=[]),ee.FullPaths.length!==ee.FileIndex.length)throw new Error("inconsistent CFB structure");ee.FullPaths.length===0&&(ee.FullPaths[0]=ie+"/",ee.FileIndex[0]={name:ie,type:5}),se.CLSID&&(ee.FileIndex[0].clsid=se.CLSID),M(ee)}function M(ee){var de="Sh33tJ5";if(!ut.find(ee,"/"+de)){var se=Re(4);se[0]=55,se[1]=se[3]=50,se[2]=54,ee.FileIndex.push({name:de,type:2,content:se,size:4,L:69,R:69,C:69}),ee.FullPaths.push(ee.FullPaths[0]+de),U(ee)}}function U(ee,de){I(ee);for(var se=!1,ie=!1,ue=ee.FullPaths.length-1;ue>=0;--ue){var Ae=ee.FileIndex[ue];switch(Ae.type){case 0:ie?se=!0:(ee.FileIndex.pop(),ee.FullPaths.pop());break;case 1:case 2:case 5:ie=!0,isNaN(Ae.R*Ae.L*Ae.C)&&(se=!0),Ae.R>-1&&Ae.L>-1&&Ae.R==Ae.L&&(se=!0);break;default:se=!0;break}}if(!(!se&&!de)){var Ne=new Date(1987,1,19),Me=0,Ce=Object.create?Object.create(null):{},Ee=[];for(ue=0;ue<ee.FullPaths.length;++ue)Ce[ee.FullPaths[ue]]=!0,ee.FileIndex[ue].type!==0&&Ee.push([ee.FullPaths[ue],ee.FileIndex[ue]]);for(ue=0;ue<Ee.length;++ue){var Se=a(Ee[ue][0]);ie=Ce[Se],ie||(Ee.push([Se,{name:s(Se).replace("/",""),type:1,clsid:W,ct:Ne,mt:Ne,content:null}]),Ce[Se]=!0)}for(Ee.sort(function(Je,ze){return r(Je[0],ze[0])}),ee.FullPaths=[],ee.FileIndex=[],ue=0;ue<Ee.length;++ue)ee.FullPaths[ue]=Ee[ue][0],ee.FileIndex[ue]=Ee[ue][1];for(ue=0;ue<Ee.length;++ue){var He=ee.FileIndex[ue],Ge=ee.FullPaths[ue];if(He.name=s(Ge).replace("/",""),He.L=He.R=He.C=-(He.color=1),He.size=He.content?He.content.length:0,He.start=0,He.clsid=He.clsid||W,ue===0)He.C=Ee.length>1?1:-1,He.size=0,He.type=5;else if(Ge.slice(-1)=="/"){for(Me=ue+1;Me<Ee.length&&a(ee.FullPaths[Me])!=Ge;++Me);for(He.C=Me>=Ee.length?-1:Me,Me=ue+1;Me<Ee.length&&a(ee.FullPaths[Me])!=a(Ge);++Me);He.R=Me>=Ee.length?-1:Me,He.type=1}else a(ee.FullPaths[ue+1]||"")==a(Ge)&&(He.R=ue+1),He.type=2}}}function D(ee,de){var se=de||{};if(se.fileType=="mad")return Tt(ee,se);switch(U(ee),se.fileType){case"zip":return Wr(ee,se)}var ie=(function(Je){for(var ze=0,Ye=0,it=0;it<Je.FileIndex.length;++it){var yr=Je.FileIndex[it];if(yr.content){var wr=yr.content.length;wr>0&&(wr<4096?ze+=wr+63>>6:Ye+=wr+511>>9)}}for(var Ur=Je.FullPaths.length+3>>2,Vs=ze+7>>3,Wc=ze+127>>7,Lo=Vs+Ye+Ur+Wc,tl=Lo+127>>7,s0=tl<=109?0:Math.ceil((tl-109)/127);Lo+tl+s0+127>>7>tl;)s0=++tl<=109?0:Math.ceil((tl-109)/127);var Zn=[1,s0,tl,Wc,Ur,Ye,ze,0];return Je.FileIndex[0].size=ze<<6,Zn[7]=(Je.FileIndex[0].start=Zn[0]+Zn[1]+Zn[2]+Zn[3]+Zn[4]+Zn[5])+(Zn[6]+7>>3),Zn})(ee),ue=Re(ie[7]<<9),Ae=0,Ne=0;{for(Ae=0;Ae<8;++Ae)ue.write_shift(1,K[Ae]);for(Ae=0;Ae<8;++Ae)ue.write_shift(2,0);for(ue.write_shift(2,62),ue.write_shift(2,3),ue.write_shift(2,65534),ue.write_shift(2,9),ue.write_shift(2,6),Ae=0;Ae<3;++Ae)ue.write_shift(2,0);for(ue.write_shift(4,0),ue.write_shift(4,ie[2]),ue.write_shift(4,ie[0]+ie[1]+ie[2]+ie[3]-1),ue.write_shift(4,0),ue.write_shift(4,4096),ue.write_shift(4,ie[3]?ie[0]+ie[1]+ie[2]-1:Q),ue.write_shift(4,ie[3]),ue.write_shift(-4,ie[1]?ie[0]-1:Q),ue.write_shift(4,ie[1]),Ae=0;Ae<109;++Ae)ue.write_shift(-4,Ae<ie[2]?ie[1]+Ae:-1)}if(ie[1])for(Ne=0;Ne<ie[1];++Ne){for(;Ae<236+Ne*127;++Ae)ue.write_shift(-4,Ae<ie[2]?ie[1]+Ae:-1);ue.write_shift(-4,Ne===ie[1]-1?Q:Ne+1)}var Me=function(Je){for(Ne+=Je;Ae<Ne-1;++Ae)ue.write_shift(-4,Ae+1);Je&&(++Ae,ue.write_shift(-4,Q))};for(Ne=Ae=0,Ne+=ie[1];Ae<Ne;++Ae)ue.write_shift(-4,z.DIFSECT);for(Ne+=ie[2];Ae<Ne;++Ae)ue.write_shift(-4,z.FATSECT);Me(ie[3]),Me(ie[4]);for(var Ce=0,Ee=0,Se=ee.FileIndex[0];Ce<ee.FileIndex.length;++Ce)Se=ee.FileIndex[Ce],Se.content&&(Ee=Se.content.length,!(Ee<4096)&&(Se.start=Ne,Me(Ee+511>>9)));for(Me(ie[6]+7>>3);ue.l&511;)ue.write_shift(-4,z.ENDOFCHAIN);for(Ne=Ae=0,Ce=0;Ce<ee.FileIndex.length;++Ce)Se=ee.FileIndex[Ce],Se.content&&(Ee=Se.content.length,!(!Ee||Ee>=4096)&&(Se.start=Ne,Me(Ee+63>>6)));for(;ue.l&511;)ue.write_shift(-4,z.ENDOFCHAIN);for(Ae=0;Ae<ie[4]<<2;++Ae){var He=ee.FullPaths[Ae];if(!He||He.length===0){for(Ce=0;Ce<17;++Ce)ue.write_shift(4,0);for(Ce=0;Ce<3;++Ce)ue.write_shift(4,-1);for(Ce=0;Ce<12;++Ce)ue.write_shift(4,0);continue}Se=ee.FileIndex[Ae],Ae===0&&(Se.start=Se.size?Se.start-1:Q);var Ge=Ae===0&&se.root||Se.name;if(Ee=2*(Ge.length+1),ue.write_shift(64,Ge,"utf16le"),ue.write_shift(2,Ee),ue.write_shift(1,Se.type),ue.write_shift(1,Se.color),ue.write_shift(-4,Se.L),ue.write_shift(-4,Se.R),ue.write_shift(-4,Se.C),Se.clsid)ue.write_shift(16,Se.clsid,"hex");else for(Ce=0;Ce<4;++Ce)ue.write_shift(4,0);ue.write_shift(4,Se.state||0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,Se.start),ue.write_shift(4,Se.size),ue.write_shift(4,0)}for(Ae=1;Ae<ee.FileIndex.length;++Ae)if(Se=ee.FileIndex[Ae],Se.size>=4096)if(ue.l=Se.start+1<<9,Dt&&Buffer.isBuffer(Se.content))Se.content.copy(ue,ue.l,0,Se.size),ue.l+=Se.size+511&-512;else{for(Ce=0;Ce<Se.size;++Ce)ue.write_shift(1,Se.content[Ce]);for(;Ce&511;++Ce)ue.write_shift(1,0)}for(Ae=1;Ae<ee.FileIndex.length;++Ae)if(Se=ee.FileIndex[Ae],Se.size>0&&Se.size<4096)if(Dt&&Buffer.isBuffer(Se.content))Se.content.copy(ue,ue.l,0,Se.size),ue.l+=Se.size+63&-64;else{for(Ce=0;Ce<Se.size;++Ce)ue.write_shift(1,Se.content[Ce]);for(;Ce&63;++Ce)ue.write_shift(1,0)}if(Dt)ue.l=ue.length;else for(;ue.l<ue.length;)ue.write_shift(1,0);return ue}function L(ee,de){var se=ee.FullPaths.map(function(Ce){return Ce.toUpperCase()}),ie=se.map(function(Ce){var Ee=Ce.split("/");return Ee[Ee.length-(Ce.slice(-1)=="/"?2:1)]}),ue=!1;de.charCodeAt(0)===47?(ue=!0,de=se[0].slice(0,-1)+de):ue=de.indexOf("/")!==-1;var Ae=de.toUpperCase(),Ne=ue===!0?se.indexOf(Ae):ie.indexOf(Ae);if(Ne!==-1)return ee.FileIndex[Ne];var Me=!Ae.match(yf);for(Ae=Ae.replace(Kn,""),Me&&(Ae=Ae.replace(yf,"!")),Ne=0;Ne<se.length;++Ne)if((Me?se[Ne].replace(yf,"!"):se[Ne]).replace(Kn,"")==Ae||(Me?ie[Ne].replace(yf,"!"):ie[Ne]).replace(Kn,"")==Ae)return ee.FileIndex[Ne];return null}var R=64,Q=-2,G="d0cf11e0a1b11ae1",K=[208,207,17,224,161,177,26,225],W="00000000000000000000000000000000",z={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:Q,FREESECT:-1,HEADER_SIGNATURE:G,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:W,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Z(ee,de,se){u();var ie=D(ee,se);d.writeFileSync(de,ie)}function Y(ee){for(var de=new Array(ee.length),se=0;se<ee.length;++se)de[se]=String.fromCharCode(ee[se]);return de.join("")}function te(ee,de){var se=D(ee,de);switch(de&&de.type||"buffer"){case"file":return u(),d.writeFileSync(de.filename,se),se;case"binary":return typeof se=="string"?se:Y(se);case"base64":return fp(typeof se=="string"?se:Y(se));case"buffer":if(Dt)return Buffer.isBuffer(se)?se:Mo(se);case"array":return typeof se=="string"?Is(se):se}return se}var O;function P(ee){try{var de=ee.InflateRaw,se=new de;if(se._processChunk(new Uint8Array([3,0]),se._finishFlushFlag),se.bytesRead)O=ee;else throw new Error("zlib does not expose bytesRead")}catch(ie){console.error("cannot use native zlib: "+(ie.message||ie))}}function q(ee,de){if(!O)return $s(ee,de);var se=O.InflateRaw,ie=new se,ue=ie._processChunk(ee.slice(ee.l),ie._finishFlushFlag);return ee.l+=ie.bytesRead,ue}function H(ee){return O?O.deflateRawSync(ee):rt(ee)}var J=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ae=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],oe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ce(ee){var de=(ee<<1|ee<<11)&139536|(ee<<5|ee<<15)&558144;return(de>>16|de>>8|de)&255}for(var ne=typeof Uint8Array<"u",le=ne?new Uint8Array(256):[],ge=0;ge<256;++ge)le[ge]=ce(ge);function X(ee,de){var se=le[ee&255];return de<=8?se>>>8-de:(se=se<<8|le[ee>>8&255],de<=16?se>>>16-de:(se=se<<8|le[ee>>16&255],se>>>24-de))}function pe(ee,de){var se=de&7,ie=de>>>3;return(ee[ie]|(se<=6?0:ee[ie+1]<<8))>>>se&3}function be(ee,de){var se=de&7,ie=de>>>3;return(ee[ie]|(se<=5?0:ee[ie+1]<<8))>>>se&7}function me(ee,de){var se=de&7,ie=de>>>3;return(ee[ie]|(se<=4?0:ee[ie+1]<<8))>>>se&15}function _e(ee,de){var se=de&7,ie=de>>>3;return(ee[ie]|(se<=3?0:ee[ie+1]<<8))>>>se&31}function Te(ee,de){var se=de&7,ie=de>>>3;return(ee[ie]|(se<=1?0:ee[ie+1]<<8))>>>se&127}function Xe(ee,de,se){var ie=de&7,ue=de>>>3,Ae=(1<<se)-1,Ne=ee[ue]>>>ie;return se<8-ie||(Ne|=ee[ue+1]<<8-ie,se<16-ie)||(Ne|=ee[ue+2]<<16-ie,se<24-ie)||(Ne|=ee[ue+3]<<24-ie),Ne&Ae}function At(ee,de,se){var ie=de&7,ue=de>>>3;return ie<=5?ee[ue]|=(se&7)<<ie:(ee[ue]|=se<<ie&255,ee[ue+1]=(se&7)>>8-ie),de+3}function kt(ee,de,se){var ie=de&7,ue=de>>>3;return se=(se&1)<<ie,ee[ue]|=se,de+1}function Bt(ee,de,se){var ie=de&7,ue=de>>>3;return se<<=ie,ee[ue]|=se&255,se>>>=8,ee[ue+1]=se,de+8}function Kr(ee,de,se){var ie=de&7,ue=de>>>3;return se<<=ie,ee[ue]|=se&255,se>>>=8,ee[ue+1]=se&255,ee[ue+2]=se>>>8,de+16}function qr(ee,de){var se=ee.length,ie=2*se>de?2*se:de+5,ue=0;if(se>=de)return ee;if(Dt){var Ae=lD(ie);if(ee.copy)ee.copy(Ae);else for(;ue<ee.length;++ue)Ae[ue]=ee[ue];return Ae}else if(ne){var Ne=new Uint8Array(ie);if(Ne.set)Ne.set(ee);else for(;ue<se;++ue)Ne[ue]=ee[ue];return Ne}return ee.length=ie,ee}function _t(ee){for(var de=new Array(ee),se=0;se<ee;++se)de[se]=0;return de}function Ir(ee,de,se){var ie=1,ue=0,Ae=0,Ne=0,Me=0,Ce=ee.length,Ee=ne?new Uint16Array(32):_t(32);for(Ae=0;Ae<32;++Ae)Ee[Ae]=0;for(Ae=Ce;Ae<se;++Ae)ee[Ae]=0;Ce=ee.length;var Se=ne?new Uint16Array(Ce):_t(Ce);for(Ae=0;Ae<Ce;++Ae)Ee[ue=ee[Ae]]++,ie<ue&&(ie=ue),Se[Ae]=0;for(Ee[0]=0,Ae=1;Ae<=ie;++Ae)Ee[Ae+16]=Me=Me+Ee[Ae-1]<<1;for(Ae=0;Ae<Ce;++Ae)Me=ee[Ae],Me!=0&&(Se[Ae]=Ee[Me+16]++);var He=0;for(Ae=0;Ae<Ce;++Ae)if(He=ee[Ae],He!=0)for(Me=X(Se[Ae],ie)>>ie-He,Ne=(1<<ie+4-He)-1;Ne>=0;--Ne)de[Me|Ne<<He]=He&15|Ae<<4;return ie}var vr=ne?new Uint16Array(512):_t(512),Fa=ne?new Uint16Array(32):_t(32);if(!ne){for(var xt=0;xt<512;++xt)vr[xt]=0;for(xt=0;xt<32;++xt)Fa[xt]=0}(function(){for(var ee=[],de=0;de<32;de++)ee.push(5);Ir(ee,Fa,32);var se=[];for(de=0;de<=143;de++)se.push(8);for(;de<=255;de++)se.push(9);for(;de<=279;de++)se.push(7);for(;de<=287;de++)se.push(8);Ir(se,vr,288)})();var dr=(function(){for(var de=ne?new Uint8Array(32768):[],se=0,ie=0;se<oe.length-1;++se)for(;ie<oe[se+1];++ie)de[ie]=se;for(;ie<32768;++ie)de[ie]=29;var ue=ne?new Uint8Array(259):[];for(se=0,ie=0;se<ae.length-1;++se)for(;ie<ae[se+1];++ie)ue[ie]=se;function Ae(Me,Ce){for(var Ee=0;Ee<Me.length;){var Se=Math.min(65535,Me.length-Ee),He=Ee+Se==Me.length;for(Ce.write_shift(1,+He),Ce.write_shift(2,Se),Ce.write_shift(2,~Se&65535);Se-- >0;)Ce[Ce.l++]=Me[Ee++]}return Ce.l}function Ne(Me,Ce){for(var Ee=0,Se=0,He=ne?new Uint16Array(32768):[];Se<Me.length;){var Ge=Math.min(65535,Me.length-Se);if(Ge<10){for(Ee=At(Ce,Ee,+(Se+Ge==Me.length)),Ee&7&&(Ee+=8-(Ee&7)),Ce.l=Ee/8|0,Ce.write_shift(2,Ge),Ce.write_shift(2,~Ge&65535);Ge-- >0;)Ce[Ce.l++]=Me[Se++];Ee=Ce.l*8;continue}Ee=At(Ce,Ee,+(Se+Ge==Me.length)+2);for(var Je=0;Ge-- >0;){var ze=Me[Se];Je=(Je<<5^ze)&32767;var Ye=-1,it=0;if((Ye=He[Je])&&(Ye|=Se&-32768,Ye>Se&&(Ye-=32768),Ye<Se))for(;Me[Ye+it]==Me[Se+it]&&it<250;)++it;if(it>2){ze=ue[it],ze<=22?Ee=Bt(Ce,Ee,le[ze+1]>>1)-1:(Bt(Ce,Ee,3),Ee+=5,Bt(Ce,Ee,le[ze-23]>>5),Ee+=3);var yr=ze<8?0:ze-4>>2;yr>0&&(Kr(Ce,Ee,it-ae[ze]),Ee+=yr),ze=de[Se-Ye],Ee=Bt(Ce,Ee,le[ze]>>3),Ee-=3;var wr=ze<4?0:ze-2>>1;wr>0&&(Kr(Ce,Ee,Se-Ye-oe[ze]),Ee+=wr);for(var Ur=0;Ur<it;++Ur)He[Je]=Se&32767,Je=(Je<<5^Me[Se])&32767,++Se;Ge-=it-1}else ze<=143?ze=ze+48:Ee=kt(Ce,Ee,1),Ee=Bt(Ce,Ee,le[ze]),He[Je]=Se&32767,++Se}Ee=Bt(Ce,Ee,0)-1}return Ce.l=(Ee+7)/8|0,Ce.l}return function(Ce,Ee){return Ce.length<8?Ae(Ce,Ee):Ne(Ce,Ee)}})();function rt(ee){var de=Re(50+Math.floor(ee.length*1.1)),se=dr(ee,de);return de.slice(0,se)}var Ct=ne?new Uint16Array(32768):_t(32768),Vt=ne?new Uint16Array(32768):_t(32768),jt=ne?new Uint16Array(128):_t(128),er=1,Dr=1;function zr(ee,de){var se=_e(ee,de)+257;de+=5;var ie=_e(ee,de)+1;de+=5;var ue=me(ee,de)+4;de+=4;for(var Ae=0,Ne=ne?new Uint8Array(19):_t(19),Me=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],Ce=1,Ee=ne?new Uint8Array(8):_t(8),Se=ne?new Uint8Array(8):_t(8),He=Ne.length,Ge=0;Ge<ue;++Ge)Ne[J[Ge]]=Ae=be(ee,de),Ce<Ae&&(Ce=Ae),Ee[Ae]++,de+=3;var Je=0;for(Ee[0]=0,Ge=1;Ge<=Ce;++Ge)Se[Ge]=Je=Je+Ee[Ge-1]<<1;for(Ge=0;Ge<He;++Ge)(Je=Ne[Ge])!=0&&(Me[Ge]=Se[Je]++);var ze=0;for(Ge=0;Ge<He;++Ge)if(ze=Ne[Ge],ze!=0){Je=le[Me[Ge]]>>8-ze;for(var Ye=(1<<7-ze)-1;Ye>=0;--Ye)jt[Je|Ye<<ze]=ze&7|Ge<<3}var it=[];for(Ce=1;it.length<se+ie;)switch(Je=jt[Te(ee,de)],de+=Je&7,Je>>>=3){case 16:for(Ae=3+pe(ee,de),de+=2,Je=it[it.length-1];Ae-- >0;)it.push(Je);break;case 17:for(Ae=3+be(ee,de),de+=3;Ae-- >0;)it.push(0);break;case 18:for(Ae=11+Te(ee,de),de+=7;Ae-- >0;)it.push(0);break;default:it.push(Je),Ce<Je&&(Ce=Je);break}var yr=it.slice(0,se),wr=it.slice(se);for(Ge=se;Ge<286;++Ge)yr[Ge]=0;for(Ge=ie;Ge<30;++Ge)wr[Ge]=0;return er=Ir(yr,Ct,286),Dr=Ir(wr,Vt,30),de}function Jn(ee,de){if(ee[0]==3&&!(ee[1]&3))return[Ic(de),2];for(var se=0,ie=0,ue=lD(de||1<<18),Ae=0,Ne=ue.length>>>0,Me=0,Ce=0;(ie&1)==0;){if(ie=be(ee,se),se+=3,ie>>>1)ie>>1==1?(Me=9,Ce=5):(se=zr(ee,se),Me=er,Ce=Dr);else{se&7&&(se+=8-(se&7));var Ee=ee[se>>>3]|ee[(se>>>3)+1]<<8;if(se+=32,Ee>0)for(!de&&Ne<Ae+Ee&&(ue=qr(ue,Ae+Ee),Ne=ue.length);Ee-- >0;)ue[Ae++]=ee[se>>>3],se+=8;continue}for(;;){!de&&Ne<Ae+32767&&(ue=qr(ue,Ae+32767),Ne=ue.length);var Se=Xe(ee,se,Me),He=ie>>>1==1?vr[Se]:Ct[Se];if(se+=He&15,He>>>=4,(He>>>8&255)===0)ue[Ae++]=He;else{if(He==256)break;He-=257;var Ge=He<8?0:He-4>>2;Ge>5&&(Ge=0);var Je=Ae+ae[He];Ge>0&&(Je+=Xe(ee,se,Ge),se+=Ge),Se=Xe(ee,se,Ce),He=ie>>>1==1?Fa[Se]:Vt[Se],se+=He&15,He>>>=4;var ze=He<4?0:He-2>>1,Ye=oe[He];for(ze>0&&(Ye+=Xe(ee,se,ze),se+=ze),!de&&Ne<Je&&(ue=qr(ue,Je+100),Ne=ue.length);Ae<Je;)ue[Ae]=ue[Ae-Ye],++Ae}}}return de?[ue,se+7>>>3]:[ue.slice(0,Ae),se+7>>>3]}function $s(ee,de){var se=ee.slice(ee.l||0),ie=Jn(se,de);return ee.l+=ie[1],ie[0]}function Zi(ee,de){if(ee)typeof console<"u"&&console.error(de);else throw new Error(de)}function bs(ee,de){var se=ee;xn(se,0);var ie=[],ue=[],Ae={FileIndex:ie,FullPaths:ue};I(Ae,{root:de.root});for(var Ne=se.length-4;(se[Ne]!=80||se[Ne+1]!=75||se[Ne+2]!=5||se[Ne+3]!=6)&&Ne>=0;)--Ne;se.l=Ne+4,se.l+=4;var Me=se.read_shift(2);se.l+=6;var Ce=se.read_shift(4);for(se.l=Ce,Ne=0;Ne<Me;++Ne){se.l+=20;var Ee=se.read_shift(4),Se=se.read_shift(4),He=se.read_shift(2),Ge=se.read_shift(2),Je=se.read_shift(2);se.l+=8;var ze=se.read_shift(4),Ye=o(se.slice(se.l+He,se.l+He+Ge));se.l+=He+Ge+Je;var it=se.l;se.l=ze+4,ji(se,Ee,Se,Ae,Ye),se.l=it}return Ae}function ji(ee,de,se,ie,ue){ee.l+=2;var Ae=ee.read_shift(2),Ne=ee.read_shift(2),Me=l(ee);if(Ae&8257)throw new Error("Unsupported ZIP encryption");for(var Ce=ee.read_shift(4),Ee=ee.read_shift(4),Se=ee.read_shift(4),He=ee.read_shift(2),Ge=ee.read_shift(2),Je="",ze=0;ze<He;++ze)Je+=String.fromCharCode(ee[ee.l++]);if(Ge){var Ye=o(ee.slice(ee.l,ee.l+Ge));(Ye[21589]||{}).mt&&(Me=Ye[21589].mt),((ue||{})[21589]||{}).mt&&(Me=ue[21589].mt)}ee.l+=Ge;var it=ee.slice(ee.l,ee.l+Ee);switch(Ne){case 8:it=q(ee,Se);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+Ne)}var yr=!1;Ae&8&&(Ce=ee.read_shift(4),Ce==134695760&&(Ce=ee.read_shift(4),yr=!0),Ee=ee.read_shift(4),Se=ee.read_shift(4)),Ee!=de&&Zi(yr,"Bad compressed size: "+de+" != "+Ee),Se!=se&&Zi(yr,"Bad uncompressed size: "+se+" != "+Se),Ia(ie,Je,it,{unsafe:!0,mt:Me})}function Wr(ee,de){var se=de||{},ie=[],ue=[],Ae=Re(1),Ne=se.compression?8:0,Me=0,Ce=0,Ee=0,Se=0,He=0,Ge=ee.FullPaths[0],Je=Ge,ze=ee.FileIndex[0],Ye=[],it=0;for(Ce=1;Ce<ee.FullPaths.length;++Ce)if(Je=ee.FullPaths[Ce].slice(Ge.length),ze=ee.FileIndex[Ce],!(!ze.size||!ze.content||Je=="Sh33tJ5")){var yr=Se,wr=Re(Je.length);for(Ee=0;Ee<Je.length;++Ee)wr.write_shift(1,Je.charCodeAt(Ee)&127);wr=wr.slice(0,wr.l),Ye[He]=Yme.buf(ze.content,0);var Ur=ze.content;Ne==8&&(Ur=H(Ur)),Ae=Re(30),Ae.write_shift(4,67324752),Ae.write_shift(2,20),Ae.write_shift(2,Me),Ae.write_shift(2,Ne),ze.mt?i(Ae,ze.mt):Ae.write_shift(4,0),Ae.write_shift(-4,Ye[He]),Ae.write_shift(4,Ur.length),Ae.write_shift(4,ze.content.length),Ae.write_shift(2,wr.length),Ae.write_shift(2,0),Se+=Ae.length,ie.push(Ae),Se+=wr.length,ie.push(wr),Se+=Ur.length,ie.push(Ur),Ae=Re(46),Ae.write_shift(4,33639248),Ae.write_shift(2,0),Ae.write_shift(2,20),Ae.write_shift(2,Me),Ae.write_shift(2,Ne),Ae.write_shift(4,0),Ae.write_shift(-4,Ye[He]),Ae.write_shift(4,Ur.length),Ae.write_shift(4,ze.content.length),Ae.write_shift(2,wr.length),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(4,0),Ae.write_shift(4,yr),it+=Ae.l,ue.push(Ae),it+=wr.length,ue.push(wr),++He}return Ae=Re(22),Ae.write_shift(4,101010256),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(2,He),Ae.write_shift(2,He),Ae.write_shift(4,it),Ae.write_shift(4,Se),Ae.write_shift(2,0),Xa([Xa(ie),Xa(ue),Ae])}var sn={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function el(ee,de){if(ee.ctype)return ee.ctype;var se=ee.name||"",ie=se.match(/\.([^\.]+)$/);return ie&&sn[ie[1]]||de&&(ie=(se=de).match(/[\.\\]([^\.\\])+$/),ie&&sn[ie[1]])?sn[ie[1]]:"application/octet-stream"}function Ei(ee){for(var de=fp(ee),se=[],ie=0;ie<de.length;ie+=76)se.push(de.slice(ie,ie+76));return se.join(`\r
`)+`\r
`}function qc(ee){var de=ee.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(Ee){var Se=Ee.charCodeAt(0).toString(16).toUpperCase();return"="+(Se.length==1?"0"+Se:Se)});de=de.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),de.charAt(0)==`
`&&(de="=0D"+de.slice(1)),de=de.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var se=[],ie=de.split(`\r
`),ue=0;ue<ie.length;++ue){var Ae=ie[ue];if(Ae.length==0){se.push("");continue}for(var Ne=0;Ne<Ae.length;){var Me=76,Ce=Ae.slice(Ne,Ne+Me);Ce.charAt(Me-1)=="="?Me--:Ce.charAt(Me-2)=="="?Me-=2:Ce.charAt(Me-3)=="="&&(Me-=3),Ce=Ae.slice(Ne,Ne+Me),Ne+=Me,Ne<Ae.length&&(Ce+="="),se.push(Ce)}}return se.join(`\r
`)}function Po(ee){for(var de=[],se=0;se<ee.length;++se){for(var ie=ee[se];se<=ee.length&&ie.charAt(ie.length-1)=="=";)ie=ie.slice(0,ie.length-1)+ee[++se];de.push(ie)}for(var ue=0;ue<de.length;++ue)de[ue]=de[ue].replace(/[=][0-9A-Fa-f]{2}/g,function(Ae){return String.fromCharCode(parseInt(Ae.slice(1),16))});return Is(de.join(`\r
`))}function Dl(ee,de,se){for(var ie="",ue="",Ae="",Ne,Me=0;Me<10;++Me){var Ce=de[Me];if(!Ce||Ce.match(/^\s*$/))break;var Ee=Ce.match(/^(.*?):\s*([^\s].*)$/);if(Ee)switch(Ee[1].toLowerCase()){case"content-location":ie=Ee[2].trim();break;case"content-type":Ae=Ee[2].trim();break;case"content-transfer-encoding":ue=Ee[2].trim();break}}switch(++Me,ue.toLowerCase()){case"base64":Ne=Is(Qs(de.slice(Me).join("")));break;case"quoted-printable":Ne=Po(de.slice(Me));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+ue)}var Se=Ia(ee,ie.slice(se.length),Ne,{unsafe:!0});Ae&&(Se.ctype=Ae)}function $e(ee,de){if(Y(ee.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var se=de&&de.root||"",ie=(Dt&&Buffer.isBuffer(ee)?ee.toString("binary"):Y(ee)).split(`\r
`),ue=0,Ae="";for(ue=0;ue<ie.length;++ue)if(Ae=ie[ue],!!/^Content-Location:/i.test(Ae)&&(Ae=Ae.slice(Ae.indexOf("file")),se||(se=Ae.slice(0,Ae.lastIndexOf("/")+1)),Ae.slice(0,se.length)!=se))for(;se.length>0&&(se=se.slice(0,se.length-1),se=se.slice(0,se.lastIndexOf("/")+1),Ae.slice(0,se.length)!=se););var Ne=(ie[1]||"").match(/boundary="(.*?)"/);if(!Ne)throw new Error("MAD cannot find boundary");var Me="--"+(Ne[1]||""),Ce=[],Ee=[],Se={FileIndex:Ce,FullPaths:Ee};I(Se);var He,Ge=0;for(ue=0;ue<ie.length;++ue){var Je=ie[ue];Je!==Me&&Je!==Me+"--"||(Ge++&&Dl(Se,ie.slice(He,ue),se),He=ue)}return Se}function Tt(ee,de){var se=de||{},ie=se.boundary||"SheetJS";ie="------="+ie;for(var ue=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+ie.slice(2)+'"',"","",""],Ae=ee.FullPaths[0],Ne=Ae,Me=ee.FileIndex[0],Ce=1;Ce<ee.FullPaths.length;++Ce)if(Ne=ee.FullPaths[Ce].slice(Ae.length),Me=ee.FileIndex[Ce],!(!Me.size||!Me.content||Ne=="Sh33tJ5")){Ne=Ne.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(it){return"_x"+it.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(it){return"_u"+it.charCodeAt(0).toString(16)+"_"});for(var Ee=Me.content,Se=Dt&&Buffer.isBuffer(Ee)?Ee.toString("binary"):Y(Ee),He=0,Ge=Math.min(1024,Se.length),Je=0,ze=0;ze<=Ge;++ze)(Je=Se.charCodeAt(ze))>=32&&Je<128&&++He;var Ye=He>=Ge*4/5;ue.push(ie),ue.push("Content-Location: "+(se.root||"file:///C:/SheetJS/")+Ne),ue.push("Content-Transfer-Encoding: "+(Ye?"quoted-printable":"base64")),ue.push("Content-Type: "+el(Me,Ne)),ue.push(""),ue.push(Ye?qc(Se):Ei(Se))}return ue.push(ie+`--\r
`),ue.join(`\r
`)}function Yr(ee){var de={};return I(de,ee),de}function Ia(ee,de,se,ie){var ue=ie&&ie.unsafe;ue||I(ee);var Ae=!ue&&ut.find(ee,de);if(!Ae){var Ne=ee.FullPaths[0];de.slice(0,Ne.length)==Ne?Ne=de:(Ne.slice(-1)!="/"&&(Ne+="/"),Ne=(Ne+de).replace("//","/")),Ae={name:s(de),type:2},ee.FileIndex.push(Ae),ee.FullPaths.push(Ne),ue||ut.utils.cfb_gc(ee)}return Ae.content=se,Ae.size=se?se.length:0,ie&&(ie.CLSID&&(Ae.clsid=ie.CLSID),ie.mt&&(Ae.mt=ie.mt),ie.ct&&(Ae.ct=ie.ct)),Ae}function xe(ee,de){I(ee);var se=ut.find(ee,de);if(se){for(var ie=0;ie<ee.FileIndex.length;++ie)if(ee.FileIndex[ie]==se)return ee.FileIndex.splice(ie,1),ee.FullPaths.splice(ie,1),!0}return!1}function qe(ee,de,se){I(ee);var ie=ut.find(ee,de);if(ie){for(var ue=0;ue<ee.FileIndex.length;++ue)if(ee.FileIndex[ue]==ie)return ee.FileIndex[ue].name=s(se),ee.FullPaths[ue]=se,!0}return!1}function et(ee){U(ee,!0)}return t.find=L,t.read=B,t.parse=f,t.write=te,t.writeFile=Z,t.utils={cfb_new:Yr,cfb_add:Ia,cfb_del:xe,cfb_mov:qe,cfb_gc:et,ReadShift:Tf,CheckField:zQ,prep_blob:xn,bconcat:Xa,use_zlib:P,_deflateRaw:rt,_inflateRaw:$s,consts:z},t})();function Xme(e){return typeof e=="string"?sv(e):Array.isArray(e)?Nme(e):e}function Yp(e,t,r){if(typeof Deno<"u"){if(r&&typeof t=="string")switch(r){case"utf8":t=new TextEncoder(r).encode(t);break;case"binary":t=sv(t);break;default:throw new Error("Unsupported encoding "+r)}return Deno.writeFileSync(e,t)}var a=r=="utf8"?ml(t):t;if(typeof IE_SaveFile<"u")return IE_SaveFile(a,e);if(typeof Blob<"u"){var s=new Blob([Xme(a)],{type:"application/octet-stream"});if(typeof navigator<"u"&&navigator.msSaveBlob)return navigator.msSaveBlob(s,e);if(typeof saveAs<"u")return saveAs(s,e);if(typeof URL<"u"&&typeof document<"u"&&document.createElement&&URL.createObjectURL){var i=URL.createObjectURL(s);if(typeof chrome=="object"&&typeof(chrome.downloads||{}).download=="function")return URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),chrome.downloads.download({url:i,filename:e,saveAs:!0});var l=document.createElement("a");if(l.download!=null)return l.download=e,l.href=i,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),i}}if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var o=File(e);return o.open("w"),o.encoding="binary",Array.isArray(t)&&(t=Vc(t)),o.write(t),o.close(),t}catch(d){if(!d.message||!d.message.match(/onstruct/))throw d}throw new Error("cannot save file "+e)}function Jme(e){if(typeof Deno<"u")return Deno.readFileSync(e);if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var t=File(e);t.open("r"),t.encoding="binary";var r=t.read();return t.close(),r}catch(a){if(!a.message||!a.message.match(/onstruct/))throw a}throw new Error("Cannot access file "+e)}function oa(e){for(var t=Object.keys(e),r=[],a=0;a<t.length;++a)Object.prototype.hasOwnProperty.call(e,t[a])&&r.push(t[a]);return r}function hD(e,t){for(var r=[],a=oa(e),s=0;s!==a.length;++s)r[e[a[s]][t]]==null&&(r[e[a[s]][t]]=a[s]);return r}function lv(e){for(var t=[],r=oa(e),a=0;a!==r.length;++a)t[e[r[a]]]=r[a];return t}function ov(e){for(var t=[],r=oa(e),a=0;a!==r.length;++a)t[e[r[a]]]=parseInt(r[a],10);return t}function Zme(e){for(var t=[],r=oa(e),a=0;a!==r.length;++a)t[e[r[a]]]==null&&(t[e[r[a]]]=[]),t[e[r[a]]].push(r[a]);return t}var Hg=new Date(1899,11,30,0,0,0);function Qa(e,t){var r=e.getTime(),a=Hg.getTime()+(e.getTimezoneOffset()-Hg.getTimezoneOffset())*6e4;return(r-a)/(1440*60*1e3)}var wQ=new Date,ege=Hg.getTime()+(wQ.getTimezoneOffset()-Hg.getTimezoneOffset())*6e4,xD=wQ.getTimezoneOffset();function cv(e){var t=new Date;return t.setTime(e*24*60*60*1e3+ege),t.getTimezoneOffset()!==xD&&t.setTime(t.getTime()+(t.getTimezoneOffset()-xD)*6e4),t}function tge(e){var t=0,r=0,a=!1,s=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!s)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var i=1;i!=s.length;++i)if(s[i]){switch(r=1,i>3&&(a=!0),s[i].slice(s[i].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+s[i].slice(s[i].length-1));case"D":r*=24;case"H":r*=60;case"M":if(a)r*=60;else throw new Error("Unsupported ISO Duration Field: M")}t+=r*parseInt(s[i],10)}return t}var mD=new Date("2017-02-19T19:06:09.000Z"),NQ=isNaN(mD.getFullYear())?new Date("2/19/17"):mD,rge=NQ.getFullYear()==2017;function _r(e,t){var r=new Date(e);if(rge)return t>0?r.setTime(r.getTime()+r.getTimezoneOffset()*60*1e3):t<0&&r.setTime(r.getTime()-r.getTimezoneOffset()*60*1e3),r;if(e instanceof Date)return e;if(NQ.getFullYear()==1917&&!isNaN(r.getFullYear())){var a=r.getFullYear();return e.indexOf(""+a)>-1||r.setFullYear(r.getFullYear()+100),r}var s=e.match(/\d+/g)||["2017","2","19","0","0","0"],i=new Date(+s[0],+s[1]-1,+s[2],+s[3]||0,+s[4]||0,+s[5]||0);return e.indexOf("Z")>-1&&(i=new Date(i.getTime()-i.getTimezoneOffset()*60*1e3)),i}function Gd(e,t){if(Dt&&Buffer.isBuffer(e)){if(t){if(e[0]==255&&e[1]==254)return ml(e.slice(2).toString("utf16le"));if(e[1]==254&&e[2]==255)return ml(dQ(e.slice(2).toString("binary")))}return e.toString("binary")}if(typeof TextDecoder<"u")try{if(t){if(e[0]==255&&e[1]==254)return ml(new TextDecoder("utf-16le").decode(e.slice(2)));if(e[0]==254&&e[1]==255)return ml(new TextDecoder("utf-16be").decode(e.slice(2)))}var r={"€":"","‚":"",ƒ:"","„":"","…":"","†":"","‡":"","ˆ":"","‰":"",Š:"","‹":"",Œ:"",Ž:"","‘":"","’":"","“":"","”":"","•":"","–":"","—":"","˜":"","™":"",š:"","›":"",œ:"",ž:"",Ÿ:""};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(i){return r[i]||i})}catch{}for(var a=[],s=0;s!=e.length;++s)a.push(String.fromCharCode(e[s]));return a.join("")}function Tr(e){if(typeof JSON<"u"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Tr(e[r]));return t}function ra(e,t){for(var r="";r.length<t;)r+=e;return r}function Hi(e){var t=Number(e);if(!isNaN(t))return isFinite(t)?t:NaN;if(!/\d/.test(e))return t;var r=1,a=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return r*=100,""});return!isNaN(t=Number(a))||(a=a.replace(/[(](.*)[)]/,function(s,i){return r=-r,i}),!isNaN(t=Number(a)))?t/r:t}var age=["january","february","march","april","may","june","july","august","september","october","november","december"];function IA(e){var t=new Date(e),r=new Date(NaN),a=t.getYear(),s=t.getMonth(),i=t.getDate();if(isNaN(i))return r;var l=e.toLowerCase();if(l.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(l=l.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),l.length>3&&age.indexOf(l)==-1)return r}else if(l.match(/[a-z]/))return r;return a<0||a>8099?r:(s>0||i>1)&&a!=101?t:e.match(/[^-0-9:,\/\\]/)?r:t}var nge=(function(){var e="abacaba".split(/(:?b)/i).length==5;return function(r,a,s){if(e||typeof a=="string")return r.split(a);for(var i=r.split(a),l=[i[0]],o=1;o<i.length;++o)l.push(s),l.push(i[o]);return l}})();function CQ(e){return e?e.content&&e.type?Gd(e.content,!0):e.data?vf(e.data):e.asNodeBuffer&&Dt?vf(e.asNodeBuffer().toString("binary")):e.asBinary?vf(e.asBinary()):e._data&&e._data.getContent?vf(Gd(Array.prototype.slice.call(e._data.getContent(),0))):null:null}function kQ(e){if(!e)return null;if(e.data)return sD(e.data);if(e.asNodeBuffer&&Dt)return e.asNodeBuffer();if(e._data&&e._data.getContent){var t=e._data.getContent();return typeof t=="string"?sD(t):Array.prototype.slice.call(t)}return e.content&&e.type?e.content:null}function sge(e){return e&&e.name.slice(-4)===".bin"?kQ(e):CQ(e)}function oi(e,t){for(var r=e.FullPaths||oa(e.files),a=t.toLowerCase().replace(/[\/]/g,"\\"),s=a.replace(/\\/g,"/"),i=0;i<r.length;++i){var l=r[i].replace(/^Root Entry[\/]/,"").toLowerCase();if(a==l||s==l)return e.files?e.files[r[i]]:e.FileIndex[i]}return null}function nE(e,t){var r=oi(e,t);if(r==null)throw new Error("Cannot find file "+t+" in zip");return r}function Na(e,t,r){if(!r)return sge(nE(e,t));if(!t)return null;try{return Na(e,t)}catch{return null}}function Ds(e,t,r){if(!r)return CQ(nE(e,t));if(!t)return null;try{return Ds(e,t)}catch{return null}}function ige(e,t,r){return kQ(nE(e,t))}function gD(e){for(var t=e.FullPaths||oa(e.files),r=[],a=0;a<t.length;++a)t[a].slice(-1)!="/"&&r.push(t[a].replace(/^Root Entry[\/]/,""));return r.sort()}function It(e,t,r){if(e.FullPaths){if(typeof r=="string"){var a;return Dt?a=Mo(r):a=Cme(r),ut.utils.cfb_add(e,t,a)}ut.utils.cfb_add(e,t,r)}else e.file(t,r)}function sE(){return ut.utils.cfb_new()}function jQ(e,t){switch(t.type){case"base64":return ut.read(e,{type:"base64"});case"binary":return ut.read(e,{type:"binary"});case"buffer":case"array":return ut.read(e,{type:"buffer"})}throw new Error("Unrecognized type "+t.type)}function wf(e,t){if(e.charAt(0)=="/")return e.slice(1);var r=t.split("/");t.slice(-1)!="/"&&r.pop();for(var a=e.split("/");a.length!==0;){var s=a.shift();s===".."?r.pop():s!=="."&&r.push(s)}return r.join("/")}var xa=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
`,lge=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,bD=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,oge=/<[^>]*>/g,Pn=xa.match(bD)?bD:oge,cge=/<\w*:/,dge=/<(\/?)\w+:/;function vt(e,t,r){for(var a={},s=0,i=0;s!==e.length&&!((i=e.charCodeAt(s))===32||i===10||i===13);++s);if(t||(a[0]=e.slice(0,s)),s===e.length)return a;var l=e.match(lge),o=0,d="",u=0,f="",p="",x=1;if(l)for(u=0;u!=l.length;++u){for(p=l[u],i=0;i!=p.length&&p.charCodeAt(i)!==61;++i);for(f=p.slice(0,i).trim();p.charCodeAt(i+1)==32;)++i;for(x=(s=p.charCodeAt(i+1))==34||s==39?1:0,d=p.slice(i+1+x,p.length-x),o=0;o!=f.length&&f.charCodeAt(o)!==58;++o);if(o===f.length)f.indexOf("_")>0&&(f=f.slice(0,f.indexOf("_"))),a[f]=d,a[f.toLowerCase()]=d;else{var m=(o===5&&f.slice(0,5)==="xmlns"?"xmlns":"")+f.slice(o+1);if(a[m]&&f.slice(o-3,o)=="ext")continue;a[m]=d,a[m.toLowerCase()]=d}}return a}function _l(e){return e.replace(dge,"<$1")}var EQ={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},iE=lv(EQ),Gt=(function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,t=/_x([\da-fA-F]{4})_/ig;return function r(a){var s=a+"",i=s.indexOf("<![CDATA[");if(i==-1)return s.replace(e,function(o,d){return EQ[o]||String.fromCharCode(parseInt(d,o.indexOf("x")>-1?16:10))||o}).replace(t,function(o,d){return String.fromCharCode(parseInt(d,16))});var l=s.indexOf("]]>");return r(s.slice(0,i))+s.slice(i+9,l)+r(s.slice(l+3))}})(),lE=/[&<>'"]/g,uge=/[\u0000-\u0008\u000b-\u001f]/g;function cr(e){var t=e+"";return t.replace(lE,function(r){return iE[r]}).replace(uge,function(r){return"_x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+"_"})}function vD(e){return cr(e).replace(/ /g,"_x0020_")}var SQ=/[\u0000-\u001f]/g;function oE(e){var t=e+"";return t.replace(lE,function(r){return iE[r]}).replace(/\n/g,"<br/>").replace(SQ,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}function Age(e){var t=e+"";return t.replace(lE,function(r){return iE[r]}).replace(SQ,function(r){return"&#x"+r.charCodeAt(0).toString(16).toUpperCase()+";"})}var yD=(function(){var e=/&#(\d+);/g;function t(r,a){return String.fromCharCode(parseInt(a,10))}return function(a){return a.replace(e,t)}})();function fge(e){return e.replace(/(\r\n|[\r\n])/g,"&#10;")}function Br(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function C2(e){for(var t="",r=0,a=0,s=0,i=0,l=0,o=0;r<e.length;){if(a=e.charCodeAt(r++),a<128){t+=String.fromCharCode(a);continue}if(s=e.charCodeAt(r++),a>191&&a<224){l=(a&31)<<6,l|=s&63,t+=String.fromCharCode(l);continue}if(i=e.charCodeAt(r++),a<240){t+=String.fromCharCode((a&15)<<12|(s&63)<<6|i&63);continue}l=e.charCodeAt(r++),o=((a&7)<<18|(s&63)<<12|(i&63)<<6|l&63)-65536,t+=String.fromCharCode(55296+(o>>>10&1023)),t+=String.fromCharCode(56320+(o&1023))}return t}function wD(e){var t=Ic(2*e.length),r,a,s=1,i=0,l=0,o;for(a=0;a<e.length;a+=s)s=1,(o=e.charCodeAt(a))<128?r=o:o<224?(r=(o&31)*64+(e.charCodeAt(a+1)&63),s=2):o<240?(r=(o&15)*4096+(e.charCodeAt(a+1)&63)*64+(e.charCodeAt(a+2)&63),s=3):(s=4,r=(o&7)*262144+(e.charCodeAt(a+1)&63)*4096+(e.charCodeAt(a+2)&63)*64+(e.charCodeAt(a+3)&63),r-=65536,l=55296+(r>>>10&1023),r=56320+(r&1023)),l!==0&&(t[i++]=l&255,t[i++]=l>>>8,l=0),t[i++]=r%256,t[i++]=r>>>8;return t.slice(0,i).toString("ucs2")}function ND(e){return Mo(e,"binary").toString("utf8")}var Px="foo bar bazâð£",hr=Dt&&(ND(Px)==C2(Px)&&ND||wD(Px)==C2(Px)&&wD)||C2,ml=Dt?function(e){return Mo(e,"utf8").toString("binary")}:function(e){for(var t=[],r=0,a=0,s=0;r<e.length;)switch(a=e.charCodeAt(r++),!0){case a<128:t.push(String.fromCharCode(a));break;case a<2048:t.push(String.fromCharCode(192+(a>>6))),t.push(String.fromCharCode(128+(a&63)));break;case(a>=55296&&a<57344):a-=55296,s=e.charCodeAt(r++)-56320+(a<<10),t.push(String.fromCharCode(240+(s>>18&7))),t.push(String.fromCharCode(144+(s>>12&63))),t.push(String.fromCharCode(128+(s>>6&63))),t.push(String.fromCharCode(128+(s&63)));break;default:t.push(String.fromCharCode(224+(a>>12))),t.push(String.fromCharCode(128+(a>>6&63))),t.push(String.fromCharCode(128+(a&63)))}return t.join("")},hp=(function(){var e={};return function(r,a){var s=r+"|"+(a||"");return e[s]?e[s]:e[s]=new RegExp("<(?:\\w+:)?"+r+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+r+">",a||"")}})(),BQ=(function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(t){return[new RegExp("&"+t[0]+";","ig"),t[1]]});return function(r){for(var a=r.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
`).replace(/<[^>]*>/g,""),s=0;s<e.length;++s)a=a.replace(e[s][0],e[s][1]);return a}})(),pge=(function(){var e={};return function(r){return e[r]!==void 0?e[r]:e[r]=new RegExp("<(?:vt:)?"+r+">([\\s\\S]*?)</(?:vt:)?"+r+">","g")}})(),hge=/<\/?(?:vt:)?variant>/g,xge=/<(?:vt:)([^>]*)>([\s\S]*)</;function CD(e,t){var r=vt(e),a=e.match(pge(r.baseType))||[],s=[];if(a.length!=r.size){if(t.WTF)throw new Error("unexpected vector length "+a.length+" != "+r.size);return s}return a.forEach(function(i){var l=i.replace(hge,"").match(xge);l&&s.push({v:hr(l[2]),t:l[1]})}),s}var _Q=/(^\s|\s$|\n)/;function mn(e,t){return"<"+e+(t.match(_Q)?' xml:space="preserve"':"")+">"+t+"</"+e+">"}function xp(e){return oa(e).map(function(t){return" "+t+'="'+e[t]+'"'}).join("")}function Ke(e,t,r){return"<"+e+(r!=null?xp(r):"")+(t!=null?(t.match(_Q)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function gC(e,t){try{return e.toISOString().replace(/\.\d*/,"")}catch(r){if(t)throw r}return""}function mge(e,t){switch(typeof e){case"string":var r=Ke("vt:lpwstr",cr(e));return r=r.replace(/&quot;/g,"_x0022_"),r;case"number":return Ke((e|0)==e?"vt:i4":"vt:r8",cr(String(e)));case"boolean":return Ke("vt:bool",e?"true":"false")}if(e instanceof Date)return Ke("vt:filetime",gC(e));throw new Error("Unable to serialize "+e)}function cE(e){if(Dt&&Buffer.isBuffer(e))return e.toString("utf8");if(typeof e=="string")return e;if(typeof Uint8Array<"u"&&e instanceof Uint8Array)return hr(Vc(tE(e)));throw new Error("Bad input format: expected Buffer or string")}var mp=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/mg,Pa={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},nu=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],_s={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function gge(e,t){for(var r=1-2*(e[t+7]>>>7),a=((e[t+7]&127)<<4)+(e[t+6]>>>4&15),s=e[t+6]&15,i=5;i>=0;--i)s=s*256+e[t+i];return a==2047?s==0?r*(1/0):NaN:(a==0?a=-1022:(a-=1023,s+=Math.pow(2,52)),r*Math.pow(2,a-52)*s)}function bge(e,t,r){var a=(t<0||1/t==-1/0?1:0)<<7,s=0,i=0,l=a?-t:t;isFinite(l)?l==0?s=i=0:(s=Math.floor(Math.log(l)/Math.LN2),i=l*Math.pow(2,52-s),s<=-1023&&(!isFinite(i)||i<Math.pow(2,52))?s=-1022:(i-=Math.pow(2,52),s+=1023)):(s=2047,i=isNaN(t)?26985:0);for(var o=0;o<=5;++o,i/=256)e[r+o]=i&255;e[r+6]=(s&15)<<4|i&15,e[r+7]=s>>4|a}var kD=function(e){for(var t=[],r=10240,a=0;a<e[0].length;++a)if(e[0][a])for(var s=0,i=e[0][a].length;s<i;s+=r)t.push.apply(t,e[0][a].slice(s,s+r));return t},jD=Dt?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map(function(t){return Buffer.isBuffer(t)?t:Mo(t)})):kD(e)}:kD,ED=function(e,t,r){for(var a=[],s=t;s<r;s+=2)a.push(String.fromCharCode(io(e,s)));return a.join("").replace(Kn,"")},dE=Dt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(Kn,""):ED(e,t,r)}:ED,SD=function(e,t,r){for(var a=[],s=t;s<t+r;++s)a.push(("0"+e[s].toString(16)).slice(-2));return a.join("")},TQ=Dt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):SD(e,t,r)}:SD,BD=function(e,t,r){for(var a=[],s=t;s<r;s++)a.push(String.fromCharCode(iA(e,s)));return a.join("")},Xp=Dt?function(t,r,a){return Buffer.isBuffer(t)?t.toString("utf8",r,a):BD(t,r,a)}:BD,FQ=function(e,t){var r=Ts(e,t);return r>0?Xp(e,t+4,t+4+r-1):""},IQ=FQ,DQ=function(e,t){var r=Ts(e,t);return r>0?Xp(e,t+4,t+4+r-1):""},UQ=DQ,MQ=function(e,t){var r=2*Ts(e,t);return r>0?Xp(e,t+4,t+4+r-1):""},RQ=MQ,OQ=function(t,r){var a=Ts(t,r);return a>0?dE(t,r+4,r+4+a):""},PQ=OQ,LQ=function(e,t){var r=Ts(e,t);return r>0?Xp(e,t+4,t+4+r):""},QQ=LQ,HQ=function(e,t){return gge(e,t)},zg=HQ,uE=function(t){return Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array};Dt&&(IQ=function(t,r){if(!Buffer.isBuffer(t))return FQ(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},UQ=function(t,r){if(!Buffer.isBuffer(t))return DQ(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},RQ=function(t,r){if(!Buffer.isBuffer(t))return MQ(t,r);var a=2*t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a-1)},PQ=function(t,r){if(!Buffer.isBuffer(t))return OQ(t,r);var a=t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a)},QQ=function(t,r){if(!Buffer.isBuffer(t))return LQ(t,r);var a=t.readUInt32LE(r);return t.toString("utf8",r+4,r+4+a)},zg=function(t,r){return Buffer.isBuffer(t)?t.readDoubleLE(r):HQ(t,r)},uE=function(t){return Buffer.isBuffer(t)||Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array});var iA=function(e,t){return e[t]},io=function(e,t){return e[t+1]*256+e[t]},vge=function(e,t){var r=e[t+1]*256+e[t];return r<32768?r:(65535-r+1)*-1},Ts=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},gd=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},yge=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function Tf(e,t){var r="",a,s,i=[],l,o,d,u;switch(t){case"dbcs":if(u=this.l,Dt&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*e).toString("utf16le");else for(d=0;d<e;++d)r+=String.fromCharCode(io(this,u)),u+=2;e*=2;break;case"utf8":r=Xp(this,this.l,this.l+e);break;case"utf16le":e*=2,r=dE(this,this.l,this.l+e);break;case"wstr":return Tf.call(this,e,"dbcs");case"lpstr-ansi":r=IQ(this,this.l),e=4+Ts(this,this.l);break;case"lpstr-cp":r=UQ(this,this.l),e=4+Ts(this,this.l);break;case"lpwstr":r=RQ(this,this.l),e=4+2*Ts(this,this.l);break;case"lpp4":e=4+Ts(this,this.l),r=PQ(this,this.l),e&2&&(e+=2);break;case"8lpp4":e=4+Ts(this,this.l),r=QQ(this,this.l),e&3&&(e+=4-(e&3));break;case"cstr":for(e=0,r="";(l=iA(this,this.l+e++))!==0;)i.push(Ox(l));r=i.join("");break;case"_wstr":for(e=0,r="";(l=io(this,this.l+e))!==0;)i.push(Ox(l)),e+=2;e+=2,r=i.join("");break;case"dbcs-cont":for(r="",u=this.l,d=0;d<e;++d){if(this.lens&&this.lens.indexOf(u)!==-1)return l=iA(this,u),this.l=u+1,o=Tf.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(Ox(io(this,u))),u+=2}r=i.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(r="",u=this.l,d=0;d!=e;++d){if(this.lens&&this.lens.indexOf(u)!==-1)return l=iA(this,u),this.l=u+1,o=Tf.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(Ox(iA(this,u))),u+=1}r=i.join("");break;default:switch(e){case 1:return a=iA(this,this.l),this.l++,a;case 2:return a=(t==="i"?vge:io)(this,this.l),this.l+=2,a;case 4:case-4:return t==="i"||(this[this.l+3]&128)===0?(a=(e>0?gd:yge)(this,this.l),this.l+=4,a):(s=Ts(this,this.l),this.l+=4,s);case 8:case-8:if(t==="f")return e==8?s=zg(this,this.l):s=zg([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,s;e=8;case 16:r=TQ(this,this.l,e);break}}return this.l+=e,r}var wge=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255},Nge=function(e,t,r){e[r]=t&255,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},Cge=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255};function kge(e,t,r){var a=0,s=0;if(r==="dbcs"){for(s=0;s!=t.length;++s)Cge(this,t.charCodeAt(s),this.l+2*s);a=2*t.length}else if(r==="sbcs"){for(t=t.replace(/[^\x00-\x7F]/g,"_"),s=0;s!=t.length;++s)this[this.l+s]=t.charCodeAt(s)&255;a=t.length}else if(r==="hex"){for(;s<e;++s)this[this.l++]=parseInt(t.slice(2*s,2*s+2),16)||0;return this}else if(r==="utf16le"){var i=Math.min(this.l+e,this.length);for(s=0;s<Math.min(t.length,e);++s){var l=t.charCodeAt(s);this[this.l++]=l&255,this[this.l++]=l>>8}for(;this.l<i;)this[this.l++]=0;return this}else switch(e){case 1:a=1,this[this.l]=t&255;break;case 2:a=2,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255;break;case 3:a=3,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255,t>>>=8,this[this.l+2]=t&255;break;case 4:a=4,wge(this,t,this.l);break;case 8:if(a=8,r==="f"){bge(this,t,this.l);break}case 16:break;case-4:a=4,Nge(this,t,this.l);break}return this.l+=a,this}function zQ(e,t){var r=TQ(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function xn(e,t){e.l=t,e.read_shift=Tf,e.chk=zQ,e.write_shift=kge}function On(e,t){e.l+=t}function Re(e){var t=Ic(e);return xn(t,0),t}function Ro(e,t,r){if(e){var a,s,i;xn(e,e.l||0);for(var l=e.length,o=0,d=0;e.l<l;){o=e.read_shift(1),o&128&&(o=(o&127)+((e.read_shift(1)&127)<<7));var u=Np[o]||Np[65535];for(a=e.read_shift(1),i=a&127,s=1;s<4&&a&128;++s)i+=((a=e.read_shift(1))&127)<<7*s;d=e.l+i;var f=u.f&&u.f(e,i,r);if(e.l=d,t(f,u,o))return}}}function As(){var e=[],t=Dt?256:2048,r=function(u){var f=Re(u);return xn(f,0),f},a=r(t),s=function(){a&&(a.length>a.l&&(a=a.slice(0,a.l),a.l=a.length),a.length>0&&e.push(a),a=null)},i=function(u){return a&&u<a.length-a.l?a:(s(),a=r(Math.max(u+1,t)))},l=function(){return s(),Xa(e)},o=function(u){s(),a=u,a.l==null&&(a.l=a.length),i(t)};return{next:i,push:o,end:l,_bufs:e}}function Qe(e,t,r,a){var s=+t,i;if(!isNaN(s)){a||(a=Np[s].p||(r||[]).length||0),i=1+(s>=128?1:0)+1,a>=128&&++i,a>=16384&&++i,a>=2097152&&++i;var l=e.next(i);s<=127?l.write_shift(1,s):(l.write_shift(1,(s&127)+128),l.write_shift(1,s>>7));for(var o=0;o!=4;++o)if(a>=128)l.write_shift(1,(a&127)+128),a>>=7;else{l.write_shift(1,a);break}a>0&&uE(r)&&e.push(r)}}function Ff(e,t,r){var a=Tr(e);if(t.s?(a.cRel&&(a.c+=t.s.c),a.rRel&&(a.r+=t.s.r)):(a.cRel&&(a.c+=t.c),a.rRel&&(a.r+=t.r)),!r||r.biff<12){for(;a.c>=256;)a.c-=256;for(;a.r>=65536;)a.r-=65536}return a}function _D(e,t,r){var a=Tr(e);return a.s=Ff(a.s,t.s,r),a.e=Ff(a.e,t.s,r),a}function If(e,t){if(e.cRel&&e.c<0)for(e=Tr(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=Tr(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=bt(e);return!e.cRel&&e.cRel!=null&&(r=Sge(r)),!e.rRel&&e.rRel!=null&&(r=jge(r)),r}function k2(e,t){return e.s.r==0&&!e.s.rRel&&e.e.r==(t.biff>=12?1048575:t.biff>=8?65536:16384)&&!e.e.rRel?(e.s.cRel?"":"$")+$r(e.s.c)+":"+(e.e.cRel?"":"$")+$r(e.e.c):e.s.c==0&&!e.s.cRel&&e.e.c==(t.biff>=12?16383:255)&&!e.e.cRel?(e.s.rRel?"":"$")+pa(e.s.r)+":"+(e.e.rRel?"":"$")+pa(e.e.r):If(e.s,t.biff)+":"+If(e.e,t.biff)}function AE(e){return parseInt(Ege(e),10)-1}function pa(e){return""+(e+1)}function jge(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function Ege(e){return e.replace(/\$(\d+)$/,"$1")}function fE(e){for(var t=Bge(e),r=0,a=0;a!==t.length;++a)r=26*r+t.charCodeAt(a)-64;return r-1}function $r(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function Sge(e){return e.replace(/^([A-Z])/,"$$$1")}function Bge(e){return e.replace(/^\$([A-Z])/,"$1")}function _ge(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function Vr(e){for(var t=0,r=0,a=0;a<e.length;++a){var s=e.charCodeAt(a);s>=48&&s<=57?t=10*t+(s-48):s>=65&&s<=90&&(r=26*r+(s-64))}return{c:r-1,r:t-1}}function bt(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function xs(e){var t=e.indexOf(":");return t==-1?{s:Vr(e),e:Vr(e)}:{s:Vr(e.slice(0,t)),e:Vr(e.slice(t+1))}}function St(e,t){return typeof t>"u"||typeof t=="number"?St(e.s,e.e):(typeof e!="string"&&(e=bt(e)),typeof t!="string"&&(t=bt(t)),e==t?e:e+":"+t)}function Kt(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,a=0,s=0,i=e.length;for(r=0;a<i&&!((s=e.charCodeAt(a)-64)<1||s>26);++a)r=26*r+s;for(t.s.c=--r,r=0;a<i&&!((s=e.charCodeAt(a)-48)<0||s>9);++a)r=10*r+s;if(t.s.r=--r,a===i||s!=10)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++a,r=0;a!=i&&!((s=e.charCodeAt(a)-64)<1||s>26);++a)r=26*r+s;for(t.e.c=--r,r=0;a!=i&&!((s=e.charCodeAt(a)-48)<0||s>9);++a)r=10*r+s;return t.e.r=--r,t}function TD(e,t){var r=e.t=="d"&&t instanceof Date;if(e.z!=null)try{return e.w=Ni(e.z,r?Qa(t):t)}catch{}try{return e.w=Ni((e.XF||{}).numFmtId||(r?14:0),r?Qa(t):t)}catch{return""+t}}function No(e,t,r){return e==null||e.t==null||e.t=="z"?"":e.w!==void 0?e.w:(e.t=="d"&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),e.t=="e"?Oo[e.v]||e.v:t==null?TD(e,e.v):TD(e,t))}function Gc(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",a={};return a[r]=e,{SheetNames:[r],Sheets:a}}function $Q(e,t,r){var a=r||{},s=e?Array.isArray(e):a.dense,i=e||(s?[]:{}),l=0,o=0;if(i&&a.origin!=null){if(typeof a.origin=="number")l=a.origin;else{var d=typeof a.origin=="string"?Vr(a.origin):a.origin;l=d.r,o=d.c}i["!ref"]||(i["!ref"]="A1:A1")}var u={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var f=Kt(i["!ref"]);u.s.c=f.s.c,u.s.r=f.s.r,u.e.c=Math.max(u.e.c,f.e.c),u.e.r=Math.max(u.e.r,f.e.r),l==-1&&(u.e.r=l=f.e.r+1)}for(var p=0;p!=t.length;++p)if(t[p]){if(!Array.isArray(t[p]))throw new Error("aoa_to_sheet expects an array of arrays");for(var x=0;x!=t[p].length;++x)if(!(typeof t[p][x]>"u")){var m={v:t[p][x]},b=l+p,v=o+x;if(u.s.r>b&&(u.s.r=b),u.s.c>v&&(u.s.c=v),u.e.r<b&&(u.e.r=b),u.e.c<v&&(u.e.c=v),t[p][x]&&typeof t[p][x]=="object"&&!Array.isArray(t[p][x])&&!(t[p][x]instanceof Date))m=t[p][x];else if(Array.isArray(m.v)&&(m.f=t[p][x][1],m.v=m.v[0]),m.v===null)if(m.f)m.t="n";else if(a.nullError)m.t="e",m.v=0;else if(a.sheetStubs)m.t="z";else continue;else typeof m.v=="number"?m.t="n":typeof m.v=="boolean"?m.t="b":m.v instanceof Date?(m.z=a.dateNF||gt[14],a.cellDates?(m.t="d",m.w=Ni(m.z,Qa(m.v))):(m.t="n",m.v=Qa(m.v),m.w=Ni(m.z,m.v))):m.t="s";if(s)i[b]||(i[b]=[]),i[b][v]&&i[b][v].z&&(m.z=i[b][v].z),i[b][v]=m;else{var y=bt({c:v,r:b});i[y]&&i[y].z&&(m.z=i[y].z),i[y]=m}}}return u.s.c<1e7&&(i["!ref"]=St(u)),i}function r0(e,t){return $Q(null,e,t)}function Tge(e){return e.read_shift(4,"i")}function zi(e,t){return t||(t=Re(4)),t.write_shift(4,e),t}function Mn(e){var t=e.read_shift(4);return t===0?"":e.read_shift(t,"dbcs")}function Za(e,t){var r=!1;return t==null&&(r=!0,t=Re(4+2*e.length)),t.write_shift(4,e.length),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}function Fge(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function Ige(e,t){return t||(t=Re(4)),t.write_shift(2,0),t.write_shift(2,0),t}function pE(e,t){var r=e.l,a=e.read_shift(1),s=Mn(e),i=[],l={t:s,h:s};if((a&1)!==0){for(var o=e.read_shift(4),d=0;d!=o;++d)i.push(Fge(e));l.r=i}else l.r=[{ich:0,ifnt:0}];return e.l=r+t,l}function Dge(e,t){var r=!1;return t==null&&(r=!0,t=Re(15+4*e.t.length)),t.write_shift(1,0),Za(e.t,t),r?t.slice(0,t.l):t}var Uge=pE;function Mge(e,t){var r=!1;return t==null&&(r=!0,t=Re(23+4*e.t.length)),t.write_shift(1,1),Za(e.t,t),t.write_shift(4,1),Ige({},t),r?t.slice(0,t.l):t}function ki(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function su(e,t){return t==null&&(t=Re(8)),t.write_shift(-4,e.c),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}function iu(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}function lu(e,t){return t==null&&(t=Re(4)),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}var Rge=Mn,VQ=Za;function hE(e){var t=e.read_shift(4);return t===0||t===4294967295?"":e.read_shift(t,"dbcs")}function $g(e,t){var r=!1;return t==null&&(r=!0,t=Re(127)),t.write_shift(4,e.length>0?e.length:4294967295),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}var Oge=Mn,bC=hE,xE=$g;function mE(e){var t=e.slice(e.l,e.l+4),r=t[0]&1,a=t[0]&2;e.l+=4;var s=a===0?zg([0,0,0,0,t[0]&252,t[1],t[2],t[3]],0):gd(t,0)>>2;return r?s/100:s}function GQ(e,t){t==null&&(t=Re(4));var r=0,a=0,s=e*100;if(e==(e|0)&&e>=-536870912&&e<1<<29?a=1:s==(s|0)&&s>=-536870912&&s<1<<29&&(a=1,r=1),a)t.write_shift(-4,((r?s:e)<<2)+(r+2));else throw new Error("unsupported RkNumber "+e)}function KQ(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}function Pge(e,t){return t||(t=Re(16)),t.write_shift(4,e.s.r),t.write_shift(4,e.e.r),t.write_shift(4,e.s.c),t.write_shift(4,e.e.c),t}var ou=KQ,a0=Pge;function Un(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function Kd(e,t){return(t||Re(8)).write_shift(8,e,"f")}function Lge(e){var t={},r=e.read_shift(1),a=r>>>1,s=e.read_shift(1),i=e.read_shift(2,"i"),l=e.read_shift(1),o=e.read_shift(1),d=e.read_shift(1);switch(e.l++,a){case 0:t.auto=1;break;case 1:t.index=s;var u=_d[s];u&&(t.rgb=bp(u));break;case 2:t.rgb=bp([l,o,d]);break;case 3:t.theme=s;break}return i!=0&&(t.tint=i>0?i/32767:i/32768),t}function Vg(e,t){if(t||(t=Re(8)),!e||e.auto)return t.write_shift(4,0),t.write_shift(4,0),t;e.index!=null?(t.write_shift(1,2),t.write_shift(1,e.index)):e.theme!=null?(t.write_shift(1,6),t.write_shift(1,e.theme)):(t.write_shift(1,5),t.write_shift(1,0));var r=e.tint||0;if(r>0?r*=32767:r<0&&(r*=32768),t.write_shift(2,r),!e.rgb||e.theme!=null)t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);else{var a=e.rgb||"FFFFFF";typeof a=="number"&&(a=("000000"+a.toString(16)).slice(-6)),t.write_shift(1,parseInt(a.slice(0,2),16)),t.write_shift(1,parseInt(a.slice(2,4),16)),t.write_shift(1,parseInt(a.slice(4,6),16)),t.write_shift(1,255)}return t}function Qge(e){var t=e.read_shift(1);e.l++;var r={fBold:t&1,fItalic:t&2,fUnderline:t&4,fStrikeout:t&8,fOutline:t&16,fShadow:t&32,fCondense:t&64,fExtend:t&128};return r}function Hge(e,t){t||(t=Re(2));var r=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);return t.write_shift(1,r),t.write_shift(1,0),t}function qQ(e,t){var r={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},a=e.read_shift(4);switch(a){case 0:return"";case 4294967295:case 4294967294:return r[e.read_shift(4)]||""}if(a>400)throw new Error("Unsupported Clipboard: "+a.toString(16));return e.l-=4,e.read_shift(0,t==1?"lpstr":"lpwstr")}function zge(e){return qQ(e,1)}function $ge(e){return qQ(e,2)}var gE=2,os=3,Lx=11,FD=12,Gg=19,Qx=64,Vge=65,Gge=71,Kge=4108,qge=4126,Ya=80,WQ=81,Wge=[Ya,WQ],vC={1:{n:"CodePage",t:gE},2:{n:"Category",t:Ya},3:{n:"PresentationFormat",t:Ya},4:{n:"ByteCount",t:os},5:{n:"LineCount",t:os},6:{n:"ParagraphCount",t:os},7:{n:"SlideCount",t:os},8:{n:"NoteCount",t:os},9:{n:"HiddenCount",t:os},10:{n:"MultimediaClipCount",t:os},11:{n:"ScaleCrop",t:Lx},12:{n:"HeadingPairs",t:Kge},13:{n:"TitlesOfParts",t:qge},14:{n:"Manager",t:Ya},15:{n:"Company",t:Ya},16:{n:"LinksUpToDate",t:Lx},17:{n:"CharacterCount",t:os},19:{n:"SharedDoc",t:Lx},22:{n:"HyperlinksChanged",t:Lx},23:{n:"AppVersion",t:os,p:"version"},24:{n:"DigSig",t:Vge},26:{n:"ContentType",t:Ya},27:{n:"ContentStatus",t:Ya},28:{n:"Language",t:Ya},29:{n:"Version",t:Ya},255:{},2147483648:{n:"Locale",t:Gg},2147483651:{n:"Behavior",t:Gg},1919054434:{}},yC={1:{n:"CodePage",t:gE},2:{n:"Title",t:Ya},3:{n:"Subject",t:Ya},4:{n:"Author",t:Ya},5:{n:"Keywords",t:Ya},6:{n:"Comments",t:Ya},7:{n:"Template",t:Ya},8:{n:"LastAuthor",t:Ya},9:{n:"RevNumber",t:Ya},10:{n:"EditTime",t:Qx},11:{n:"LastPrinted",t:Qx},12:{n:"CreatedDate",t:Qx},13:{n:"ModifiedDate",t:Qx},14:{n:"PageCount",t:os},15:{n:"WordCount",t:os},16:{n:"CharCount",t:os},17:{n:"Thumbnail",t:Gge},18:{n:"Application",t:Ya},19:{n:"DocSecurity",t:os},255:{},2147483648:{n:"Locale",t:Gg},2147483651:{n:"Behavior",t:Gg},1919054434:{}},ID={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},Yge=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function Xge(e){return e.map(function(t){return[t>>16&255,t>>8&255,t&255]})}var Jge=Xge([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),_d=Tr(Jge),Oo={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},YQ={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},wC={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},Hx={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function bE(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function Zge(e){var t=bE();if(!e||!e.match)return t;var r={};if((e.match(Pn)||[]).forEach(function(a){var s=vt(a);switch(s[0].replace(cge,"<")){case"<?xml":break;case"<Types":t.xmlns=s["xmlns"+(s[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[s.Extension]=s.ContentType;break;case"<Override":t[wC[s.ContentType]]!==void 0&&t[wC[s.ContentType]].push(s.PartName);break}}),t.xmlns!==Pa.CT)throw new Error("Unknown Namespace: "+t.xmlns);return t.calcchain=t.calcchains.length>0?t.calcchains[0]:"",t.sst=t.strs.length>0?t.strs[0]:"",t.style=t.styles.length>0?t.styles[0]:"",t.defaults=r,delete t.calcchains,t}function XQ(e,t){var r=Zme(wC),a=[],s;a[a.length]=xa,a[a.length]=Ke("Types",null,{xmlns:Pa.CT,"xmlns:xsd":Pa.xsd,"xmlns:xsi":Pa.xsi}),a=a.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(d){return Ke("Default",null,{Extension:d[0],ContentType:d[1]})}));var i=function(d){e[d]&&e[d].length>0&&(s=e[d][0],a[a.length]=Ke("Override",null,{PartName:(s[0]=="/"?"":"/")+s,ContentType:Hx[d][t.bookType]||Hx[d].xlsx}))},l=function(d){(e[d]||[]).forEach(function(u){a[a.length]=Ke("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:Hx[d][t.bookType]||Hx[d].xlsx})})},o=function(d){(e[d]||[]).forEach(function(u){a[a.length]=Ke("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:r[d][0]})})};return i("workbooks"),l("sheets"),l("charts"),o("themes"),["strs","styles"].forEach(i),["coreprops","extprops","custprops"].forEach(o),o("vba"),o("comments"),o("threadedcomments"),o("drawings"),l("metadata"),o("people"),a.length>2&&(a[a.length]="</Types>",a[1]=a[1].replace("/>",">")),a.join("")}var Ut={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function gp(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function Df(e,t){var r={"!id":{}};if(!e)return r;t.charAt(0)!=="/"&&(t="/"+t);var a={};return(e.match(Pn)||[]).forEach(function(s){var i=vt(s);if(i[0]==="<Relationship"){var l={};l.Type=i.Type,l.Target=i.Target,l.Id=i.Id,i.TargetMode&&(l.TargetMode=i.TargetMode);var o=i.TargetMode==="External"?i.Target:wf(i.Target,t);r[o]=l,a[i.Id]=l}}),r["!id"]=a,r}function yA(e){var t=[xa,Ke("Relationships",null,{xmlns:Pa.RELS})];return oa(e["!id"]).forEach(function(r){t[t.length]=Ke("Relationship",null,e["!id"][r])}),t.length>2&&(t[t.length]="</Relationships>",t[1]=t[1].replace("/>",">")),t.join("")}function lr(e,t,r,a,s,i){if(s||(s={}),e["!id"]||(e["!id"]={}),e["!idx"]||(e["!idx"]=1),t<0)for(t=e["!idx"];e["!id"]["rId"+t];++t);if(e["!idx"]=t+1,s.Id="rId"+t,s.Type=a,s.Target=r,[Ut.HLINK,Ut.XPATH,Ut.XMISS].indexOf(s.Type)>-1&&(s.TargetMode="External"),e["!id"][s.Id])throw new Error("Cannot rewrite rId "+t);return e["!id"][s.Id]=s,e[("/"+s.Target).replace("//","/")]=s,t}var ebe="application/vnd.oasis.opendocument.spreadsheet";function tbe(e,t){for(var r=cE(e),a,s;a=mp.exec(r);)switch(a[3]){case"manifest":break;case"file-entry":if(s=vt(a[0],!1),s.path=="/"&&s.type!==ebe)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(t&&t.WTF)throw a}}function rbe(e){var t=[xa];t.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
`),t.push(`  <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>
`);for(var r=0;r<e.length;++r)t.push('  <manifest:file-entry manifest:full-path="'+e[r][0]+'" manifest:media-type="'+e[r][1]+`"/>
`);return t.push("</manifest:manifest>"),t.join("")}function DD(e,t,r){return['  <rdf:Description rdf:about="'+e+`">
`,'    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(r||"odf")+"#"+t+`"/>
`,`  </rdf:Description>
`].join("")}function abe(e,t){return['  <rdf:Description rdf:about="'+e+`">
`,'    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+t+`"/>
`,`  </rdf:Description>
`].join("")}function nbe(e){var t=[xa];t.push(`<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
`);for(var r=0;r!=e.length;++r)t.push(DD(e[r][0],e[r][1])),t.push(abe("",e[r][0]));return t.push(DD("","Document","pkg")),t.push("</rdf:RDF>"),t.join("")}function JQ(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+Og.version+"</meta:generator></office:meta></office:document-meta>"}var gi=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],sbe=(function(){for(var e=new Array(gi.length),t=0;t<gi.length;++t){var r=gi[t],a="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);e[t]=new RegExp("<"+a+"[^>]*>([\\s\\S]*?)</"+a+">")}return e})();function ZQ(e){var t={};e=hr(e);for(var r=0;r<gi.length;++r){var a=gi[r],s=e.match(sbe[r]);s!=null&&s.length>0&&(t[a[1]]=Gt(s[1])),a[2]==="date"&&t[a[1]]&&(t[a[1]]=_r(t[a[1]]))}return t}function j2(e,t,r,a,s){s[e]!=null||t==null||t===""||(s[e]=t,t=cr(t),a[a.length]=r?Ke(e,t,r):mn(e,t))}function e9(e,t){var r=t||{},a=[xa,Ke("cp:coreProperties",null,{"xmlns:cp":Pa.CORE_PROPS,"xmlns:dc":Pa.dc,"xmlns:dcterms":Pa.dcterms,"xmlns:dcmitype":Pa.dcmitype,"xmlns:xsi":Pa.xsi})],s={};if(!e&&!r.Props)return a.join("");e&&(e.CreatedDate!=null&&j2("dcterms:created",typeof e.CreatedDate=="string"?e.CreatedDate:gC(e.CreatedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s),e.ModifiedDate!=null&&j2("dcterms:modified",typeof e.ModifiedDate=="string"?e.ModifiedDate:gC(e.ModifiedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s));for(var i=0;i!=gi.length;++i){var l=gi[i],o=r.Props&&r.Props[l[1]]!=null?r.Props[l[1]]:e?e[l[1]]:null;o===!0?o="1":o===!1?o="0":typeof o=="number"&&(o=String(o)),o!=null&&j2(l[0],o,null,a,s)}return a.length>2&&(a[a.length]="</cp:coreProperties>",a[1]=a[1].replace("/>",">")),a.join("")}var Td=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],t9=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function r9(e,t,r,a){var s=[];if(typeof e=="string")s=CD(e,a);else for(var i=0;i<e.length;++i)s=s.concat(e[i].map(function(f){return{v:f}}));var l=typeof t=="string"?CD(t,a).map(function(f){return f.v}):t,o=0,d=0;if(l.length>0)for(var u=0;u!==s.length;u+=2){switch(d=+s[u+1].v,s[u].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsblätter":case"Çalışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Regneark":case"Hojas de cálculo":case"Werkbladen":r.Worksheets=d,r.SheetNames=l.slice(o,o+d);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne områder":r.NamedRanges=d,r.DefinedNames=l.slice(o,o+d);break;case"Charts":case"Diagramme":r.Chartsheets=d,r.ChartNames=l.slice(o,o+d);break}o+=d}}function ibe(e,t,r){var a={};return t||(t={}),e=hr(e),Td.forEach(function(s){var i=(e.match(hp(s[0]))||[])[1];switch(s[2]){case"string":i&&(t[s[1]]=Gt(i));break;case"bool":t[s[1]]=i==="true";break;case"raw":var l=e.match(new RegExp("<"+s[0]+"[^>]*>([\\s\\S]*?)</"+s[0]+">"));l&&l.length>0&&(a[s[1]]=l[1]);break}}),a.HeadingPairs&&a.TitlesOfParts&&r9(a.HeadingPairs,a.TitlesOfParts,t,r),t}function a9(e){var t=[],r=Ke;return e||(e={}),e.Application="SheetJS",t[t.length]=xa,t[t.length]=Ke("Properties",null,{xmlns:Pa.EXT_PROPS,"xmlns:vt":Pa.vt}),Td.forEach(function(a){if(e[a[1]]!==void 0){var s;switch(a[2]){case"string":s=cr(String(e[a[1]]));break;case"bool":s=e[a[1]]?"true":"false";break}s!==void 0&&(t[t.length]=r(a[0],s))}}),t[t.length]=r("HeadingPairs",r("vt:vector",r("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+r("vt:variant",r("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"})),t[t.length]=r("TitlesOfParts",r("vt:vector",e.SheetNames.map(function(a){return"<vt:lpstr>"+cr(a)+"</vt:lpstr>"}).join(""),{size:e.Worksheets,baseType:"lpstr"})),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}var lbe=/<[^>]+>[^<]*/g;function obe(e,t){var r={},a="",s=e.match(lbe);if(s)for(var i=0;i!=s.length;++i){var l=s[i],o=vt(l);switch(o[0]){case"<?xml":break;case"<Properties":break;case"<property":a=Gt(o.name);break;case"</property>":a=null;break;default:if(l.indexOf("<vt:")===0){var d=l.split(">"),u=d[0].slice(4),f=d[1];switch(u){case"lpstr":case"bstr":case"lpwstr":r[a]=Gt(f);break;case"bool":r[a]=Br(f);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[a]=parseInt(f,10);break;case"r4":case"r8":case"decimal":r[a]=parseFloat(f);break;case"filetime":case"date":r[a]=_r(f);break;case"cy":case"error":r[a]=Gt(f);break;default:if(u.slice(-1)=="/")break;t.WTF&&typeof console<"u"&&console.warn("Unexpected",l,u,d)}}else if(l.slice(0,2)!=="</"){if(t.WTF)throw new Error(l)}}}return r}function n9(e){var t=[xa,Ke("Properties",null,{xmlns:Pa.CUST_PROPS,"xmlns:vt":Pa.vt})];if(!e)return t.join("");var r=1;return oa(e).forEach(function(s){++r,t[t.length]=Ke("property",mge(e[s]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r,name:cr(s)})}),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}var NC={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},E2;function cbe(e,t,r){E2||(E2=lv(NC)),t=E2[t]||t,e[t]=r}function dbe(e,t){var r=[];return oa(NC).map(function(a){for(var s=0;s<gi.length;++s)if(gi[s][1]==a)return gi[s];for(s=0;s<Td.length;++s)if(Td[s][1]==a)return Td[s];throw a}).forEach(function(a){if(e[a[1]]!=null){var s=t&&t.Props&&t.Props[a[1]]!=null?t.Props[a[1]]:e[a[1]];switch(a[2]){case"date":s=new Date(s).toISOString().replace(/\.\d*Z/,"Z");break}typeof s=="number"?s=String(s):s===!0||s===!1?s=s?"1":"0":s instanceof Date&&(s=new Date(s).toISOString().replace(/\.\d*Z/,"")),r.push(mn(NC[a[1]]||a[1],s))}}),Ke("DocumentProperties",r.join(""),{xmlns:_s.o})}function ube(e,t){var r=["Worksheets","SheetNames"],a="CustomDocumentProperties",s=[];return e&&oa(e).forEach(function(i){if(Object.prototype.hasOwnProperty.call(e,i)){for(var l=0;l<gi.length;++l)if(i==gi[l][1])return;for(l=0;l<Td.length;++l)if(i==Td[l][1])return;for(l=0;l<r.length;++l)if(i==r[l])return;var o=e[i],d="string";typeof o=="number"?(d="float",o=String(o)):o===!0||o===!1?(d="boolean",o=o?"1":"0"):o=String(o),s.push(Ke(vD(i),o,{"dt:dt":d}))}}),t&&oa(t).forEach(function(i){if(Object.prototype.hasOwnProperty.call(t,i)&&!(e&&Object.prototype.hasOwnProperty.call(e,i))){var l=t[i],o="string";typeof l=="number"?(o="float",l=String(l)):l===!0||l===!1?(o="boolean",l=l?"1":"0"):l instanceof Date?(o="dateTime.tz",l=l.toISOString()):l=String(l),s.push(Ke(vD(i),l,{"dt:dt":o}))}}),"<"+a+' xmlns="'+_s.o+'">'+s.join("")+"</"+a+">"}function vE(e){var t=e.read_shift(4),r=e.read_shift(4);return new Date((r/1e7*Math.pow(2,32)+t/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function Abe(e){var t=typeof e=="string"?new Date(Date.parse(e)):e,r=t.getTime()/1e3+11644473600,a=r%Math.pow(2,32),s=(r-a)/Math.pow(2,32);a*=1e7,s*=1e7;var i=a/Math.pow(2,32)|0;i>0&&(a=a%Math.pow(2,32),s+=i);var l=Re(8);return l.write_shift(4,a),l.write_shift(4,s),l}function s9(e,t,r){var a=e.l,s=e.read_shift(0,"lpstr-cp");if(r)for(;e.l-a&3;)++e.l;return s}function i9(e,t,r){var a=e.read_shift(0,"lpwstr");return a}function l9(e,t,r){return t===31?i9(e):s9(e,t,r)}function CC(e,t,r){return l9(e,t,r===!1?0:4)}function fbe(e,t){if(!t)throw new Error("VtUnalignedString must have positive length");return l9(e,t,0)}function pbe(e){for(var t=e.read_shift(4),r=[],a=0;a!=t;++a){var s=e.l;r[a]=e.read_shift(0,"lpwstr").replace(Kn,""),e.l-s&2&&(e.l+=2)}return r}function hbe(e){for(var t=e.read_shift(4),r=[],a=0;a!=t;++a)r[a]=e.read_shift(0,"lpstr-cp").replace(Kn,"");return r}function xbe(e){var t=e.l,r=Kg(e,WQ);e[e.l]==0&&e[e.l+1]==0&&e.l-t&2&&(e.l+=2);var a=Kg(e,os);return[r,a]}function mbe(e){for(var t=e.read_shift(4),r=[],a=0;a<t/2;++a)r.push(xbe(e));return r}function UD(e,t){for(var r=e.read_shift(4),a={},s=0;s!=r;++s){var i=e.read_shift(4),l=e.read_shift(4);a[i]=e.read_shift(l,t===1200?"utf16le":"utf8").replace(Kn,"").replace(yf,"!"),t===1200&&l%2&&(e.l+=2)}return e.l&3&&(e.l=e.l>>3<<2),a}function o9(e){var t=e.read_shift(4),r=e.slice(e.l,e.l+t);return e.l+=t,(t&3)>0&&(e.l+=4-(t&3)&3),r}function gbe(e){var t={};return t.Size=e.read_shift(4),e.l+=t.Size+3-(t.Size-1)%4,t}function Kg(e,t,r){var a=e.read_shift(2),s,i=r||{};if(e.l+=2,t!==FD&&a!==t&&Wge.indexOf(t)===-1&&!((t&65534)==4126&&(a&65534)==4126))throw new Error("Expected type "+t+" saw "+a);switch(t===FD?a:t){case 2:return s=e.read_shift(2,"i"),i.raw||(e.l+=2),s;case 3:return s=e.read_shift(4,"i"),s;case 11:return e.read_shift(4)!==0;case 19:return s=e.read_shift(4),s;case 30:return s9(e,a,4).replace(Kn,"");case 31:return i9(e);case 64:return vE(e);case 65:return o9(e);case 71:return gbe(e);case 80:return CC(e,a,!i.raw).replace(Kn,"");case 81:return fbe(e,a).replace(Kn,"");case 4108:return mbe(e);case 4126:case 4127:return a==4127?pbe(e):hbe(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+a)}}function MD(e,t){var r=Re(4),a=Re(4);switch(r.write_shift(4,e==80?31:e),e){case 3:a.write_shift(-4,t);break;case 5:a=Re(8),a.write_shift(8,t,"f");break;case 11:a.write_shift(4,t?1:0);break;case 64:a=Abe(t);break;case 31:case 80:for(a=Re(4+2*(t.length+1)+(t.length%2?0:2)),a.write_shift(4,t.length+1),a.write_shift(0,t,"dbcs");a.l!=a.length;)a.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+t)}return Xa([r,a])}function RD(e,t){var r=e.l,a=e.read_shift(4),s=e.read_shift(4),i=[],l=0,o=0,d=-1,u={};for(l=0;l!=s;++l){var f=e.read_shift(4),p=e.read_shift(4);i[l]=[f,p+r]}i.sort(function(_,C){return _[1]-C[1]});var x={};for(l=0;l!=s;++l){if(e.l!==i[l][1]){var m=!0;if(l>0&&t)switch(t[i[l-1][0]].t){case 2:e.l+2===i[l][1]&&(e.l+=2,m=!1);break;case 80:e.l<=i[l][1]&&(e.l=i[l][1],m=!1);break;case 4108:e.l<=i[l][1]&&(e.l=i[l][1],m=!1);break}if((!t||l==0)&&e.l<=i[l][1]&&(m=!1,e.l=i[l][1]),m)throw new Error("Read Error: Expected address "+i[l][1]+" at "+e.l+" :"+l)}if(t){var b=t[i[l][0]];if(x[b.n]=Kg(e,b.t,{raw:!0}),b.p==="version"&&(x[b.n]=String(x[b.n]>>16)+"."+("0000"+String(x[b.n]&65535)).slice(-4)),b.n=="CodePage")switch(x[b.n]){case 0:x[b.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:Mi(o=x[b.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+x[b.n])}}else if(i[l][0]===1){if(o=x.CodePage=Kg(e,gE),Mi(o),d!==-1){var v=e.l;e.l=i[d][1],u=UD(e,o),e.l=v}}else if(i[l][0]===0){if(o===0){d=l,e.l=i[l+1][1];continue}u=UD(e,o)}else{var y=u[i[l][0]],k;switch(e[e.l]){case 65:e.l+=4,k=o9(e);break;case 30:e.l+=4,k=CC(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 31:e.l+=4,k=CC(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,k=e.read_shift(4,"i");break;case 19:e.l+=4,k=e.read_shift(4);break;case 5:e.l+=4,k=e.read_shift(8,"f");break;case 11:e.l+=4,k=Aa(e,4);break;case 64:e.l+=4,k=_r(vE(e));break;default:throw new Error("unparsed value: "+e[e.l])}x[y]=k}}return e.l=r+a,x}var c9=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function bbe(e){switch(typeof e){case"boolean":return 11;case"number":return(e|0)==e?3:5;case"string":return 31;case"object":if(e instanceof Date)return 64;break}return-1}function OD(e,t,r){var a=Re(8),s=[],i=[],l=8,o=0,d=Re(8),u=Re(8);if(d.write_shift(4,2),d.write_shift(4,1200),u.write_shift(4,1),i.push(d),s.push(u),l+=8+d.length,!t){u=Re(8),u.write_shift(4,0),s.unshift(u);var f=[Re(4)];for(f[0].write_shift(4,e.length),o=0;o<e.length;++o){var p=e[o][0];for(d=Re(8+2*(p.length+1)+(p.length%2?0:2)),d.write_shift(4,o+2),d.write_shift(4,p.length+1),d.write_shift(0,p,"dbcs");d.l!=d.length;)d.write_shift(1,0);f.push(d)}d=Xa(f),i.unshift(d),l+=8+d.length}for(o=0;o<e.length;++o)if(!(t&&!t[e[o][0]])&&!(c9.indexOf(e[o][0])>-1||t9.indexOf(e[o][0])>-1)&&e[o][1]!=null){var x=e[o][1],m=0;if(t){m=+t[e[o][0]];var b=r[m];if(b.p=="version"&&typeof x=="string"){var v=x.split(".");x=(+v[0]<<16)+(+v[1]||0)}d=MD(b.t,x)}else{var y=bbe(x);y==-1&&(y=31,x=String(x)),d=MD(y,x)}i.push(d),u=Re(8),u.write_shift(4,t?m:2+o),s.push(u),l+=8+d.length}var k=8*(i.length+1);for(o=0;o<i.length;++o)s[o].write_shift(4,k),k+=i[o].length;return a.write_shift(4,l),a.write_shift(4,i.length),Xa([a].concat(s).concat(i))}function PD(e,t,r){var a=e.content;if(!a)return{};xn(a,0);var s,i,l,o,d=0;a.chk("feff","Byte Order: "),a.read_shift(2);var u=a.read_shift(4),f=a.read_shift(16);if(f!==ut.utils.consts.HEADER_CLSID&&f!==r)throw new Error("Bad PropertySet CLSID "+f);if(s=a.read_shift(4),s!==1&&s!==2)throw new Error("Unrecognized #Sets: "+s);if(i=a.read_shift(16),o=a.read_shift(4),s===1&&o!==a.l)throw new Error("Length mismatch: "+o+" !== "+a.l);s===2&&(l=a.read_shift(16),d=a.read_shift(4));var p=RD(a,t),x={SystemIdentifier:u};for(var m in p)x[m]=p[m];if(x.FMTID=i,s===1)return x;if(d-a.l==2&&(a.l+=2),a.l!==d)throw new Error("Length mismatch 2: "+a.l+" !== "+d);var b;try{b=RD(a,null)}catch{}for(m in b)x[m]=b[m];return x.FMTID=[i,l],x}function LD(e,t,r,a,s,i){var l=Re(s?68:48),o=[l];l.write_shift(2,65534),l.write_shift(2,0),l.write_shift(4,842412599),l.write_shift(16,ut.utils.consts.HEADER_CLSID,"hex"),l.write_shift(4,s?2:1),l.write_shift(16,t,"hex"),l.write_shift(4,s?68:48);var d=OD(e,r,a);if(o.push(d),s){var u=OD(s,null,null);l.write_shift(16,i,"hex"),l.write_shift(4,68+d.length),o.push(u)}return Xa(o)}function dc(e,t){return e.read_shift(t),null}function vbe(e,t){t||(t=Re(e));for(var r=0;r<e;++r)t.write_shift(1,0);return t}function ybe(e,t,r){for(var a=[],s=e.l+t;e.l<s;)a.push(r(e,s-e.l));if(s!==e.l)throw new Error("Slurp error");return a}function Aa(e,t){return e.read_shift(t)===1}function $n(e,t){return t||(t=Re(2)),t.write_shift(2,+!!e),t}function Ca(e){return e.read_shift(2,"u")}function di(e,t){return t||(t=Re(2)),t.write_shift(2,e),t}function d9(e,t){return ybe(e,t,Ca)}function wbe(e){var t=e.read_shift(1),r=e.read_shift(1);return r===1?t:t===1}function u9(e,t,r){return r||(r=Re(2)),r.write_shift(1,t=="e"?+e:+!!e),r.write_shift(1,t=="e"?1:0),r}function Jp(e,t,r){var a=e.read_shift(r&&r.biff>=12?2:1),s="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var i=e.read_shift(1);i&&(s="dbcs-cont")}else r.biff==12&&(s="wstr");r.biff>=2&&r.biff<=5&&(s="cpstr");var l=a?e.read_shift(a,s):"";return l}function Nbe(e){var t=e.read_shift(2),r=e.read_shift(1),a=r&4,s=r&8,i=1+(r&1),l=0,o,d={};s&&(l=e.read_shift(2)),a&&(o=e.read_shift(4));var u=i==2?"dbcs-cont":"sbcs-cont",f=t===0?"":e.read_shift(t,u);return s&&(e.l+=4*l),a&&(e.l+=o),d.t=f,s||(d.raw="<t>"+d.t+"</t>",d.r=d.t),d}function Cbe(e){var t=e.t||"",r=Re(3);r.write_shift(2,t.length),r.write_shift(1,1);var a=Re(2*t.length);a.write_shift(2*t.length,t,"utf16le");var s=[r,a];return Xa(s)}function qd(e,t,r){var a;if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}var s=e.read_shift(1);return s===0?a=e.read_shift(t,"sbcs-cont"):a=e.read_shift(t,"dbcs-cont"),a}function Zp(e,t,r){var a=e.read_shift(r&&r.biff==2?1:2);return a===0?(e.l++,""):qd(e,a,r)}function cu(e,t,r){if(r.biff>5)return Zp(e,t,r);var a=e.read_shift(1);return a===0?(e.l++,""):e.read_shift(a,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function A9(e,t,r){return r||(r=Re(3+2*e.length)),r.write_shift(2,e.length),r.write_shift(1,1),r.write_shift(31,e,"utf16le"),r}function kbe(e){var t=e.read_shift(1);e.l++;var r=e.read_shift(2);return e.l+=2,[t,r]}function jbe(e){var t=e.read_shift(4),r=e.l,a=!1;t>24&&(e.l+=t-24,e.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(a=!0),e.l=r);var s=e.read_shift((a?t-24:t)>>1,"utf16le").replace(Kn,"");return a&&(e.l+=24),s}function Ebe(e){for(var t=e.read_shift(2),r="";t-- >0;)r+="../";var a=e.read_shift(0,"lpstr-ansi");if(e.l+=2,e.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var s=e.read_shift(4);if(s===0)return r+a.replace(/\\/g,"/");var i=e.read_shift(4);if(e.read_shift(2)!=3)throw new Error("Bad FileMoniker");var l=e.read_shift(i>>1,"utf16le").replace(Kn,"");return r+l}function Sbe(e,t){var r=e.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return jbe(e);case"0303000000000000c000000000000046":return Ebe(e);default:throw new Error("Unsupported Moniker "+r)}}function zx(e){var t=e.read_shift(4),r=t>0?e.read_shift(t,"utf16le").replace(Kn,""):"";return r}function QD(e,t){t||(t=Re(6+e.length*2)),t.write_shift(4,1+e.length);for(var r=0;r<e.length;++r)t.write_shift(2,e.charCodeAt(r));return t.write_shift(2,0),t}function Bbe(e,t){var r=e.l+t,a=e.read_shift(4);if(a!==2)throw new Error("Unrecognized streamVersion: "+a);var s=e.read_shift(2);e.l+=2;var i,l,o,d,u="",f,p;s&16&&(i=zx(e,r-e.l)),s&128&&(l=zx(e,r-e.l)),(s&257)===257&&(o=zx(e,r-e.l)),(s&257)===1&&(d=Sbe(e,r-e.l)),s&8&&(u=zx(e,r-e.l)),s&32&&(f=e.read_shift(16)),s&64&&(p=vE(e)),e.l=r;var x=l||o||d||"";x&&u&&(x+="#"+u),x||(x="#"+u),s&2&&x.charAt(0)=="/"&&x.charAt(1)!="/"&&(x="file://"+x);var m={Target:x};return f&&(m.guid=f),p&&(m.time=p),i&&(m.Tooltip=i),m}function _be(e){var t=Re(512),r=0,a=e.Target;a.slice(0,7)=="file://"&&(a=a.slice(7));var s=a.indexOf("#"),i=s>-1?31:23;switch(a.charAt(0)){case"#":i=28;break;case".":i&=-3;break}t.write_shift(4,2),t.write_shift(4,i);var l=[8,6815827,6619237,4849780,83];for(r=0;r<l.length;++r)t.write_shift(4,l[r]);if(i==28)a=a.slice(1),QD(a,t);else if(i&2){for(l="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<l.length;++r)t.write_shift(1,parseInt(l[r],16));var o=s>-1?a.slice(0,s):a;for(t.write_shift(4,2*(o.length+1)),r=0;r<o.length;++r)t.write_shift(2,o.charCodeAt(r));t.write_shift(2,0),i&8&&QD(s>-1?a.slice(s+1):"",t)}else{for(l="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),r=0;r<l.length;++r)t.write_shift(1,parseInt(l[r],16));for(var d=0;a.slice(d*3,d*3+3)=="../"||a.slice(d*3,d*3+3)=="..\\";)++d;for(t.write_shift(2,d),t.write_shift(4,a.length-3*d+1),r=0;r<a.length-3*d;++r)t.write_shift(1,a.charCodeAt(r+3*d)&255);for(t.write_shift(1,0),t.write_shift(2,65535),t.write_shift(2,57005),r=0;r<6;++r)t.write_shift(4,0)}return t.slice(0,t.l)}function f9(e){var t=e.read_shift(1),r=e.read_shift(1),a=e.read_shift(1),s=e.read_shift(1);return[t,r,a,s]}function p9(e,t){var r=f9(e);return r[3]=0,r}function Tl(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2);return{r:t,c:r,ixfe:a}}function Wd(e,t,r,a){return a||(a=Re(6)),a.write_shift(2,e),a.write_shift(2,t),a.write_shift(2,r||0),a}function Tbe(e){var t=e.read_shift(2),r=e.read_shift(2);return e.l+=8,{type:t,flags:r}}function Fbe(e,t,r){return t===0?"":cu(e,t,r)}function Ibe(e,t,r){var a=r.biff>8?4:2,s=e.read_shift(a),i=e.read_shift(a,"i"),l=e.read_shift(a,"i");return[s,i,l]}function h9(e){var t=e.read_shift(2),r=mE(e);return[t,r]}function Dbe(e,t,r){e.l+=4,t-=4;var a=e.l+t,s=Jp(e,t,r),i=e.read_shift(2);if(a-=e.l,i!==a)throw new Error("Malformed AddinUdf: padding = "+a+" != "+i);return e.l+=i,s}function dv(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2);return{s:{c:a,r:t},e:{c:s,r}}}function x9(e,t){return t||(t=Re(8)),t.write_shift(2,e.s.r),t.write_shift(2,e.e.r),t.write_shift(2,e.s.c),t.write_shift(2,e.e.c),t}function m9(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(1),s=e.read_shift(1);return{s:{c:a,r:t},e:{c:s,r}}}var Ube=m9;function g9(e){e.l+=4;var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2);return e.l+=12,[r,t,a]}function Mbe(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t}function Rbe(e){var t={};return e.l+=4,e.cf=e.read_shift(2),t}function En(e){e.l+=2,e.l+=e.read_shift(2)}var Obe={0:En,4:En,5:En,6:En,7:Rbe,8:En,9:En,10:En,11:En,12:En,13:Mbe,14:En,15:En,16:En,17:En,18:En,19:En,20:En,21:g9};function Pbe(e,t){for(var r=e.l+t,a=[];e.l<r;){var s=e.read_shift(2);e.l-=2;try{a.push(Obe[s](e,r-e.l))}catch{return e.l=r,a}}return e.l!=r&&(e.l=r),a}function $x(e,t){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=e.read_shift(2),t-=2,t>=2&&(r.dt=e.read_shift(2),e.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(t>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return e.read_shift(t),r}function yE(e,t,r){var a=1536,s=16;switch(r.bookType){case"biff8":break;case"biff5":a=1280,s=8;break;case"biff4":a=4,s=6;break;case"biff3":a=3,s=6;break;case"biff2":a=2,s=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var i=Re(s);return i.write_shift(2,a),i.write_shift(2,t),s>4&&i.write_shift(2,29282),s>6&&i.write_shift(2,1997),s>8&&(i.write_shift(2,49161),i.write_shift(2,1),i.write_shift(2,1798),i.write_shift(2,0)),i}function Lbe(e,t){return t===0||e.read_shift(2),1200}function Qbe(e,t,r){if(r.enc)return e.l+=t,"";var a=e.l,s=cu(e,0,r);return e.read_shift(t+a-e.l),s}function Hbe(e,t){var r=!t||t.biff==8,a=Re(r?112:54);for(a.write_shift(t.biff==8?2:1,7),r&&a.write_shift(1,0),a.write_shift(4,859007059),a.write_shift(4,5458548|(r?0:536870912));a.l<a.length;)a.write_shift(1,r?0:32);return a}function zbe(e,t,r){var a=r&&r.biff==8||t==2?e.read_shift(2):(e.l+=t,0);return{fDialog:a&16,fBelow:a&64,fRight:a&128}}function $be(e,t,r){var a=e.read_shift(4),s=e.read_shift(1)&3,i=e.read_shift(1);switch(i){case 0:i="Worksheet";break;case 1:i="Macrosheet";break;case 2:i="Chartsheet";break;case 6:i="VBAModule";break}var l=Jp(e,0,r);return l.length===0&&(l="Sheet1"),{pos:a,hs:s,dt:i,name:l}}function Vbe(e,t){var r=!t||t.biff>=8?2:1,a=Re(8+r*e.name.length);a.write_shift(4,e.pos),a.write_shift(1,e.hs||0),a.write_shift(1,e.dt),a.write_shift(1,e.name.length),t.biff>=8&&a.write_shift(1,1),a.write_shift(r*e.name.length,e.name,t.biff<8?"sbcs":"utf16le");var s=a.slice(0,a.l);return s.l=a.l,s}function Gbe(e,t){for(var r=e.l+t,a=e.read_shift(4),s=e.read_shift(4),i=[],l=0;l!=s&&e.l<r;++l)i.push(Nbe(e));return i.Count=a,i.Unique=s,i}function Kbe(e,t){var r=Re(8);r.write_shift(4,e.Count),r.write_shift(4,e.Unique);for(var a=[],s=0;s<e.length;++s)a[s]=Cbe(e[s]);var i=Xa([r].concat(a));return i.parts=[r.length].concat(a.map(function(l){return l.length})),i}function qbe(e,t){var r={};return r.dsst=e.read_shift(2),e.l+=t-2,r}function Wbe(e){var t={};t.r=e.read_shift(2),t.c=e.read_shift(2),t.cnt=e.read_shift(2)-t.c;var r=e.read_shift(2);e.l+=4;var a=e.read_shift(1);return e.l+=3,a&7&&(t.level=a&7),a&32&&(t.hidden=!0),a&64&&(t.hpt=r/20),t}function Ybe(e){var t=Tbe(e);if(t.type!=2211)throw new Error("Invalid Future Record "+t.type);var r=e.read_shift(4);return r!==0}function Xbe(e){return e.read_shift(2),e.read_shift(4)}function HD(e,t,r){var a=0;r&&r.biff==2||(a=e.read_shift(2));var s=e.read_shift(2);r&&r.biff==2&&(a=1-(s>>15),s&=32767);var i={Unsynced:a&1,DyZero:(a&2)>>1,ExAsc:(a&4)>>2,ExDsc:(a&8)>>3};return[i,s]}function Jbe(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2),l=e.read_shift(2),o=e.read_shift(2),d=e.read_shift(2),u=e.read_shift(2);return{Pos:[t,r],Dim:[a,s],Flags:i,CurTab:l,FirstTab:o,Selected:d,TabRatio:u}}function Zbe(){var e=Re(18);return e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,29280),e.write_shift(2,17600),e.write_shift(2,56),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,1),e.write_shift(2,500),e}function eve(e,t,r){if(r&&r.biff>=2&&r.biff<5)return{};var a=e.read_shift(2);return{RTL:a&64}}function tve(e){var t=Re(18),r=1718;return e&&e.RTL&&(r|=64),t.write_shift(2,r),t.write_shift(4,0),t.write_shift(4,64),t.write_shift(4,0),t.write_shift(4,0),t}function rve(){}function ave(e,t,r){var a={dyHeight:e.read_shift(2),fl:e.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:e.l+=2;break;default:e.l+=10;break}return a.name=Jp(e,0,r),a}function nve(e,t){var r=e.name||"Arial",a=t&&t.biff==5,s=a?15+r.length:16+2*r.length,i=Re(s);return i.write_shift(2,e.sz*20),i.write_shift(4,0),i.write_shift(2,400),i.write_shift(4,0),i.write_shift(2,0),i.write_shift(1,r.length),a||i.write_shift(1,1),i.write_shift((a?1:2)*r.length,r,a?"sbcs":"utf16le"),i}function sve(e){var t=Tl(e);return t.isst=e.read_shift(4),t}function ive(e,t,r,a){var s=Re(10);return Wd(e,t,a,s),s.write_shift(4,r),s}function lve(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var a=e.l+t,s=Tl(e);r.biff==2&&e.l++;var i=Zp(e,a-e.l,r);return s.val=i,s}function ove(e,t,r,a,s){var i=!s||s.biff==8,l=Re(8+ +i+(1+i)*r.length);return Wd(e,t,a,l),l.write_shift(2,r.length),i&&l.write_shift(1,1),l.write_shift((1+i)*r.length,r,i?"utf16le":"sbcs"),l}function cve(e,t,r){var a=e.read_shift(2),s=cu(e,0,r);return[a,s]}function dve(e,t,r,a){var s=r&&r.biff==5;a||(a=Re(s?3+t.length:5+2*t.length)),a.write_shift(2,e),a.write_shift(s?1:2,t.length),s||a.write_shift(1,1),a.write_shift((s?1:2)*t.length,t,s?"sbcs":"utf16le");var i=a.length>a.l?a.slice(0,a.l):a;return i.l==null&&(i.l=i.length),i}var uve=cu;function zD(e,t,r){var a=e.l+t,s=r.biff==8||!r.biff?4:2,i=e.read_shift(s),l=e.read_shift(s),o=e.read_shift(2),d=e.read_shift(2);return e.l=a,{s:{r:i,c:o},e:{r:l,c:d}}}function Ave(e,t){var r=t.biff==8||!t.biff?4:2,a=Re(2*r+6);return a.write_shift(r,e.s.r),a.write_shift(r,e.e.r+1),a.write_shift(2,e.s.c),a.write_shift(2,e.e.c+1),a.write_shift(2,0),a}function fve(e){var t=e.read_shift(2),r=e.read_shift(2),a=h9(e);return{r:t,c:r,ixfe:a[0],rknum:a[1]}}function pve(e,t){for(var r=e.l+t-2,a=e.read_shift(2),s=e.read_shift(2),i=[];e.l<r;)i.push(h9(e));if(e.l!==r)throw new Error("MulRK read error");var l=e.read_shift(2);if(i.length!=l-s+1)throw new Error("MulRK length mismatch");return{r:a,c:s,C:l,rkrec:i}}function hve(e,t){for(var r=e.l+t-2,a=e.read_shift(2),s=e.read_shift(2),i=[];e.l<r;)i.push(e.read_shift(2));if(e.l!==r)throw new Error("MulBlank read error");var l=e.read_shift(2);if(i.length!=l-s+1)throw new Error("MulBlank length mismatch");return{r:a,c:s,C:l,ixfe:i}}function xve(e,t,r,a){var s={},i=e.read_shift(4),l=e.read_shift(4),o=e.read_shift(4),d=e.read_shift(2);return s.patternType=Yge[o>>26],a.cellStyles&&(s.alc=i&7,s.fWrap=i>>3&1,s.alcV=i>>4&7,s.fJustLast=i>>7&1,s.trot=i>>8&255,s.cIndent=i>>16&15,s.fShrinkToFit=i>>20&1,s.iReadOrder=i>>22&2,s.fAtrNum=i>>26&1,s.fAtrFnt=i>>27&1,s.fAtrAlc=i>>28&1,s.fAtrBdr=i>>29&1,s.fAtrPat=i>>30&1,s.fAtrProt=i>>31&1,s.dgLeft=l&15,s.dgRight=l>>4&15,s.dgTop=l>>8&15,s.dgBottom=l>>12&15,s.icvLeft=l>>16&127,s.icvRight=l>>23&127,s.grbitDiag=l>>30&3,s.icvTop=o&127,s.icvBottom=o>>7&127,s.icvDiag=o>>14&127,s.dgDiag=o>>21&15,s.icvFore=d&127,s.icvBack=d>>7&127,s.fsxButton=d>>14&1),s}function mve(e,t,r){var a={};return a.ifnt=e.read_shift(2),a.numFmtId=e.read_shift(2),a.flags=e.read_shift(2),a.fStyle=a.flags>>2&1,t-=6,a.data=xve(e,t,a.fStyle,r),a}function $D(e,t,r,a){var s=r&&r.biff==5;a||(a=Re(s?16:20)),a.write_shift(2,0),e.style?(a.write_shift(2,e.numFmtId||0),a.write_shift(2,65524)):(a.write_shift(2,e.numFmtId||0),a.write_shift(2,t<<4));var i=0;return e.numFmtId>0&&s&&(i|=1024),a.write_shift(4,i),a.write_shift(4,0),s||a.write_shift(4,0),a.write_shift(2,0),a}function gve(e){e.l+=4;var t=[e.read_shift(2),e.read_shift(2)];if(t[0]!==0&&t[0]--,t[1]!==0&&t[1]--,t[0]>7||t[1]>7)throw new Error("Bad Gutters: "+t.join("|"));return t}function bve(e){var t=Re(8);return t.write_shift(4,0),t.write_shift(2,0),t.write_shift(2,0),t}function VD(e,t,r){var a=Tl(e);(r.biff==2||t==9)&&++e.l;var s=wbe(e);return a.val=s,a.t=s===!0||s===!1?"b":"e",a}function vve(e,t,r,a,s,i){var l=Re(8);return Wd(e,t,a,l),u9(r,i,l),l}function yve(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var a=Tl(e),s=Un(e);return a.val=s,a}function wve(e,t,r,a){var s=Re(14);return Wd(e,t,a,s),Kd(r,s),s}var GD=Fbe;function Nve(e,t,r){var a=e.l+t,s=e.read_shift(2),i=e.read_shift(2);if(r.sbcch=i,i==1025||i==14849)return[i,s];if(i<1||i>255)throw new Error("Unexpected SupBook type: "+i);for(var l=qd(e,i),o=[];a>e.l;)o.push(Zp(e));return[i,s,l,o]}function KD(e,t,r){var a=e.read_shift(2),s,i={fBuiltIn:a&1,fWantAdvise:a>>>1&1,fWantPict:a>>>2&1,fOle:a>>>3&1,fOleLink:a>>>4&1,cf:a>>>5&1023,fIcon:a>>>15&1};return r.sbcch===14849&&(s=Dbe(e,t-2,r)),i.body=s||e.read_shift(t-2),typeof s=="string"&&(i.Name=s),i}var Cve=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function qD(e,t,r){var a=e.l+t,s=e.read_shift(2),i=e.read_shift(1),l=e.read_shift(1),o=e.read_shift(r&&r.biff==2?1:2),d=0;(!r||r.biff>=5)&&(r.biff!=5&&(e.l+=2),d=e.read_shift(2),r.biff==5&&(e.l+=2),e.l+=4);var u=qd(e,l,r);s&32&&(u=Cve[u.charCodeAt(0)]);var f=a-e.l;r&&r.biff==2&&--f;var p=a==e.l||o===0||!(f>0)?[]:P2e(e,f,r,o);return{chKey:i,Name:u,itab:d,rgce:p}}function b9(e,t,r){if(r.biff<8)return kve(e,t,r);for(var a=[],s=e.l+t,i=e.read_shift(r.biff>8?4:2);i--!==0;)a.push(Ibe(e,r.biff>8?12:6,r));if(e.l!=s)throw new Error("Bad ExternSheet: "+e.l+" != "+s);return a}function kve(e,t,r){e[e.l+1]==3&&e[e.l]++;var a=Jp(e,t,r);return a.charCodeAt(0)==3?a.slice(1):a}function jve(e,t,r){if(r.biff<8){e.l+=t;return}var a=e.read_shift(2),s=e.read_shift(2),i=qd(e,a,r),l=qd(e,s,r);return[i,l]}function Eve(e,t,r){var a=m9(e);e.l++;var s=e.read_shift(1);return t-=8,[L2e(e,t,r),s,a]}function WD(e,t,r){var a=Ube(e);switch(r.biff){case 2:e.l++,t-=7;break;case 3:case 4:e.l+=2,t-=8;break;default:e.l+=6,t-=12}return[a,R2e(e,t,r)]}function Sve(e){var t=e.read_shift(4)!==0,r=e.read_shift(4)!==0,a=e.read_shift(4);return[t,r,a]}function Bve(e,t,r){if(!(r.biff<8)){var a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2),l=e.read_shift(2),o=cu(e,0,r);return r.biff<8&&e.read_shift(1),[{r:a,c:s},o,l,i]}}function _ve(e,t,r){return Bve(e,t,r)}function Tve(e,t){for(var r=[],a=e.read_shift(2);a--;)r.push(dv(e));return r}function Fve(e){var t=Re(2+e.length*8);t.write_shift(2,e.length);for(var r=0;r<e.length;++r)x9(e[r],t);return t}function Ive(e,t,r){if(r&&r.biff<8)return Uve(e,t,r);var a=g9(e),s=Pbe(e,t-22,a[1]);return{cmo:a,ft:s}}var Dve={8:function(e,t){var r=e.l+t;e.l+=10;var a=e.read_shift(2);e.l+=4,e.l+=2,e.l+=2,e.l+=2,e.l+=4;var s=e.read_shift(1);return e.l+=s,e.l=r,{fmt:a}}};function Uve(e,t,r){e.l+=4;var a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2);e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=6,t-=36;var l=[];return l.push((Dve[a]||On)(e,t,r)),{cmo:[s,a,i],ft:l}}function Mve(e,t,r){var a=e.l,s="";try{e.l+=4;var i=(r.lastobj||{cmo:[0,0]}).cmo[1],l;[0,5,7,11,12,14].indexOf(i)==-1?e.l+=6:l=kbe(e,6,r);var o=e.read_shift(2);e.read_shift(2),Ca(e,2);var d=e.read_shift(2);e.l+=d;for(var u=1;u<e.lens.length-1;++u){if(e.l-a!=e.lens[u])throw new Error("TxO: bad continue record");var f=e[e.l],p=qd(e,e.lens[u+1]-e.lens[u]-1);if(s+=p,s.length>=(f?o:2*o))break}if(s.length!==o&&s.length!==o*2)throw new Error("cchText: "+o+" != "+s.length);return e.l=a+t,{t:s}}catch{return e.l=a+t,{t:s}}}function Rve(e,t){var r=dv(e);e.l+=16;var a=Bbe(e,t-24);return[r,a]}function Ove(e){var t=Re(24),r=Vr(e[0]);t.write_shift(2,r.r),t.write_shift(2,r.r),t.write_shift(2,r.c),t.write_shift(2,r.c);for(var a="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),s=0;s<16;++s)t.write_shift(1,parseInt(a[s],16));return Xa([t,_be(e[1])])}function Pve(e,t){e.read_shift(2);var r=dv(e),a=e.read_shift((t-10)/2,"dbcs-cont");return a=a.replace(Kn,""),[r,a]}function Lve(e){var t=e[1].Tooltip,r=Re(10+2*(t.length+1));r.write_shift(2,2048);var a=Vr(e[0]);r.write_shift(2,a.r),r.write_shift(2,a.r),r.write_shift(2,a.c),r.write_shift(2,a.c);for(var s=0;s<t.length;++s)r.write_shift(2,t.charCodeAt(s));return r.write_shift(2,0),r}function Qve(e){var t=[0,0],r;return r=e.read_shift(2),t[0]=ID[r]||r,r=e.read_shift(2),t[1]=ID[r]||r,t}function Hve(e){return e||(e=Re(4)),e.write_shift(2,1),e.write_shift(2,1),e}function zve(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(p9(e));return r}function $ve(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(p9(e));return r}function Vve(e){e.l+=2;var t={cxfs:0,crc:0};return t.cxfs=e.read_shift(2),t.crc=e.read_shift(4),t}function v9(e,t,r){if(!r.cellStyles)return On(e,t);var a=r&&r.biff>=12?4:2,s=e.read_shift(a),i=e.read_shift(a),l=e.read_shift(a),o=e.read_shift(a),d=e.read_shift(2);a==2&&(e.l+=2);var u={s,e:i,w:l,ixfe:o,flags:d};return(r.biff>=5||!r.biff)&&(u.level=d>>8&7),u}function Gve(e,t){var r=Re(12);r.write_shift(2,t),r.write_shift(2,t),r.write_shift(2,e.width*256),r.write_shift(2,0);var a=0;return e.hidden&&(a|=1),r.write_shift(1,a),a=e.level||0,r.write_shift(1,a),r.write_shift(2,0),r}function Kve(e,t){var r={};return t<32||(e.l+=16,r.header=Un(e),r.footer=Un(e),e.l+=2),r}function qve(e,t,r){var a={area:!1};if(r.biff!=5)return e.l+=t,a;var s=e.read_shift(1);return e.l+=3,s&16&&(a.area=!0),a}function Wve(e){for(var t=Re(2*e),r=0;r<e;++r)t.write_shift(2,r+1);return t}var Yve=Tl,Xve=d9,Jve=Zp;function Zve(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(4),s={fmt:t,env:r,len:a,data:e.slice(e.l,e.l+a)};return e.l+=a,s}function e1e(e,t,r){r.biffguess&&r.biff==5&&(r.biff=2);var a=Tl(e);++e.l;var s=cu(e,t-7,r);return a.t="str",a.val=s,a}function t1e(e){var t=Tl(e);++e.l;var r=Un(e);return t.t="n",t.val=r,t}function r1e(e,t,r){var a=Re(15);return ah(a,e,t),a.write_shift(8,r,"f"),a}function a1e(e){var t=Tl(e);++e.l;var r=e.read_shift(2);return t.t="n",t.val=r,t}function n1e(e,t,r){var a=Re(9);return ah(a,e,t),a.write_shift(2,r),a}function s1e(e){var t=e.read_shift(1);return t===0?(e.l++,""):e.read_shift(t,"sbcs-cont")}function i1e(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}function l1e(e,t,r){var a=e.l+t,s=Tl(e),i=e.read_shift(2),l=qd(e,i,r);return e.l=a,s.t="str",s.val=l,s}var o1e=[2,3,48,49,131,139,140,245],kC=(function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=lv({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(o,d){var u=[],f=Ic(1);switch(d.type){case"base64":f=Is(Qs(o));break;case"binary":f=Is(o);break;case"buffer":case"array":f=o;break}xn(f,0);var p=f.read_shift(1),x=!!(p&136),m=!1,b=!1;switch(p){case 2:break;case 3:break;case 48:m=!0,x=!0;break;case 49:m=!0,x=!0;break;case 131:break;case 139:break;case 140:b=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+p.toString(16))}var v=0,y=521;p==2&&(v=f.read_shift(2)),f.l+=3,p!=2&&(v=f.read_shift(4)),v>1048576&&(v=1e6),p!=2&&(y=f.read_shift(2));var k=f.read_shift(2),_=d.codepage||1252;p!=2&&(f.l+=16,f.read_shift(1),f[f.l]!==0&&(_=e[f[f.l]]),f.l+=1,f.l+=2),b&&(f.l+=36);for(var C=[],E={},T=Math.min(f.length,p==2?521:y-10-(m?264:0)),B=b?32:11;f.l<T&&f[f.l]!=13;)switch(E={},E.name=Ap.utils.decode(_,f.slice(f.l,f.l+B)).replace(/[\u0000\r\n].*$/g,""),f.l+=B,E.type=String.fromCharCode(f.read_shift(1)),p!=2&&!b&&(E.offset=f.read_shift(4)),E.len=f.read_shift(1),p==2&&(E.offset=f.read_shift(2)),E.dec=f.read_shift(1),E.name.length&&C.push(E),p!=2&&(f.l+=b?13:14),E.type){case"B":(!m||E.len!=8)&&d.WTF&&console.log("Skipping "+E.name+":"+E.type);break;case"G":case"P":d.WTF&&console.log("Skipping "+E.name+":"+E.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+E.type)}if(f[f.l]!==13&&(f.l=y-1),f.read_shift(1)!==13)throw new Error("DBF Terminator not found "+f.l+" "+f[f.l]);f.l=y;var I=0,M=0;for(u[0]=[],M=0;M!=C.length;++M)u[0][M]=C[M].name;for(;v-- >0;){if(f[f.l]===42){f.l+=k;continue}for(++f.l,u[++I]=[],M=0,M=0;M!=C.length;++M){var U=f.slice(f.l,f.l+C[M].len);f.l+=C[M].len,xn(U,0);var D=Ap.utils.decode(_,U);switch(C[M].type){case"C":D.trim().length&&(u[I][M]=D.replace(/\s+$/,""));break;case"D":D.length===8?u[I][M]=new Date(+D.slice(0,4),+D.slice(4,6)-1,+D.slice(6,8)):u[I][M]=D;break;case"F":u[I][M]=parseFloat(D.trim());break;case"+":case"I":u[I][M]=b?U.read_shift(-4,"i")^2147483648:U.read_shift(4,"i");break;case"L":switch(D.trim().toUpperCase()){case"Y":case"T":u[I][M]=!0;break;case"N":case"F":u[I][M]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+D+"|")}break;case"M":if(!x)throw new Error("DBF Unexpected MEMO for type "+p.toString(16));u[I][M]="##MEMO##"+(b?parseInt(D.trim(),10):U.read_shift(4));break;case"N":D=D.replace(/\u0000/g,"").trim(),D&&D!="."&&(u[I][M]=+D||0);break;case"@":u[I][M]=new Date(U.read_shift(-8,"f")-621356832e5);break;case"T":u[I][M]=new Date((U.read_shift(4)-2440588)*864e5+U.read_shift(4));break;case"Y":u[I][M]=U.read_shift(4,"i")/1e4+U.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[I][M]=-U.read_shift(-8,"f");break;case"B":if(m&&C[M].len==8){u[I][M]=U.read_shift(8,"f");break}case"G":case"P":U.l+=C[M].len;break;case"0":if(C[M].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+C[M].type)}}}if(p!=2&&f.l<f.length&&f[f.l++]!=26)throw new Error("DBF EOF Marker missing "+(f.l-1)+" of "+f.length+" "+f[f.l-1].toString(16));return d&&d.sheetRows&&(u=u.slice(0,d.sheetRows)),d.DBF=C,u}function a(o,d){var u=d||{};u.dateNF||(u.dateNF="yyyymmdd");var f=r0(r(o,u),u);return f["!cols"]=u.DBF.map(function(p){return{wch:p.len,DBF:p}}),delete u.DBF,f}function s(o,d){try{return Gc(a(o,d),d)}catch(u){if(d&&d.WTF)throw u}return{SheetNames:[],Sheets:{}}}var i={B:8,C:250,L:1,D:8,"?":0,"":0};function l(o,d){var u=d||{};if(+u.codepage>=0&&Mi(+u.codepage),u.type=="string")throw new Error("Cannot write DBF to JS string");var f=As(),p=Yg(o,{header:1,raw:!0,cellDates:!0}),x=p[0],m=p.slice(1),b=o["!cols"]||[],v=0,y=0,k=0,_=1;for(v=0;v<x.length;++v){if(((b[v]||{}).DBF||{}).name){x[v]=b[v].DBF.name,++k;continue}if(x[v]!=null){if(++k,typeof x[v]=="number"&&(x[v]=x[v].toString(10)),typeof x[v]!="string")throw new Error("DBF Invalid column name "+x[v]+" |"+typeof x[v]+"|");if(x.indexOf(x[v])!==v){for(y=0;y<1024;++y)if(x.indexOf(x[v]+"_"+y)==-1){x[v]+="_"+y;break}}}}var C=Kt(o["!ref"]),E=[],T=[],B=[];for(v=0;v<=C.e.c-C.s.c;++v){var I="",M="",U=0,D=[];for(y=0;y<m.length;++y)m[y][v]!=null&&D.push(m[y][v]);if(D.length==0||x[v]==null){E[v]="?";continue}for(y=0;y<D.length;++y){switch(typeof D[y]){case"number":M="B";break;case"string":M="C";break;case"boolean":M="L";break;case"object":M=D[y]instanceof Date?"D":"C";break;default:M="C"}U=Math.max(U,String(D[y]).length),I=I&&I!=M?"C":M}U>250&&(U=250),M=((b[v]||{}).DBF||{}).type,M=="C"&&b[v].DBF.len>U&&(U=b[v].DBF.len),I=="B"&&M=="N"&&(I="N",B[v]=b[v].DBF.dec,U=b[v].DBF.len),T[v]=I=="C"||M=="N"?U:i[I]||0,_+=T[v],E[v]=I}var L=f.next(32);for(L.write_shift(4,318902576),L.write_shift(4,m.length),L.write_shift(2,296+32*k),L.write_shift(2,_),v=0;v<4;++v)L.write_shift(4,0);for(L.write_shift(4,0|(+t[cQ]||3)<<8),v=0,y=0;v<x.length;++v)if(x[v]!=null){var R=f.next(32),Q=(x[v].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);R.write_shift(1,Q,"sbcs"),R.write_shift(1,E[v]=="?"?"C":E[v],"sbcs"),R.write_shift(4,y),R.write_shift(1,T[v]||i[E[v]]||0),R.write_shift(1,B[v]||0),R.write_shift(1,2),R.write_shift(4,0),R.write_shift(1,0),R.write_shift(4,0),R.write_shift(4,0),y+=T[v]||i[E[v]]||0}var G=f.next(264);for(G.write_shift(4,13),v=0;v<65;++v)G.write_shift(4,0);for(v=0;v<m.length;++v){var K=f.next(_);for(K.write_shift(1,0),y=0;y<x.length;++y)if(x[y]!=null)switch(E[y]){case"L":K.write_shift(1,m[v][y]==null?63:m[v][y]?84:70);break;case"B":K.write_shift(8,m[v][y]||0,"f");break;case"N":var W="0";for(typeof m[v][y]=="number"&&(W=m[v][y].toFixed(B[y]||0)),k=0;k<T[y]-W.length;++k)K.write_shift(1,32);K.write_shift(1,W,"sbcs");break;case"D":m[v][y]?(K.write_shift(4,("0000"+m[v][y].getFullYear()).slice(-4),"sbcs"),K.write_shift(2,("00"+(m[v][y].getMonth()+1)).slice(-2),"sbcs"),K.write_shift(2,("00"+m[v][y].getDate()).slice(-2),"sbcs")):K.write_shift(8,"00000000","sbcs");break;case"C":var z=String(m[v][y]!=null?m[v][y]:"").slice(0,T[y]);for(K.write_shift(1,z,"sbcs"),k=0;k<T[y]-z.length;++k)K.write_shift(1,32);break}}return f.next(1).write_shift(1,26),f.end()}return{to_workbook:s,to_sheet:a,from_sheet:l}})(),y9=(function(){var e={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("\x1BN("+oa(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(x,m){var b=e[m];return typeof b=="number"?iD(b):b},a=function(x,m,b){var v=m.charCodeAt(0)-32<<4|b.charCodeAt(0)-48;return v==59?x:iD(v)};e["|"]=254;function s(x,m){switch(m.type){case"base64":return i(Qs(x),m);case"binary":return i(x,m);case"buffer":return i(Dt&&Buffer.isBuffer(x)?x.toString("binary"):Vc(x),m);case"array":return i(Gd(x),m)}throw new Error("Unrecognized type "+m.type)}function i(x,m){var b=x.split(/[\n\r]+/),v=-1,y=-1,k=0,_=0,C=[],E=[],T=null,B={},I=[],M=[],U=[],D=0,L;for(+m.codepage>=0&&Mi(+m.codepage);k!==b.length;++k){D=0;var R=b[k].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,a).replace(t,r),Q=R.replace(/;;/g,"\0").split(";").map(function(J){return J.replace(/\u0000/g,";")}),G=Q[0],K;if(R.length>0)switch(G){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":Q[1].charAt(0)=="P"&&E.push(R.slice(3).replace(/;;/g,";"));break;case"C":var W=!1,z=!1,Z=!1,Y=!1,te=-1,O=-1;for(_=1;_<Q.length;++_)switch(Q[_].charAt(0)){case"A":break;case"X":y=parseInt(Q[_].slice(1))-1,z=!0;break;case"Y":for(v=parseInt(Q[_].slice(1))-1,z||(y=0),L=C.length;L<=v;++L)C[L]=[];break;case"K":K=Q[_].slice(1),K.charAt(0)==='"'?K=K.slice(1,K.length-1):K==="TRUE"?K=!0:K==="FALSE"?K=!1:isNaN(Hi(K))?isNaN(IA(K).getDate())||(K=_r(K)):(K=Hi(K),T!==null&&e0(T)&&(K=cv(K))),W=!0;break;case"E":Y=!0;var P=wA(Q[_].slice(1),{r:v,c:y});C[v][y]=[C[v][y],P];break;case"S":Z=!0,C[v][y]=[C[v][y],"S5S"];break;case"G":break;case"R":te=parseInt(Q[_].slice(1))-1;break;case"C":O=parseInt(Q[_].slice(1))-1;break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+R)}if(W&&(C[v][y]&&C[v][y].length==2?C[v][y][0]=K:C[v][y]=K,T=null),Z){if(Y)throw new Error("SYLK shared formula cannot have own formula");var q=te>-1&&C[te][O];if(!q||!q[1])throw new Error("SYLK shared formula cannot find base");C[v][y][1]=P9(q[1],{r:v-te,c:y-O})}break;case"F":var H=0;for(_=1;_<Q.length;++_)switch(Q[_].charAt(0)){case"X":y=parseInt(Q[_].slice(1))-1,++H;break;case"Y":for(v=parseInt(Q[_].slice(1))-1,L=C.length;L<=v;++L)C[L]=[];break;case"M":D=parseInt(Q[_].slice(1))/20;break;case"F":break;case"G":break;case"P":T=E[parseInt(Q[_].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(U=Q[_].slice(1).split(" "),L=parseInt(U[0],10);L<=parseInt(U[1],10);++L)D=parseInt(U[2],10),M[L-1]=D===0?{hidden:!0}:{wch:D},Dc(M[L-1]);break;case"C":y=parseInt(Q[_].slice(1))-1,M[y]||(M[y]={});break;case"R":v=parseInt(Q[_].slice(1))-1,I[v]||(I[v]={}),D>0?(I[v].hpt=D,I[v].hpx=UA(D)):D===0&&(I[v].hidden=!0);break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+R)}H<1&&(T=null);break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+R)}}return I.length>0&&(B["!rows"]=I),M.length>0&&(B["!cols"]=M),m&&m.sheetRows&&(C=C.slice(0,m.sheetRows)),[C,B]}function l(x,m){var b=s(x,m),v=b[0],y=b[1],k=r0(v,m);return oa(y).forEach(function(_){k[_]=y[_]}),k}function o(x,m){return Gc(l(x,m),m)}function d(x,m,b,v){var y="C;Y"+(b+1)+";X"+(v+1)+";K";switch(x.t){case"n":y+=x.v||0,x.f&&!x.F&&(y+=";E"+EE(x.f,{r:b,c:v}));break;case"b":y+=x.v?"TRUE":"FALSE";break;case"e":y+=x.w||x.v;break;case"d":y+='"'+(x.w||x.v)+'"';break;case"s":y+='"'+x.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return y}function u(x,m){m.forEach(function(b,v){var y="F;W"+(v+1)+" "+(v+1)+" ";b.hidden?y+="0":(typeof b.width=="number"&&!b.wpx&&(b.wpx=vp(b.width)),typeof b.wpx=="number"&&!b.wch&&(b.wch=yp(b.wpx)),typeof b.wch=="number"&&(y+=Math.round(b.wch))),y.charAt(y.length-1)!=" "&&x.push(y)})}function f(x,m){m.forEach(function(b,v){var y="F;";b.hidden?y+="M0;":b.hpt?y+="M"+20*b.hpt+";":b.hpx&&(y+="M"+20*wp(b.hpx)+";"),y.length>2&&x.push(y+"R"+(v+1))})}function p(x,m){var b=["ID;PWXL;N;E"],v=[],y=Kt(x["!ref"]),k,_=Array.isArray(x),C=`\r
`;b.push("P;PGeneral"),b.push("F;P0;DG0G8;M255"),x["!cols"]&&u(b,x["!cols"]),x["!rows"]&&f(b,x["!rows"]),b.push("B;Y"+(y.e.r-y.s.r+1)+";X"+(y.e.c-y.s.c+1)+";D"+[y.s.c,y.s.r,y.e.c,y.e.r].join(" "));for(var E=y.s.r;E<=y.e.r;++E)for(var T=y.s.c;T<=y.e.c;++T){var B=bt({r:E,c:T});k=_?(x[E]||[])[T]:x[B],!(!k||k.v==null&&(!k.f||k.F))&&v.push(d(k,x,E,T))}return b.join(C)+C+v.join(C)+C+"E"+C}return{to_workbook:o,to_sheet:l,from_sheet:p}})(),w9=(function(){function e(i,l){switch(l.type){case"base64":return t(Qs(i),l);case"binary":return t(i,l);case"buffer":return t(Dt&&Buffer.isBuffer(i)?i.toString("binary"):Vc(i),l);case"array":return t(Gd(i),l)}throw new Error("Unrecognized type "+l.type)}function t(i,l){for(var o=i.split(`
`),d=-1,u=-1,f=0,p=[];f!==o.length;++f){if(o[f].trim()==="BOT"){p[++d]=[],u=0;continue}if(!(d<0)){var x=o[f].trim().split(","),m=x[0],b=x[1];++f;for(var v=o[f]||"";(v.match(/["]/g)||[]).length&1&&f<o.length-1;)v+=`
`+o[++f];switch(v=v.trim(),+m){case-1:if(v==="BOT"){p[++d]=[],u=0;continue}else if(v!=="EOD")throw new Error("Unrecognized DIF special command "+v);break;case 0:v==="TRUE"?p[d][u]=!0:v==="FALSE"?p[d][u]=!1:isNaN(Hi(b))?isNaN(IA(b).getDate())?p[d][u]=b:p[d][u]=_r(b):p[d][u]=Hi(b),++u;break;case 1:v=v.slice(1,v.length-1),v=v.replace(/""/g,'"'),v&&v.match(/^=".*"$/)&&(v=v.slice(2,-1)),p[d][u++]=v!==""?v:null;break}if(v==="EOD")break}}return l&&l.sheetRows&&(p=p.slice(0,l.sheetRows)),p}function r(i,l){return r0(e(i,l),l)}function a(i,l){return Gc(r(i,l),l)}var s=(function(){var i=function(d,u,f,p,x){d.push(u),d.push(f+","+p),d.push('"'+x.replace(/"/g,'""')+'"')},l=function(d,u,f,p){d.push(u+","+f),d.push(u==1?'"'+p.replace(/"/g,'""')+'"':p)};return function(d){var u=[],f=Kt(d["!ref"]),p,x=Array.isArray(d);i(u,"TABLE",0,1,"sheetjs"),i(u,"VECTORS",0,f.e.r-f.s.r+1,""),i(u,"TUPLES",0,f.e.c-f.s.c+1,""),i(u,"DATA",0,0,"");for(var m=f.s.r;m<=f.e.r;++m){l(u,-1,0,"BOT");for(var b=f.s.c;b<=f.e.c;++b){var v=bt({r:m,c:b});if(p=x?(d[m]||[])[b]:d[v],!p){l(u,1,0,"");continue}switch(p.t){case"n":var y=p.w;!y&&p.v!=null&&(y=p.v),y==null?p.f&&!p.F?l(u,1,0,"="+p.f):l(u,1,0,""):l(u,0,y,"V");break;case"b":l(u,0,p.v?1:0,p.v?"TRUE":"FALSE");break;case"s":l(u,1,0,isNaN(p.v)?p.v:'="'+p.v+'"');break;case"d":p.w||(p.w=Ni(p.z||gt[14],Qa(_r(p.v)))),l(u,0,p.w,"V");break;default:l(u,1,0,"")}}}l(u,-1,0,"EOD");var k=`\r
`,_=u.join(k);return _}})();return{to_workbook:a,to_sheet:r,from_sheet:s}})(),N9=(function(){function e(p){return p.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
`)}function t(p){return p.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(p,x){for(var m=p.split(`
`),b=-1,v=-1,y=0,k=[];y!==m.length;++y){var _=m[y].trim().split(":");if(_[0]==="cell"){var C=Vr(_[1]);if(k.length<=C.r)for(b=k.length;b<=C.r;++b)k[b]||(k[b]=[]);switch(b=C.r,v=C.c,_[2]){case"t":k[b][v]=e(_[3]);break;case"v":k[b][v]=+_[3];break;case"vtf":var E=_[_.length-1];case"vtc":switch(_[3]){case"nl":k[b][v]=!!+_[4];break;default:k[b][v]=+_[4];break}_[2]=="vtf"&&(k[b][v]=[k[b][v],E])}}}return x&&x.sheetRows&&(k=k.slice(0,x.sheetRows)),k}function a(p,x){return r0(r(p,x),x)}function s(p,x){return Gc(a(p,x),x)}var i=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
`),l=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
`)+`
`,o=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
`),d="--SocialCalcSpreadsheetControlSave--";function u(p){if(!p||!p["!ref"])return"";for(var x=[],m=[],b,v="",y=xs(p["!ref"]),k=Array.isArray(p),_=y.s.r;_<=y.e.r;++_)for(var C=y.s.c;C<=y.e.c;++C)if(v=bt({r:_,c:C}),b=k?(p[_]||[])[C]:p[v],!(!b||b.v==null||b.t==="z")){switch(m=["cell",v,"t"],b.t){case"s":case"str":m.push(t(b.v));break;case"n":b.f?(m[2]="vtf",m[3]="n",m[4]=b.v,m[5]=t(b.f)):(m[2]="v",m[3]=b.v);break;case"b":m[2]="vt"+(b.f?"f":"c"),m[3]="nl",m[4]=b.v?"1":"0",m[5]=t(b.f||(b.v?"TRUE":"FALSE"));break;case"d":var E=Qa(_r(b.v));m[2]="vtc",m[3]="nd",m[4]=""+E,m[5]=b.w||Ni(b.z||gt[14],E);break;case"e":continue}x.push(m.join(":"))}return x.push("sheet:c:"+(y.e.c-y.s.c+1)+":r:"+(y.e.r-y.s.r+1)+":tvf:1"),x.push("valueformat:1:text-wiki"),x.join(`
`)}function f(p){return[i,l,o,l,u(p),d].join(`
`)}return{to_workbook:s,to_sheet:a,from_sheet:f}})(),DA=(function(){function e(f,p,x,m,b){b.raw?p[x][m]=f:f===""||(f==="TRUE"?p[x][m]=!0:f==="FALSE"?p[x][m]=!1:isNaN(Hi(f))?isNaN(IA(f).getDate())?p[x][m]=f:p[x][m]=_r(f):p[x][m]=Hi(f))}function t(f,p){var x=p||{},m=[];if(!f||f.length===0)return m;for(var b=f.split(/[\r\n]/),v=b.length-1;v>=0&&b[v].length===0;)--v;for(var y=10,k=0,_=0;_<=v;++_)k=b[_].indexOf(" "),k==-1?k=b[_].length:k++,y=Math.max(y,k);for(_=0;_<=v;++_){m[_]=[];var C=0;for(e(b[_].slice(0,y).trim(),m,_,C,x),C=1;C<=(b[_].length-y)/10+1;++C)e(b[_].slice(y+(C-1)*10,y+C*10).trim(),m,_,C,x)}return x.sheetRows&&(m=m.slice(0,x.sheetRows)),m}var r={44:",",9:"	",59:";",124:"|"},a={44:3,9:2,59:1,124:0};function s(f){for(var p={},x=!1,m=0,b=0;m<f.length;++m)(b=f.charCodeAt(m))==34?x=!x:!x&&b in r&&(p[b]=(p[b]||0)+1);b=[];for(m in p)Object.prototype.hasOwnProperty.call(p,m)&&b.push([p[m],m]);if(!b.length){p=a;for(m in p)Object.prototype.hasOwnProperty.call(p,m)&&b.push([p[m],m])}return b.sort(function(v,y){return v[0]-y[0]||a[v[1]]-a[y[1]]}),r[b.pop()[1]]||44}function i(f,p){var x=p||{},m="",b=x.dense?[]:{},v={s:{c:0,r:0},e:{c:0,r:0}};f.slice(0,4)=="sep="?f.charCodeAt(5)==13&&f.charCodeAt(6)==10?(m=f.charAt(4),f=f.slice(7)):f.charCodeAt(5)==13||f.charCodeAt(5)==10?(m=f.charAt(4),f=f.slice(6)):m=s(f.slice(0,1024)):x&&x.FS?m=x.FS:m=s(f.slice(0,1024));var y=0,k=0,_=0,C=0,E=0,T=m.charCodeAt(0),B=!1,I=0,M=f.charCodeAt(0);f=f.replace(/\r\n/mg,`
`);var U=x.dateNF!=null?qme(x.dateNF):null;function D(){var L=f.slice(C,E),R={};if(L.charAt(0)=='"'&&L.charAt(L.length-1)=='"'&&(L=L.slice(1,-1).replace(/""/g,'"')),L.length===0)R.t="z";else if(x.raw)R.t="s",R.v=L;else if(L.trim().length===0)R.t="s",R.v=L;else if(L.charCodeAt(0)==61)L.charCodeAt(1)==34&&L.charCodeAt(L.length-1)==34?(R.t="s",R.v=L.slice(2,-1).replace(/""/g,'"')):Nwe(L)?(R.t="n",R.f=L.slice(1)):(R.t="s",R.v=L);else if(L=="TRUE")R.t="b",R.v=!0;else if(L=="FALSE")R.t="b",R.v=!1;else if(!isNaN(_=Hi(L)))R.t="n",x.cellText!==!1&&(R.w=L),R.v=_;else if(!isNaN(IA(L).getDate())||U&&L.match(U)){R.z=x.dateNF||gt[14];var Q=0;U&&L.match(U)&&(L=Wme(L,x.dateNF,L.match(U)||[]),Q=1),x.cellDates?(R.t="d",R.v=_r(L,Q)):(R.t="n",R.v=Qa(_r(L,Q))),x.cellText!==!1&&(R.w=Ni(R.z,R.v instanceof Date?Qa(R.v):R.v)),x.cellNF||delete R.z}else R.t="s",R.v=L;if(R.t=="z"||(x.dense?(b[y]||(b[y]=[]),b[y][k]=R):b[bt({c:k,r:y})]=R),C=E+1,M=f.charCodeAt(C),v.e.c<k&&(v.e.c=k),v.e.r<y&&(v.e.r=y),I==T)++k;else if(k=0,++y,x.sheetRows&&x.sheetRows<=y)return!0}e:for(;E<f.length;++E)switch(I=f.charCodeAt(E)){case 34:M===34&&(B=!B);break;case T:case 10:case 13:if(!B&&D())break e;break}return E-C>0&&D(),b["!ref"]=St(v),b}function l(f,p){return!(p&&p.PRN)||p.FS||f.slice(0,4)=="sep="||f.indexOf("	")>=0||f.indexOf(",")>=0||f.indexOf(";")>=0?i(f,p):r0(t(f,p),p)}function o(f,p){var x="",m=p.type=="string"?[0,0,0,0]:UE(f,p);switch(p.type){case"base64":x=Qs(f);break;case"binary":x=f;break;case"buffer":p.codepage==65001?x=f.toString("utf8"):p.codepage&&typeof Ap<"u"||(x=Dt&&Buffer.isBuffer(f)?f.toString("binary"):Vc(f));break;case"array":x=Gd(f);break;case"string":x=f;break;default:throw new Error("Unrecognized type "+p.type)}return m[0]==239&&m[1]==187&&m[2]==191?x=hr(x.slice(3)):p.type!="string"&&p.type!="buffer"&&p.codepage==65001?x=hr(x):p.type=="binary"&&typeof Ap<"u",x.slice(0,19)=="socialcalc:version:"?N9.to_sheet(p.type=="string"?x:hr(x),p):l(x,p)}function d(f,p){return Gc(o(f,p),p)}function u(f){for(var p=[],x=Kt(f["!ref"]),m,b=Array.isArray(f),v=x.s.r;v<=x.e.r;++v){for(var y=[],k=x.s.c;k<=x.e.c;++k){var _=bt({r:v,c:k});if(m=b?(f[v]||[])[k]:f[_],!m||m.v==null){y.push("          ");continue}for(var C=(m.w||(No(m),m.w)||"").slice(0,10);C.length<10;)C+=" ";y.push(C+(k===0?" ":""))}p.push(y.join(""))}return p.join(`
`)}return{to_workbook:d,to_sheet:o,from_sheet:u}})();function c1e(e,t){var r=t||{},a=!!r.WTF;r.WTF=!0;try{var s=y9.to_workbook(e,r);return r.WTF=a,s}catch(i){if(r.WTF=a,!i.message.match(/SYLK bad record ID/)&&a)throw i;return DA.to_workbook(e,t)}}var Fd=(function(){function e(P,q,H){if(P){xn(P,P.l||0);for(var J=H.Enum||te;P.l<P.length;){var ae=P.read_shift(2),oe=J[ae]||J[65535],ce=P.read_shift(2),ne=P.l+ce,le=oe.f&&oe.f(P,ce,H);if(P.l=ne,q(le,oe,ae))return}}}function t(P,q){switch(q.type){case"base64":return r(Is(Qs(P)),q);case"binary":return r(Is(P),q);case"buffer":case"array":return r(P,q)}throw"Unsupported type "+q.type}function r(P,q){if(!P)return P;var H=q||{},J=H.dense?[]:{},ae="Sheet1",oe="",ce=0,ne={},le=[],ge=[],X={s:{r:0,c:0},e:{r:0,c:0}},pe=H.sheetRows||0;if(P[2]==0&&(P[3]==8||P[3]==9)&&P.length>=16&&P[14]==5&&P[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(P[2]==2)H.Enum=te,e(P,function(Te,Xe,At){switch(At){case 0:H.vers=Te,Te>=4096&&(H.qpro=!0);break;case 6:X=Te;break;case 204:Te&&(oe=Te);break;case 222:oe=Te;break;case 15:case 51:H.qpro||(Te[1].v=Te[1].v.slice(1));case 13:case 14:case 16:At==14&&(Te[2]&112)==112&&(Te[2]&15)>1&&(Te[2]&15)<15&&(Te[1].z=H.dateNF||gt[14],H.cellDates&&(Te[1].t="d",Te[1].v=cv(Te[1].v))),H.qpro&&Te[3]>ce&&(J["!ref"]=St(X),ne[ae]=J,le.push(ae),J=H.dense?[]:{},X={s:{r:0,c:0},e:{r:0,c:0}},ce=Te[3],ae=oe||"Sheet"+(ce+1),oe="");var kt=H.dense?(J[Te[0].r]||[])[Te[0].c]:J[bt(Te[0])];if(kt){kt.t=Te[1].t,kt.v=Te[1].v,Te[1].z!=null&&(kt.z=Te[1].z),Te[1].f!=null&&(kt.f=Te[1].f);break}H.dense?(J[Te[0].r]||(J[Te[0].r]=[]),J[Te[0].r][Te[0].c]=Te[1]):J[bt(Te[0])]=Te[1];break}},H);else if(P[2]==26||P[2]==14)H.Enum=O,P[2]==14&&(H.qpro=!0,P.l=0),e(P,function(Te,Xe,At){switch(At){case 204:ae=Te;break;case 22:Te[1].v=Te[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(Te[3]>ce&&(J["!ref"]=St(X),ne[ae]=J,le.push(ae),J=H.dense?[]:{},X={s:{r:0,c:0},e:{r:0,c:0}},ce=Te[3],ae="Sheet"+(ce+1)),pe>0&&Te[0].r>=pe)break;H.dense?(J[Te[0].r]||(J[Te[0].r]=[]),J[Te[0].r][Te[0].c]=Te[1]):J[bt(Te[0])]=Te[1],X.e.c<Te[0].c&&(X.e.c=Te[0].c),X.e.r<Te[0].r&&(X.e.r=Te[0].r);break;case 27:Te[14e3]&&(ge[Te[14e3][0]]=Te[14e3][1]);break;case 1537:ge[Te[0]]=Te[1],Te[0]==ce&&(ae=Te[1]);break}},H);else throw new Error("Unrecognized LOTUS BOF "+P[2]);if(J["!ref"]=St(X),ne[oe||ae]=J,le.push(oe||ae),!ge.length)return{SheetNames:le,Sheets:ne};for(var be={},me=[],_e=0;_e<ge.length;++_e)ne[le[_e]]?(me.push(ge[_e]||le[_e]),be[ge[_e]]=ne[ge[_e]]||ne[le[_e]]):(me.push(ge[_e]),be[ge[_e]]={"!ref":"A1"});return{SheetNames:me,Sheets:be}}function a(P,q){var H=q||{};if(+H.codepage>=0&&Mi(+H.codepage),H.type=="string")throw new Error("Cannot write WK1 to JS string");var J=As(),ae=Kt(P["!ref"]),oe=Array.isArray(P),ce=[];We(J,0,i(1030)),We(J,6,d(ae));for(var ne=Math.min(ae.e.r,8191),le=ae.s.r;le<=ne;++le)for(var ge=pa(le),X=ae.s.c;X<=ae.e.c;++X){le===ae.s.r&&(ce[X]=$r(X));var pe=ce[X]+ge,be=oe?(P[le]||[])[X]:P[pe];if(!(!be||be.t=="z"))if(be.t=="n")(be.v|0)==be.v&&be.v>=-32768&&be.v<=32767?We(J,13,m(le,X,be.v)):We(J,14,v(le,X,be.v));else{var me=No(be);We(J,15,p(le,X,me.slice(0,239)))}}return We(J,1),J.end()}function s(P,q){var H=q||{};if(+H.codepage>=0&&Mi(+H.codepage),H.type=="string")throw new Error("Cannot write WK3 to JS string");var J=As();We(J,0,l(P));for(var ae=0,oe=0;ae<P.SheetNames.length;++ae)(P.Sheets[P.SheetNames[ae]]||{})["!ref"]&&We(J,27,Y(P.SheetNames[ae],oe++));var ce=0;for(ae=0;ae<P.SheetNames.length;++ae){var ne=P.Sheets[P.SheetNames[ae]];if(!(!ne||!ne["!ref"])){for(var le=Kt(ne["!ref"]),ge=Array.isArray(ne),X=[],pe=Math.min(le.e.r,8191),be=le.s.r;be<=pe;++be)for(var me=pa(be),_e=le.s.c;_e<=le.e.c;++_e){be===le.s.r&&(X[_e]=$r(_e));var Te=X[_e]+me,Xe=ge?(ne[be]||[])[_e]:ne[Te];if(!(!Xe||Xe.t=="z"))if(Xe.t=="n")We(J,23,D(be,_e,ce,Xe.v));else{var At=No(Xe);We(J,22,I(be,_e,ce,At.slice(0,239)))}}++ce}}return We(J,1),J.end()}function i(P){var q=Re(2);return q.write_shift(2,P),q}function l(P){var q=Re(26);q.write_shift(2,4096),q.write_shift(2,4),q.write_shift(4,0);for(var H=0,J=0,ae=0,oe=0;oe<P.SheetNames.length;++oe){var ce=P.SheetNames[oe],ne=P.Sheets[ce];if(!(!ne||!ne["!ref"])){++ae;var le=xs(ne["!ref"]);H<le.e.r&&(H=le.e.r),J<le.e.c&&(J=le.e.c)}}return H>8191&&(H=8191),q.write_shift(2,H),q.write_shift(1,ae),q.write_shift(1,J),q.write_shift(2,0),q.write_shift(2,0),q.write_shift(1,1),q.write_shift(1,2),q.write_shift(4,0),q.write_shift(4,0),q}function o(P,q,H){var J={s:{c:0,r:0},e:{c:0,r:0}};return q==8&&H.qpro?(J.s.c=P.read_shift(1),P.l++,J.s.r=P.read_shift(2),J.e.c=P.read_shift(1),P.l++,J.e.r=P.read_shift(2),J):(J.s.c=P.read_shift(2),J.s.r=P.read_shift(2),q==12&&H.qpro&&(P.l+=2),J.e.c=P.read_shift(2),J.e.r=P.read_shift(2),q==12&&H.qpro&&(P.l+=2),J.s.c==65535&&(J.s.c=J.e.c=J.s.r=J.e.r=0),J)}function d(P){var q=Re(8);return q.write_shift(2,P.s.c),q.write_shift(2,P.s.r),q.write_shift(2,P.e.c),q.write_shift(2,P.e.r),q}function u(P,q,H){var J=[{c:0,r:0},{t:"n",v:0},0,0];return H.qpro&&H.vers!=20768?(J[0].c=P.read_shift(1),J[3]=P.read_shift(1),J[0].r=P.read_shift(2),P.l+=2):(J[2]=P.read_shift(1),J[0].c=P.read_shift(2),J[0].r=P.read_shift(2)),J}function f(P,q,H){var J=P.l+q,ae=u(P,q,H);if(ae[1].t="s",H.vers==20768){P.l++;var oe=P.read_shift(1);return ae[1].v=P.read_shift(oe,"utf8"),ae}return H.qpro&&P.l++,ae[1].v=P.read_shift(J-P.l,"cstr"),ae}function p(P,q,H){var J=Re(7+H.length);J.write_shift(1,255),J.write_shift(2,q),J.write_shift(2,P),J.write_shift(1,39);for(var ae=0;ae<J.length;++ae){var oe=H.charCodeAt(ae);J.write_shift(1,oe>=128?95:oe)}return J.write_shift(1,0),J}function x(P,q,H){var J=u(P,q,H);return J[1].v=P.read_shift(2,"i"),J}function m(P,q,H){var J=Re(7);return J.write_shift(1,255),J.write_shift(2,q),J.write_shift(2,P),J.write_shift(2,H,"i"),J}function b(P,q,H){var J=u(P,q,H);return J[1].v=P.read_shift(8,"f"),J}function v(P,q,H){var J=Re(13);return J.write_shift(1,255),J.write_shift(2,q),J.write_shift(2,P),J.write_shift(8,H,"f"),J}function y(P,q,H){var J=P.l+q,ae=u(P,q,H);if(ae[1].v=P.read_shift(8,"f"),H.qpro)P.l=J;else{var oe=P.read_shift(2);E(P.slice(P.l,P.l+oe),ae),P.l+=oe}return ae}function k(P,q,H){var J=q&32768;return q&=-32769,q=(J?P:0)+(q>=8192?q-16384:q),(J?"":"$")+(H?$r(q):pa(q))}var _={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},C=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function E(P,q){xn(P,0);for(var H=[],J=0,ae="",oe="",ce="",ne="";P.l<P.length;){var le=P[P.l++];switch(le){case 0:H.push(P.read_shift(8,"f"));break;case 1:oe=k(q[0].c,P.read_shift(2),!0),ae=k(q[0].r,P.read_shift(2),!1),H.push(oe+ae);break;case 2:{var ge=k(q[0].c,P.read_shift(2),!0),X=k(q[0].r,P.read_shift(2),!1);oe=k(q[0].c,P.read_shift(2),!0),ae=k(q[0].r,P.read_shift(2),!1),H.push(ge+X+":"+oe+ae)}break;case 3:if(P.l<P.length){console.error("WK1 premature formula end");return}break;case 4:H.push("("+H.pop()+")");break;case 5:H.push(P.read_shift(2));break;case 6:{for(var pe="";le=P[P.l++];)pe+=String.fromCharCode(le);H.push('"'+pe.replace(/"/g,'""')+'"')}break;case 8:H.push("-"+H.pop());break;case 23:H.push("+"+H.pop());break;case 22:H.push("NOT("+H.pop()+")");break;case 20:case 21:ne=H.pop(),ce=H.pop(),H.push(["AND","OR"][le-20]+"("+ce+","+ne+")");break;default:if(le<32&&C[le])ne=H.pop(),ce=H.pop(),H.push(ce+C[le]+ne);else if(_[le]){if(J=_[le][1],J==69&&(J=P[P.l++]),J>H.length){console.error("WK1 bad formula parse 0x"+le.toString(16)+":|"+H.join("|")+"|");return}var be=H.slice(-J);H.length-=J,H.push(_[le][0]+"("+be.join(",")+")")}else return le<=7?console.error("WK1 invalid opcode "+le.toString(16)):le<=24?console.error("WK1 unsupported op "+le.toString(16)):le<=30?console.error("WK1 invalid opcode "+le.toString(16)):le<=115?console.error("WK1 unsupported function opcode "+le.toString(16)):console.error("WK1 unrecognized opcode "+le.toString(16))}}H.length==1?q[1].f=""+H[0]:console.error("WK1 bad formula parse |"+H.join("|")+"|")}function T(P){var q=[{c:0,r:0},{t:"n",v:0},0];return q[0].r=P.read_shift(2),q[3]=P[P.l++],q[0].c=P[P.l++],q}function B(P,q){var H=T(P);return H[1].t="s",H[1].v=P.read_shift(q-4,"cstr"),H}function I(P,q,H,J){var ae=Re(6+J.length);ae.write_shift(2,P),ae.write_shift(1,H),ae.write_shift(1,q),ae.write_shift(1,39);for(var oe=0;oe<J.length;++oe){var ce=J.charCodeAt(oe);ae.write_shift(1,ce>=128?95:ce)}return ae.write_shift(1,0),ae}function M(P,q){var H=T(P);H[1].v=P.read_shift(2);var J=H[1].v>>1;if(H[1].v&1)switch(J&7){case 0:J=(J>>3)*5e3;break;case 1:J=(J>>3)*500;break;case 2:J=(J>>3)/20;break;case 3:J=(J>>3)/200;break;case 4:J=(J>>3)/2e3;break;case 5:J=(J>>3)/2e4;break;case 6:J=(J>>3)/16;break;case 7:J=(J>>3)/64;break}return H[1].v=J,H}function U(P,q){var H=T(P),J=P.read_shift(4),ae=P.read_shift(4),oe=P.read_shift(2);if(oe==65535)return J===0&&ae===3221225472?(H[1].t="e",H[1].v=15):J===0&&ae===3489660928?(H[1].t="e",H[1].v=42):H[1].v=0,H;var ce=oe&32768;return oe=(oe&32767)-16446,H[1].v=(1-ce*2)*(ae*Math.pow(2,oe+32)+J*Math.pow(2,oe)),H}function D(P,q,H,J){var ae=Re(14);if(ae.write_shift(2,P),ae.write_shift(1,H),ae.write_shift(1,q),J==0)return ae.write_shift(4,0),ae.write_shift(4,0),ae.write_shift(2,65535),ae;var oe=0,ce=0,ne=0,le=0;return J<0&&(oe=1,J=-J),ce=Math.log2(J)|0,J/=Math.pow(2,ce-31),le=J>>>0,(le&2147483648)==0&&(J/=2,++ce,le=J>>>0),J-=le,le|=2147483648,le>>>=0,J*=Math.pow(2,32),ne=J>>>0,ae.write_shift(4,ne),ae.write_shift(4,le),ce+=16383+(oe?32768:0),ae.write_shift(2,ce),ae}function L(P,q){var H=U(P);return P.l+=q-14,H}function R(P,q){var H=T(P),J=P.read_shift(4);return H[1].v=J>>6,H}function Q(P,q){var H=T(P),J=P.read_shift(8,"f");return H[1].v=J,H}function G(P,q){var H=Q(P);return P.l+=q-10,H}function K(P,q){return P[P.l+q-1]==0?P.read_shift(q,"cstr"):""}function W(P,q){var H=P[P.l++];H>q-1&&(H=q-1);for(var J="";J.length<H;)J+=String.fromCharCode(P[P.l++]);return J}function z(P,q,H){if(!(!H.qpro||q<21)){var J=P.read_shift(1);P.l+=17,P.l+=1,P.l+=2;var ae=P.read_shift(q-21,"cstr");return[J,ae]}}function Z(P,q){for(var H={},J=P.l+q;P.l<J;){var ae=P.read_shift(2);if(ae==14e3){for(H[ae]=[0,""],H[ae][0]=P.read_shift(2);P[P.l];)H[ae][1]+=String.fromCharCode(P[P.l]),P.l++;P.l++}}return H}function Y(P,q){var H=Re(5+P.length);H.write_shift(2,14e3),H.write_shift(2,q);for(var J=0;J<P.length;++J){var ae=P.charCodeAt(J);H[H.l++]=ae>127?95:ae}return H[H.l++]=0,H}var te={0:{n:"BOF",f:Ca},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:o},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:x},14:{n:"NUMBER",f:b},15:{n:"LABEL",f},16:{n:"FORMULA",f:y},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:K},222:{n:"SHEETNAMELP",f:W},65535:{n:""}},O={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:B},23:{n:"NUMBER17",f:U},24:{n:"NUMBER18",f:M},25:{n:"FORMULA19",f:L},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:Z},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:R},38:{n:"??"},39:{n:"NUMBER27",f:Q},40:{n:"FORMULA28",f:G},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:K},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:z},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:a,book_to_wk3:s,to_workbook:t}})();function d1e(e){var t={},r=e.match(Pn),a=0,s=!1;if(r)for(;a!=r.length;++a){var i=vt(r[a]);switch(i[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!i.val)break;case"<shadow>":case"<shadow/>":t.shadow=1;break;case"</shadow>":break;case"<charset":if(i.val=="1")break;t.cp=Jj[parseInt(i.val,10)];break;case"<outline":if(!i.val)break;case"<outline>":case"<outline/>":t.outline=1;break;case"</outline>":break;case"<rFont":t.name=i.val;break;case"<sz":t.sz=i.val;break;case"<strike":if(!i.val)break;case"<strike>":case"<strike/>":t.strike=1;break;case"</strike>":break;case"<u":if(!i.val)break;switch(i.val){case"double":t.uval="double";break;case"singleAccounting":t.uval="single-accounting";break;case"doubleAccounting":t.uval="double-accounting";break}case"<u>":case"<u/>":t.u=1;break;case"</u>":break;case"<b":if(i.val=="0")break;case"<b>":case"<b/>":t.b=1;break;case"</b>":break;case"<i":if(i.val=="0")break;case"<i>":case"<i/>":t.i=1;break;case"</i>":break;case"<color":i.rgb&&(t.color=i.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":t.family=i.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":t.valign=i.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":break;case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(i[0].charCodeAt(1)!==47&&!s)throw new Error("Unrecognized rich format "+i[0])}}return t}var u1e=(function(){var e=hp("t"),t=hp("rPr");function r(i){var l=i.match(e);if(!l)return{t:"s",v:""};var o={t:"s",v:Gt(l[1])},d=i.match(t);return d&&(o.s=d1e(d[1])),o}var a=/<(?:\w+:)?r>/g,s=/<\/(?:\w+:)?r>/;return function(l){return l.replace(a,"").split(s).map(r).filter(function(o){return o.v})}})(),A1e=(function(){var t=/(\r\n|\n)/g;function r(s,i,l){var o=[];s.u&&o.push("text-decoration: underline;"),s.uval&&o.push("text-underline-style:"+s.uval+";"),s.sz&&o.push("font-size:"+s.sz+"pt;"),s.outline&&o.push("text-effect: outline;"),s.shadow&&o.push("text-shadow: auto;"),i.push('<span style="'+o.join("")+'">'),s.b&&(i.push("<b>"),l.push("</b>")),s.i&&(i.push("<i>"),l.push("</i>")),s.strike&&(i.push("<s>"),l.push("</s>"));var d=s.valign||"";return d=="superscript"||d=="super"?d="sup":d=="subscript"&&(d="sub"),d!=""&&(i.push("<"+d+">"),l.push("</"+d+">")),l.push("</span>"),s}function a(s){var i=[[],s.v,[]];return s.v?(s.s&&r(s.s,i[0],i[2]),i[0].join("")+i[1].replace(t,"<br/>")+i[2].join("")):""}return function(i){return i.map(a).join("")}})(),f1e=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,p1e=/<(?:\w+:)?r>/,h1e=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function wE(e,t){var r=t?t.cellHTML:!0,a={};return e?(e.match(/^\s*<(?:\w+:)?t[^>]*>/)?(a.t=Gt(hr(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),a.r=hr(e),r&&(a.h=oE(a.t))):e.match(p1e)&&(a.r=hr(e),a.t=Gt(hr((e.replace(h1e,"").match(f1e)||[]).join("").replace(Pn,""))),r&&(a.h=A1e(u1e(a.r)))),a):{t:""}}var x1e=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,m1e=/<(?:\w+:)?(?:si|sstItem)>/g,g1e=/<\/(?:\w+:)?(?:si|sstItem)>/;function b1e(e,t){var r=[],a="";if(!e)return r;var s=e.match(x1e);if(s){a=s[2].replace(m1e,"").split(g1e);for(var i=0;i!=a.length;++i){var l=wE(a[i].trim(),t);l!=null&&(r[r.length]=l)}s=vt(s[1]),r.Count=s.count,r.Unique=s.uniqueCount}return r}var v1e=/^\s|\s$|[\t\n\r]/;function C9(e,t){if(!t.bookSST)return"";var r=[xa];r[r.length]=Ke("sst",null,{xmlns:nu[0],count:e.Count,uniqueCount:e.Unique});for(var a=0;a!=e.length;++a)if(e[a]!=null){var s=e[a],i="<si>";s.r?i+=s.r:(i+="<t",s.t||(s.t=""),s.t.match(v1e)&&(i+=' xml:space="preserve"'),i+=">"+cr(s.t)+"</t>"),i+="</si>",r[r.length]=i}return r.length>2&&(r[r.length]="</sst>",r[1]=r[1].replace("/>",">")),r.join("")}function y1e(e){return[e.read_shift(4),e.read_shift(4)]}function w1e(e,t){var r=[],a=!1;return Ro(e,function(i,l,o){switch(o){case 159:r.Count=i[0],r.Unique=i[1];break;case 19:r.push(i);break;case 160:return!0;case 35:a=!0;break;case 36:a=!1;break;default:if(l.T,!a||t.WTF)throw new Error("Unexpected record 0x"+o.toString(16))}}),r}function N1e(e,t){return t||(t=Re(8)),t.write_shift(4,e.Count),t.write_shift(4,e.Unique),t}var C1e=Dge;function k1e(e){var t=As();Qe(t,159,N1e(e));for(var r=0;r<e.length;++r)Qe(t,19,C1e(e[r]));return Qe(t,160),t.end()}function k9(e){for(var t=[],r=e.split(""),a=0;a<r.length;++a)t[a]=r[a].charCodeAt(0);return t}function Ao(e,t){var r={};return r.Major=e.read_shift(2),r.Minor=e.read_shift(2),t>=4&&(e.l+=t-4),r}function j1e(e){var t={};return t.id=e.read_shift(0,"lpp4"),t.R=Ao(e,4),t.U=Ao(e,4),t.W=Ao(e,4),t}function E1e(e){for(var t=e.read_shift(4),r=e.l+t-4,a={},s=e.read_shift(4),i=[];s-- >0;)i.push({t:e.read_shift(4),v:e.read_shift(0,"lpp4")});if(a.name=e.read_shift(0,"lpp4"),a.comps=i,e.l!=r)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+r);return a}function S1e(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(E1e(e));return t}function B1e(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(e.read_shift(0,"lpp4"));return t}function _1e(e){var t={};return e.read_shift(4),e.l+=4,t.id=e.read_shift(0,"lpp4"),t.name=e.read_shift(0,"lpp4"),t.R=Ao(e,4),t.U=Ao(e,4),t.W=Ao(e,4),t}function T1e(e){var t=_1e(e);if(t.ename=e.read_shift(0,"8lpp4"),t.blksz=e.read_shift(4),t.cmode=e.read_shift(4),e.read_shift(4)!=4)throw new Error("Bad !Primary record");return t}function j9(e,t){var r=e.l+t,a={};a.Flags=e.read_shift(4)&63,e.l+=4,a.AlgID=e.read_shift(4);var s=!1;switch(a.AlgID){case 26126:case 26127:case 26128:s=a.Flags==36;break;case 26625:s=a.Flags==4;break;case 0:s=a.Flags==16||a.Flags==4||a.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+a.AlgID}if(!s)throw new Error("Encryption Flags/AlgID mismatch");return a.AlgIDHash=e.read_shift(4),a.KeySize=e.read_shift(4),a.ProviderType=e.read_shift(4),e.l+=8,a.CSPName=e.read_shift(r-e.l>>1,"utf16le"),e.l=r,a}function E9(e,t){var r={},a=e.l+t;return e.l+=4,r.Salt=e.slice(e.l,e.l+16),e.l+=16,r.Verifier=e.slice(e.l,e.l+16),e.l+=16,e.read_shift(4),r.VerifierHash=e.slice(e.l,a),e.l=a,r}function F1e(e){var t=Ao(e);switch(t.Minor){case 2:return[t.Minor,I1e(e)];case 3:return[t.Minor,D1e()];case 4:return[t.Minor,U1e(e)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+t.Minor)}function I1e(e){var t=e.read_shift(4);if((t&63)!=36)throw new Error("EncryptionInfo mismatch");var r=e.read_shift(4),a=j9(e,r),s=E9(e,e.length-e.l);return{t:"Std",h:a,v:s}}function D1e(){throw new Error("File is password-protected: ECMA-376 Extensible")}function U1e(e){var t=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var r=e.read_shift(e.length-e.l,"utf8"),a={};return r.replace(Pn,function(i){var l=vt(i);switch(_l(l[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":t.forEach(function(o){a[o]=l[o]});break;case"<dataIntegrity":a.encryptedHmacKey=l.encryptedHmacKey,a.encryptedHmacValue=l.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":a.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":a.uri=l.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":a.encs.push(l);break;default:throw l[0]}}),a}function M1e(e,t){var r={},a=r.EncryptionVersionInfo=Ao(e,4);if(t-=4,a.Minor!=2)throw new Error("unrecognized minor version code: "+a.Minor);if(a.Major>4||a.Major<2)throw new Error("unrecognized major version code: "+a.Major);r.Flags=e.read_shift(4),t-=4;var s=e.read_shift(4);return t-=4,r.EncryptionHeader=j9(e,s),t-=s,r.EncryptionVerifier=E9(e,t),r}function R1e(e){var t={},r=t.EncryptionVersionInfo=Ao(e,4);if(r.Major!=1||r.Minor!=1)throw"unrecognized version code "+r.Major+" : "+r.Minor;return t.Salt=e.read_shift(16),t.EncryptedVerifier=e.read_shift(16),t.EncryptedVerifierHash=e.read_shift(16),t}function NE(e){var t=0,r,a=k9(e),s=a.length+1,i,l,o,d,u;for(r=Ic(s),r[0]=a.length,i=1;i!=s;++i)r[i]=a[i-1];for(i=s-1;i>=0;--i)l=r[i],o=(t&16384)===0?0:1,d=t<<1&32767,u=o|d,t=u^l;return t^52811}var S9=(function(){var e=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],t=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],r=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],a=function(l){return(l/2|l*128)&255},s=function(l,o){return a(l^o)},i=function(l){for(var o=t[l.length-1],d=104,u=l.length-1;u>=0;--u)for(var f=l[u],p=0;p!=7;++p)f&64&&(o^=r[d]),f*=2,--d;return o};return function(l){for(var o=k9(l),d=i(o),u=o.length,f=Ic(16),p=0;p!=16;++p)f[p]=0;var x,m,b;for((u&1)===1&&(x=d>>8,f[u]=s(e[0],x),--u,x=d&255,m=o[o.length-1],f[u]=s(m,x));u>0;)--u,x=d>>8,f[u]=s(o[u],x),--u,x=d&255,f[u]=s(o[u],x);for(u=15,b=15-o.length;b>0;)x=d>>8,f[u]=s(e[b],x),--u,--b,x=d&255,f[u]=s(o[u],x),--u,--b;return f}})(),O1e=function(e,t,r,a,s){s||(s=t),a||(a=S9(e));var i,l;for(i=0;i!=t.length;++i)l=t[i],l^=a[r],l=(l>>5|l<<3)&255,s[i]=l,++r;return[s,r,a]},P1e=function(e){var t=0,r=S9(e);return function(a){var s=O1e("",a,t,r);return t=s[1],s[0]}};function L1e(e,t,r,a){var s={key:Ca(e),verificationBytes:Ca(e)};return r.password&&(s.verifier=NE(r.password)),a.valid=s.verificationBytes===s.verifier,a.valid&&(a.insitu=P1e(r.password)),s}function Q1e(e,t,r){var a=r||{};return a.Info=e.read_shift(2),e.l-=2,a.Info===1?a.Data=R1e(e):a.Data=M1e(e,t),a}function H1e(e,t,r){var a={Type:r.biff>=8?e.read_shift(2):0};return a.Type?Q1e(e,t-2,a):L1e(e,r.biff>=8?t:t-2,r,a),a}var B9=(function(){function e(s,i){switch(i.type){case"base64":return t(Qs(s),i);case"binary":return t(s,i);case"buffer":return t(Dt&&Buffer.isBuffer(s)?s.toString("binary"):Vc(s),i);case"array":return t(Gd(s),i)}throw new Error("Unrecognized type "+i.type)}function t(s,i){var l=i||{},o=l.dense?[]:{},d=s.match(/\\trowd.*?\\row\b/g);if(!d.length)throw new Error("RTF missing table");var u={s:{c:0,r:0},e:{c:0,r:d.length-1}};return d.forEach(function(f,p){Array.isArray(o)&&(o[p]=[]);for(var x=/\\\w+\b/g,m=0,b,v=-1;b=x.exec(f);){switch(b[0]){case"\\cell":var y=f.slice(m,x.lastIndex-b[0].length);if(y[0]==" "&&(y=y.slice(1)),++v,y.length){var k={v:y,t:"s"};Array.isArray(o)?o[p][v]=k:o[bt({r:p,c:v})]=k}break}m=x.lastIndex}v>u.e.c&&(u.e.c=v)}),o["!ref"]=St(u),o}function r(s,i){return Gc(e(s,i),i)}function a(s){for(var i=["{\\rtf1\\ansi"],l=Kt(s["!ref"]),o,d=Array.isArray(s),u=l.s.r;u<=l.e.r;++u){i.push("\\trowd\\trautofit1");for(var f=l.s.c;f<=l.e.c;++f)i.push("\\cellx"+(f+1));for(i.push("\\pard\\intbl"),f=l.s.c;f<=l.e.c;++f){var p=bt({r:u,c:f});o=d?(s[u]||[])[f]:s[p],!(!o||o.v==null&&(!o.f||o.F))&&(i.push(" "+(o.w||(No(o),o.w))),i.push("\\cell"))}i.push("\\pard\\intbl\\row")}return i.join("")+"}"}return{to_workbook:r,to_sheet:e,from_sheet:a}})();function z1e(e){var t=e.slice(e[0]==="#"?1:0).slice(0,6);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function bp(e){for(var t=0,r=1;t!=3;++t)r=r*256+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}function $1e(e){var t=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.max(t,r,a),i=Math.min(t,r,a),l=s-i;if(l===0)return[0,0,t];var o=0,d=0,u=s+i;switch(d=l/(u>1?2-u:u),s){case t:o=((r-a)/l+6)%6;break;case r:o=(a-t)/l+2;break;case a:o=(t-r)/l+4;break}return[o/6,d,u/2]}function V1e(e){var t=e[0],r=e[1],a=e[2],s=r*2*(a<.5?a:1-a),i=a-s/2,l=[i,i,i],o=6*t,d;if(r!==0)switch(o|0){case 0:case 6:d=s*o,l[0]+=s,l[1]+=d;break;case 1:d=s*(2-o),l[0]+=d,l[1]+=s;break;case 2:d=s*(o-2),l[1]+=s,l[2]+=d;break;case 3:d=s*(4-o),l[1]+=d,l[2]+=s;break;case 4:d=s*(o-4),l[2]+=s,l[0]+=d;break;case 5:d=s*(6-o),l[2]+=d,l[0]+=s;break}for(var u=0;u!=3;++u)l[u]=Math.round(l[u]*255);return l}function qg(e,t){if(t===0)return e;var r=$1e(z1e(e));return t<0?r[2]=r[2]*(1+t):r[2]=1-(1-r[2])*(1-t),bp(V1e(r))}var _9=6,G1e=15,K1e=1,Dn=_9;function vp(e){return Math.floor((e+Math.round(128/Dn)/256)*Dn)}function yp(e){return Math.floor((e-5)/Dn*100+.5)/100}function Wg(e){return Math.round((e*Dn+5)/Dn*256)/256}function S2(e){return Wg(yp(vp(e)))}function CE(e){var t=Math.abs(e-S2(e)),r=Dn;if(t>.005)for(Dn=K1e;Dn<G1e;++Dn)Math.abs(e-S2(e))<=t&&(t=Math.abs(e-S2(e)),r=Dn);Dn=r}function Dc(e){e.width?(e.wpx=vp(e.width),e.wch=yp(e.wpx),e.MDW=Dn):e.wpx?(e.wch=yp(e.wpx),e.width=Wg(e.wch),e.MDW=Dn):typeof e.wch=="number"&&(e.width=Wg(e.wch),e.wpx=vp(e.width),e.MDW=Dn),e.customWidth&&delete e.customWidth}var q1e=96,T9=q1e;function wp(e){return e*96/T9}function UA(e){return e*T9/96}var W1e={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function Y1e(e,t,r,a){t.Borders=[];var s={},i=!1;(e[0].match(Pn)||[]).forEach(function(l){var o=vt(l);switch(_l(o[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":s={},o.diagonalUp&&(s.diagonalUp=Br(o.diagonalUp)),o.diagonalDown&&(s.diagonalDown=Br(o.diagonalDown)),t.Borders.push(s);break;case"</border>":break;case"<left/>":break;case"<left":case"<left>":break;case"</left>":break;case"<right/>":break;case"<right":case"<right>":break;case"</right>":break;case"<top/>":break;case"<top":case"<top>":break;case"</top>":break;case"<bottom/>":break;case"<bottom":case"<bottom>":break;case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":break;case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":break;case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":break;case"</vertical>":break;case"<start":case"<start>":case"<start/>":break;case"</start>":break;case"<end":case"<end>":case"<end/>":break;case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(a&&a.WTF&&!i)throw new Error("unrecognized "+o[0]+" in borders")}})}function X1e(e,t,r,a){t.Fills=[];var s={},i=!1;(e[0].match(Pn)||[]).forEach(function(l){var o=vt(l);switch(_l(o[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":s={},t.Fills.push(s);break;case"</fill>":break;case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":t.Fills.push(s),s={};break;case"<patternFill":case"<patternFill>":o.patternType&&(s.patternType=o.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":s.bgColor||(s.bgColor={}),o.indexed&&(s.bgColor.indexed=parseInt(o.indexed,10)),o.theme&&(s.bgColor.theme=parseInt(o.theme,10)),o.tint&&(s.bgColor.tint=parseFloat(o.tint)),o.rgb&&(s.bgColor.rgb=o.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":s.fgColor||(s.fgColor={}),o.theme&&(s.fgColor.theme=parseInt(o.theme,10)),o.tint&&(s.fgColor.tint=parseFloat(o.tint)),o.rgb!=null&&(s.fgColor.rgb=o.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":break;case"</stop>":break;case"<color":case"<color/>":break;case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(a&&a.WTF&&!i)throw new Error("unrecognized "+o[0]+" in fills")}})}function J1e(e,t,r,a){t.Fonts=[];var s={},i=!1;(e[0].match(Pn)||[]).forEach(function(l){var o=vt(l);switch(_l(o[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":t.Fonts.push(s),s={};break;case"<name":o.val&&(s.name=hr(o.val));break;case"<name/>":case"</name>":break;case"<b":s.bold=o.val?Br(o.val):1;break;case"<b/>":s.bold=1;break;case"<i":s.italic=o.val?Br(o.val):1;break;case"<i/>":s.italic=1;break;case"<u":switch(o.val){case"none":s.underline=0;break;case"single":s.underline=1;break;case"double":s.underline=2;break;case"singleAccounting":s.underline=33;break;case"doubleAccounting":s.underline=34;break}break;case"<u/>":s.underline=1;break;case"<strike":s.strike=o.val?Br(o.val):1;break;case"<strike/>":s.strike=1;break;case"<outline":s.outline=o.val?Br(o.val):1;break;case"<outline/>":s.outline=1;break;case"<shadow":s.shadow=o.val?Br(o.val):1;break;case"<shadow/>":s.shadow=1;break;case"<condense":s.condense=o.val?Br(o.val):1;break;case"<condense/>":s.condense=1;break;case"<extend":s.extend=o.val?Br(o.val):1;break;case"<extend/>":s.extend=1;break;case"<sz":o.val&&(s.sz=+o.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":o.val&&(s.vertAlign=o.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":o.val&&(s.family=parseInt(o.val,10));break;case"<family/>":case"</family>":break;case"<scheme":o.val&&(s.scheme=o.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":if(o.val=="1")break;o.codepage=Jj[parseInt(o.val,10)];break;case"<color":if(s.color||(s.color={}),o.auto&&(s.color.auto=Br(o.auto)),o.rgb)s.color.rgb=o.rgb.slice(-6);else if(o.indexed){s.color.index=parseInt(o.indexed,10);var d=_d[s.color.index];s.color.index==81&&(d=_d[1]),d||(d=_d[1]),s.color.rgb=d[0].toString(16)+d[1].toString(16)+d[2].toString(16)}else o.theme&&(s.color.theme=parseInt(o.theme,10),o.tint&&(s.color.tint=parseFloat(o.tint)),o.theme&&r.themeElements&&r.themeElements.clrScheme&&(s.color.rgb=qg(r.themeElements.clrScheme[s.color.theme].rgb,s.color.tint||0)));break;case"<color/>":case"</color>":break;case"<AlternateContent":i=!0;break;case"</AlternateContent>":i=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(a&&a.WTF&&!i)throw new Error("unrecognized "+o[0]+" in fonts")}})}function Z1e(e,t,r){t.NumberFmt=[];for(var a=oa(gt),s=0;s<a.length;++s)t.NumberFmt[a[s]]=gt[a[s]];var i=e[0].match(Pn);if(i)for(s=0;s<i.length;++s){var l=vt(i[s]);switch(_l(l[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var o=Gt(hr(l.formatCode)),d=parseInt(l.numFmtId,10);if(t.NumberFmt[d]=o,d>0){if(d>392){for(d=392;d>60&&t.NumberFmt[d]!=null;--d);t.NumberFmt[d]=o}uo(o,d)}}break;case"</numFmt>":break;default:if(r.WTF)throw new Error("unrecognized "+l[0]+" in numFmts")}}}function eye(e){var t=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var a=r[0];a<=r[1];++a)e[a]!=null&&(t[t.length]=Ke("numFmt",null,{numFmtId:a,formatCode:cr(e[a])}))}),t.length===1?"":(t[t.length]="</numFmts>",t[0]=Ke("numFmts",null,{count:t.length-2}).replace("/>",">"),t.join(""))}var Vx=["numFmtId","fillId","fontId","borderId","xfId"],Gx=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function tye(e,t,r){t.CellXf=[];var a,s=!1;(e[0].match(Pn)||[]).forEach(function(i){var l=vt(i),o=0;switch(_l(l[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(a=l,delete a[0],o=0;o<Vx.length;++o)a[Vx[o]]&&(a[Vx[o]]=parseInt(a[Vx[o]],10));for(o=0;o<Gx.length;++o)a[Gx[o]]&&(a[Gx[o]]=Br(a[Gx[o]]));if(t.NumberFmt&&a.numFmtId>392){for(o=392;o>60;--o)if(t.NumberFmt[a.numFmtId]==t.NumberFmt[o]){a.numFmtId=o;break}}t.CellXf.push(a);break;case"</xf>":break;case"<alignment":case"<alignment/>":var d={};l.vertical&&(d.vertical=l.vertical),l.horizontal&&(d.horizontal=l.horizontal),l.textRotation!=null&&(d.textRotation=l.textRotation),l.indent&&(d.indent=l.indent),l.wrapText&&(d.wrapText=Br(l.wrapText)),a.alignment=d;break;case"</alignment>":break;case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":s=!0;break;case"</AlternateContent>":s=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(r&&r.WTF&&!s)throw new Error("unrecognized "+l[0]+" in cellXfs")}})}function rye(e){var t=[];return t[t.length]=Ke("cellXfs",null),e.forEach(function(r){t[t.length]=Ke("xf",null,r)}),t[t.length]="</cellXfs>",t.length===2?"":(t[0]=Ke("cellXfs",null,{count:t.length-2}).replace("/>",">"),t.join(""))}var aye=(function(){var t=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,r=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,a=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,s=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,i=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(o,d,u){var f={};if(!o)return f;o=o.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");var p;return(p=o.match(t))&&Z1e(p,f,u),(p=o.match(s))&&J1e(p,f,d,u),(p=o.match(a))&&X1e(p,f,d,u),(p=o.match(i))&&Y1e(p,f,d,u),(p=o.match(r))&&tye(p,f,u),f}})();function F9(e,t){var r=[xa,Ke("styleSheet",null,{xmlns:nu[0],"xmlns:vt":Pa.vt})],a;return e.SSF&&(a=eye(e.SSF))!=null&&(r[r.length]=a),r[r.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',r[r.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',r[r.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',r[r.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(a=rye(t.cellXfs))&&(r[r.length]=a),r[r.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',r[r.length]='<dxfs count="0"/>',r[r.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',r.length>2&&(r[r.length]="</styleSheet>",r[1]=r[1].replace("/>",">")),r.join("")}function nye(e,t){var r=e.read_shift(2),a=Mn(e);return[r,a]}function sye(e,t,r){r||(r=Re(6+4*t.length)),r.write_shift(2,e),Za(t,r);var a=r.length>r.l?r.slice(0,r.l):r;return r.l==null&&(r.l=r.length),a}function iye(e,t,r){var a={};a.sz=e.read_shift(2)/20;var s=Qge(e);s.fItalic&&(a.italic=1),s.fCondense&&(a.condense=1),s.fExtend&&(a.extend=1),s.fShadow&&(a.shadow=1),s.fOutline&&(a.outline=1),s.fStrikeout&&(a.strike=1);var i=e.read_shift(2);switch(i===700&&(a.bold=1),e.read_shift(2)){case 1:a.vertAlign="superscript";break;case 2:a.vertAlign="subscript";break}var l=e.read_shift(1);l!=0&&(a.underline=l);var o=e.read_shift(1);o>0&&(a.family=o);var d=e.read_shift(1);switch(d>0&&(a.charset=d),e.l++,a.color=Lge(e),e.read_shift(1)){case 1:a.scheme="major";break;case 2:a.scheme="minor";break}return a.name=Mn(e),a}function lye(e,t){t||(t=Re(153)),t.write_shift(2,e.sz*20),Hge(e,t),t.write_shift(2,e.bold?700:400);var r=0;e.vertAlign=="superscript"?r=1:e.vertAlign=="subscript"&&(r=2),t.write_shift(2,r),t.write_shift(1,e.underline||0),t.write_shift(1,e.family||0),t.write_shift(1,e.charset||0),t.write_shift(1,0),Vg(e.color,t);var a=0;return a=2,t.write_shift(1,a),Za(e.name,t),t.length>t.l?t.slice(0,t.l):t}var oye=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],B2,cye=On;function YD(e,t){t||(t=Re(84)),B2||(B2=lv(oye));var r=B2[e.patternType];r==null&&(r=40),t.write_shift(4,r);var a=0;if(r!=40)for(Vg({auto:1},t),Vg({auto:1},t);a<12;++a)t.write_shift(4,0);else{for(;a<4;++a)t.write_shift(4,0);for(;a<12;++a)t.write_shift(4,0)}return t.length>t.l?t.slice(0,t.l):t}function dye(e,t){var r=e.l+t,a=e.read_shift(2),s=e.read_shift(2);return e.l=r,{ixfe:a,numFmtId:s}}function I9(e,t,r){r||(r=Re(16)),r.write_shift(2,t||0),r.write_shift(2,e.numFmtId||0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(1,0),r.write_shift(1,0);var a=0;return r.write_shift(1,a),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r}function of(e,t){return t||(t=Re(10)),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(4,0),t}var uye=On;function Aye(e,t){return t||(t=Re(51)),t.write_shift(1,0),of(null,t),of(null,t),of(null,t),of(null,t),of(null,t),t.length>t.l?t.slice(0,t.l):t}function fye(e,t){return t||(t=Re(52)),t.write_shift(4,e.xfId),t.write_shift(2,1),t.write_shift(1,0),t.write_shift(1,0),$g(e.name||"",t),t.length>t.l?t.slice(0,t.l):t}function pye(e,t,r){var a=Re(2052);return a.write_shift(4,e),$g(t,a),$g(r,a),a.length>a.l?a.slice(0,a.l):a}function hye(e,t,r){var a={};a.NumberFmt=[];for(var s in gt)a.NumberFmt[s]=gt[s];a.CellXf=[],a.Fonts=[];var i=[],l=!1;return Ro(e,function(d,u,f){switch(f){case 44:a.NumberFmt[d[0]]=d[1],uo(d[1],d[0]);break;case 43:a.Fonts.push(d),d.color.theme!=null&&t&&t.themeElements&&t.themeElements.clrScheme&&(d.color.rgb=qg(t.themeElements.clrScheme[d.color.theme].rgb,d.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:i[i.length-1]==617&&a.CellXf.push(d);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:l=!0;break;case 36:l=!1;break;case 37:i.push(f),l=!0;break;case 38:i.pop(),l=!1;break;default:if(u.T>0)i.push(f);else if(u.T<0)i.pop();else if(!l||r.WTF&&i[i.length-1]!=37)throw new Error("Unexpected record 0x"+f.toString(16))}}),a}function xye(e,t){if(t){var r=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&++r}),r!=0&&(Qe(e,615,zi(r)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&Qe(e,44,sye(s,t[s]))}),Qe(e,616))}}function mye(e){var t=1;Qe(e,611,zi(t)),Qe(e,43,lye({sz:12,color:{theme:1},name:"Calibri",family:2})),Qe(e,612)}function gye(e){var t=2;Qe(e,603,zi(t)),Qe(e,45,YD({patternType:"none"})),Qe(e,45,YD({patternType:"gray125"})),Qe(e,604)}function bye(e){var t=1;Qe(e,613,zi(t)),Qe(e,46,Aye()),Qe(e,614)}function vye(e){var t=1;Qe(e,626,zi(t)),Qe(e,47,I9({numFmtId:0},65535)),Qe(e,627)}function yye(e,t){Qe(e,617,zi(t.length)),t.forEach(function(r){Qe(e,47,I9(r,0))}),Qe(e,618)}function wye(e){var t=1;Qe(e,619,zi(t)),Qe(e,48,fye({xfId:0,name:"Normal"})),Qe(e,620)}function Nye(e){var t=0;Qe(e,505,zi(t)),Qe(e,506)}function Cye(e){var t=0;Qe(e,508,pye(t,"TableStyleMedium9","PivotStyleMedium4")),Qe(e,509)}function kye(e,t){var r=As();return Qe(r,278),xye(r,e.SSF),mye(r),gye(r),bye(r),vye(r),yye(r,t.cellXfs),wye(r),Nye(r),Cye(r),Qe(r,279),r.end()}var jye=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function Eye(e,t,r){t.themeElements.clrScheme=[];var a={};(e[0].match(Pn)||[]).forEach(function(s){var i=vt(s);switch(i[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":a.rgb=i.val;break;case"<a:sysClr":a.rgb=i.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":i[0].charAt(1)==="/"?(t.themeElements.clrScheme[jye.indexOf(i[0])]=a,a={}):a.name=i[0].slice(3,i[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+i[0]+" in clrScheme")}})}function Sye(){}function Bye(){}var _ye=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,Tye=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,Fye=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function Iye(e,t,r){t.themeElements={};var a;[["clrScheme",_ye,Eye],["fontScheme",Tye,Sye],["fmtScheme",Fye,Bye]].forEach(function(s){if(!(a=e.match(s[1])))throw new Error(s[0]+" not found in themeElements");s[2](a,t,r)})}var Dye=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function D9(e,t){(!e||e.length===0)&&(e=kE());var r,a={};if(!(r=e.match(Dye)))throw new Error("themeElements not found in theme");return Iye(r[0],a,t),a.raw=e,a}function kE(e,t){if(t&&t.themeXLSX)return t.themeXLSX;if(e&&typeof e.raw=="string")return e.raw;var r=[xa];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function Uye(e,t,r){var a=e.l+t,s=e.read_shift(4);if(s!==124226){if(!r.cellStyles){e.l=a;return}var i=e.slice(e.l);e.l=a;var l;try{l=jQ(i,{type:"array"})}catch{return}var o=Ds(l,"theme/theme/theme1.xml",!0);if(o)return D9(o,r)}}function Mye(e){return e.read_shift(4)}function Rye(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:e.l+=4;break;case 1:t.xclrValue=Oye(e,4);break;case 2:t.xclrValue=f9(e);break;case 3:t.xclrValue=Mye(e);break;case 4:e.l+=4;break}return e.l+=8,t}function Oye(e,t){return On(e,t)}function Pye(e,t){return On(e,t)}function Lye(e){var t=e.read_shift(2),r=e.read_shift(2)-4,a=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:a[1]=Rye(e);break;case 6:a[1]=Pye(e,r);break;case 14:case 15:a[1]=e.read_shift(r===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+r)}return a}function Qye(e,t){var r=e.l+t;e.l+=2;var a=e.read_shift(2);e.l+=2;for(var s=e.read_shift(2),i=[];s-- >0;)i.push(Lye(e,r-e.l));return{ixfe:a,ext:i}}function Hye(e,t){t.forEach(function(r){r[0]})}function zye(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:Mn(e)}}function $ye(e){var t=Re(12+2*e.name.length);return t.write_shift(4,e.flags),t.write_shift(4,e.version),Za(e.name,t),t.slice(0,t.l)}function Vye(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function Gye(e){var t=Re(4+8*e.length);t.write_shift(4,e.length);for(var r=0;r<e.length;++r)t.write_shift(4,e[r][0]),t.write_shift(4,e[r][1]);return t}function Kye(e,t){var r=Re(8+2*t.length);return r.write_shift(4,e),Za(t,r),r.slice(0,r.l)}function qye(e){return e.l+=4,e.read_shift(4)!=0}function Wye(e,t){var r=Re(8);return r.write_shift(4,e),r.write_shift(4,1),r}function Yye(e,t,r){var a={Types:[],Cell:[],Value:[]},s=r||{},i=[],l=!1,o=2;return Ro(e,function(d,u,f){switch(f){case 335:a.Types.push({name:d.name});break;case 51:d.forEach(function(p){o==1?a.Cell.push({type:a.Types[p[0]-1].name,index:p[1]}):o==0&&a.Value.push({type:a.Types[p[0]-1].name,index:p[1]})});break;case 337:o=d?1:0;break;case 338:o=2;break;case 35:i.push(f),l=!0;break;case 36:i.pop(),l=!1;break;default:if(!u.T){if(!l||s.WTF&&i[i.length-1]!=35)throw new Error("Unexpected record 0x"+f.toString(16))}}}),a}function Xye(){var e=As();return Qe(e,332),Qe(e,334,zi(1)),Qe(e,335,$ye({name:"XLDAPR",version:12e4,flags:3496657072})),Qe(e,336),Qe(e,339,Kye(1,"XLDAPR")),Qe(e,52),Qe(e,35,zi(514)),Qe(e,4096,zi(0)),Qe(e,4097,di(1)),Qe(e,36),Qe(e,53),Qe(e,340),Qe(e,337,Wye(1)),Qe(e,51,Gye([[1,0]])),Qe(e,338),Qe(e,333),e.end()}function Jye(e,t,r){var a={Types:[],Cell:[],Value:[]};if(!e)return a;var s=!1,i=2,l;return e.replace(Pn,function(o){var d=vt(o);switch(_l(d[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":a.Types.push({name:d.name});break;case"</metadataType>":break;case"<futureMetadata":for(var u=0;u<a.Types.length;++u)a.Types[u].name==d.name&&(l=a.Types[u]);break;case"</futureMetadata>":break;case"<bk>":break;case"</bk>":break;case"<rc":i==1?a.Cell.push({type:a.Types[d.t-1].name,index:+d.v}):i==0&&a.Value.push({type:a.Types[d.t-1].name,index:+d.v});break;case"</rc>":break;case"<cellMetadata":i=1;break;case"</cellMetadata>":i=2;break;case"<valueMetadata":i=0;break;case"</valueMetadata>":i=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;case"<rvb":if(!l)break;l.offsets||(l.offsets=[]),l.offsets.push(+d.i);break;default:if(!s&&r.WTF)throw new Error("unrecognized "+d[0]+" in metadata")}return o}),a}function U9(){var e=[xa];return e.push(`<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">
  <metadataTypes count="1">
    <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>
  </metadataTypes>
  <futureMetadata name="XLDAPR" count="1">
    <bk>
      <extLst>
        <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">
          <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>
        </ext>
      </extLst>
    </bk>
  </futureMetadata>
  <cellMetadata count="1">
    <bk>
      <rc t="1" v="0"/>
    </bk>
  </cellMetadata>
</metadata>`),e.join("")}function Zye(e){var t=[];if(!e)return t;var r=1;return(e.match(Pn)||[]).forEach(function(a){var s=vt(a);switch(s[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete s[0],s.i?r=s.i:s.i=r,t.push(s);break}}),t}function ewe(e){var t={};t.i=e.read_shift(4);var r={};r.r=e.read_shift(4),r.c=e.read_shift(4),t.r=bt(r);var a=e.read_shift(1);return a&2&&(t.l="1"),a&8&&(t.a="1"),t}function twe(e,t,r){var a=[];return Ro(e,function(i,l,o){switch(o){case 63:a.push(i);break;default:if(!l.T)throw new Error("Unexpected record 0x"+o.toString(16))}}),a}function rwe(e,t,r,a){if(!e)return e;var s=a||{},i=!1;Ro(e,function(o,d,u){switch(u){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:i=!0;break;case 36:i=!1;break;default:if(!d.T){if(!i||s.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}},s)}function awe(e,t){if(!e)return"??";var r=(e.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return t["!id"][r].Target}var pA=1024;function M9(e,t){for(var r=[21600,21600],a=["m0,0l0",r[1],r[0],r[1],r[0],"0xe"].join(","),s=[Ke("xml",null,{"xmlns:v":_s.v,"xmlns:o":_s.o,"xmlns:x":_s.x,"xmlns:mv":_s.mv}).replace(/\/>/,">"),Ke("o:shapelayout",Ke("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"}),Ke("v:shapetype",[Ke("v:stroke",null,{joinstyle:"miter"}),Ke("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:r.join(","),path:a})];pA<e*1e3;)pA+=1e3;return t.forEach(function(i){var l=Vr(i[0]),o={color2:"#BEFF82",type:"gradient"};o.type=="gradient"&&(o.angle="-180");var d=o.type=="gradient"?Ke("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,u=Ke("v:fill",d,o),f={on:"t",obscured:"t"};++pA,s=s.concat(["<v:shape"+xp({id:"_x0000_s"+pA,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(i[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",u,Ke("v:shadow",null,f),Ke("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",mn("x:Anchor",[l.c+1,0,l.r+1,0,l.c+3,20,l.r+5,20].join(",")),mn("x:AutoFill","False"),mn("x:Row",String(l.r)),mn("x:Column",String(l.c)),i[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])}),s.push("</xml>"),s.join("")}function XD(e,t,r,a){var s=Array.isArray(e),i;t.forEach(function(l){var o=Vr(l.ref);if(s?(e[o.r]||(e[o.r]=[]),i=e[o.r][o.c]):i=e[l.ref],!i){i={t:"z"},s?e[o.r][o.c]=i:e[l.ref]=i;var d=Kt(e["!ref"]||"BDWGO1000001:A1");d.s.r>o.r&&(d.s.r=o.r),d.e.r<o.r&&(d.e.r=o.r),d.s.c>o.c&&(d.s.c=o.c),d.e.c<o.c&&(d.e.c=o.c);var u=St(d);u!==e["!ref"]&&(e["!ref"]=u)}i.c||(i.c=[]);var f={a:l.author,t:l.t,r:l.r,T:r};l.h&&(f.h=l.h);for(var p=i.c.length-1;p>=0;--p){if(!r&&i.c[p].T)return;r&&!i.c[p].T&&i.c.splice(p,1)}if(r&&a){for(p=0;p<a.length;++p)if(f.a==a[p].id){f.a=a[p].name||f.a;break}}i.c.push(f)})}function nwe(e,t){if(e.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],a=[],s=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);s&&s[1]&&s[1].split(/<\/\w*:?author>/).forEach(function(l){if(!(l===""||l.trim()==="")){var o=l.match(/<(?:\w+:)?author[^>]*>(.*)/);o&&r.push(o[1])}});var i=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return i&&i[1]&&i[1].split(/<\/\w*:?comment>/).forEach(function(l){if(!(l===""||l.trim()==="")){var o=l.match(/<(?:\w+:)?comment[^>]*>/);if(o){var d=vt(o[0]),u={author:d.authorId&&r[d.authorId]||"sheetjsghost",ref:d.ref,guid:d.guid},f=Vr(d.ref);if(!(t.sheetRows&&t.sheetRows<=f.r)){var p=l.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),x=!!p&&!!p[1]&&wE(p[1])||{r:"",t:"",h:""};u.r=x.r,x.r=="<t></t>"&&(x.t=x.h=""),u.t=(x.t||"").replace(/\r\n/g,`
`).replace(/\r/g,`
`),t.cellHTML&&(u.h=x.h),a.push(u)}}}}),a}function R9(e){var t=[xa,Ke("comments",null,{xmlns:nu[0]})],r=[];return t.push("<authors>"),e.forEach(function(a){a[1].forEach(function(s){var i=cr(s.a);r.indexOf(i)==-1&&(r.push(i),t.push("<author>"+i+"</author>")),s.T&&s.ID&&r.indexOf("tc="+s.ID)==-1&&(r.push("tc="+s.ID),t.push("<author>tc="+s.ID+"</author>"))})}),r.length==0&&(r.push("SheetJ5"),t.push("<author>SheetJ5</author>")),t.push("</authors>"),t.push("<commentList>"),e.forEach(function(a){var s=0,i=[];if(a[1][0]&&a[1][0].T&&a[1][0].ID?s=r.indexOf("tc="+a[1][0].ID):a[1].forEach(function(d){d.a&&(s=r.indexOf(cr(d.a))),i.push(d.t||"")}),t.push('<comment ref="'+a[0]+'" authorId="'+s+'"><text>'),i.length<=1)t.push(mn("t",cr(i[0]||"")));else{for(var l=`Comment:
    `+i[0]+`
`,o=1;o<i.length;++o)l+=`Reply:
    `+i[o]+`
`;t.push(mn("t",cr(l)))}t.push("</text></comment>")}),t.push("</commentList>"),t.length>2&&(t[t.length]="</comments>",t[1]=t[1].replace("/>",">")),t.join("")}function swe(e,t){var r=[],a=!1,s={},i=0;return e.replace(Pn,function(o,d){var u=vt(o);switch(_l(u[0])){case"<?xml":break;case"<ThreadedComments":break;case"</ThreadedComments>":break;case"<threadedComment":s={author:u.personId,guid:u.id,ref:u.ref,T:1};break;case"</threadedComment>":s.t!=null&&r.push(s);break;case"<text>":case"<text":i=d+o.length;break;case"</text>":s.t=e.slice(i,d).replace(/\r\n/g,`
`).replace(/\r/g,`
`);break;case"<mentions":case"<mentions>":a=!0;break;case"</mentions>":a=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(!a&&t.WTF)throw new Error("unrecognized "+u[0]+" in threaded comments")}return o}),r}function iwe(e,t,r){var a=[xa,Ke("ThreadedComments",null,{xmlns:Pa.TCMNT}).replace(/[\/]>/,">")];return e.forEach(function(s){var i="";(s[1]||[]).forEach(function(l,o){if(!l.T){delete l.ID;return}l.a&&t.indexOf(l.a)==-1&&t.push(l.a);var d={ref:s[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+r.tcid++).slice(-12)+"}"};o==0?i=d.id:d.parentId=i,l.ID=d.id,l.a&&(d.personId="{54EE7950-7262-4200-6969-"+("000000000000"+t.indexOf(l.a)).slice(-12)+"}"),a.push(Ke("threadedComment",mn("text",l.t||""),d))})}),a.push("</ThreadedComments>"),a.join("")}function lwe(e,t){var r=[],a=!1;return e.replace(Pn,function(i){var l=vt(i);switch(_l(l[0])){case"<?xml":break;case"<personList":break;case"</personList>":break;case"<person":r.push({name:l.displayname,id:l.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(!a&&t.WTF)throw new Error("unrecognized "+l[0]+" in threaded comments")}return i}),r}function owe(e){var t=[xa,Ke("personList",null,{xmlns:Pa.TCMNT,"xmlns:x":nu[0]}).replace(/[\/]>/,">")];return e.forEach(function(r,a){t.push(Ke("person",null,{displayName:r,id:"{54EE7950-7262-4200-6969-"+("000000000000"+a).slice(-12)+"}",userId:r,providerId:"None"}))}),t.push("</personList>"),t.join("")}function cwe(e){var t={};t.iauthor=e.read_shift(4);var r=ou(e);return t.rfx=r.s,t.ref=bt(r.s),e.l+=16,t}function dwe(e,t){return t==null&&(t=Re(36)),t.write_shift(4,e[1].iauthor),a0(e[0],t),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t}var uwe=Mn;function Awe(e){return Za(e.slice(0,54))}function fwe(e,t){var r=[],a=[],s={},i=!1;return Ro(e,function(o,d,u){switch(u){case 632:a.push(o);break;case 635:s=o;break;case 637:s.t=o.t,s.h=o.h,s.r=o.r;break;case 636:if(s.author=a[s.iauthor],delete s.iauthor,t.sheetRows&&s.rfx&&t.sheetRows<=s.rfx.r)break;s.t||(s.t=""),delete s.rfx,r.push(s);break;case 3072:break;case 35:i=!0;break;case 36:i=!1;break;case 37:break;case 38:break;default:if(!d.T){if(!i||t.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}),r}function pwe(e){var t=As(),r=[];return Qe(t,628),Qe(t,630),e.forEach(function(a){a[1].forEach(function(s){r.indexOf(s.a)>-1||(r.push(s.a.slice(0,54)),Qe(t,632,Awe(s.a)))})}),Qe(t,631),Qe(t,633),e.forEach(function(a){a[1].forEach(function(s){s.iauthor=r.indexOf(s.a);var i={s:Vr(a[0]),e:Vr(a[0])};Qe(t,635,dwe([i,s])),s.t&&s.t.length>0&&Qe(t,637,Mge(s)),Qe(t,636),delete s.iauthor})}),Qe(t,634),Qe(t,629),t.end()}var hwe="application/vnd.ms-office.vbaProject";function xwe(e){var t=ut.utils.cfb_new({root:"R"});return e.FullPaths.forEach(function(r,a){if(!(r.slice(-1)==="/"||!r.match(/_VBA_PROJECT_CUR/))){var s=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");ut.utils.cfb_add(t,s,e.FileIndex[a].content)}}),ut.write(t)}function mwe(e,t){t.FullPaths.forEach(function(r,a){if(a!=0){var s=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");s.slice(-1)!=="/"&&ut.utils.cfb_add(e,s,t.FileIndex[a].content)}})}var O9=["xlsb","xlsm","xlam","biff8","xla"];function gwe(){return{"!type":"dialog"}}function bwe(){return{"!type":"dialog"}}function vwe(){return{"!type":"macro"}}function ywe(){return{"!type":"macro"}}var wA=(function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(a,s,i,l){var o=!1,d=!1;i.length==0?d=!0:i.charAt(0)=="["&&(d=!0,i=i.slice(1,-1)),l.length==0?o=!0:l.charAt(0)=="["&&(o=!0,l=l.slice(1,-1));var u=i.length>0?parseInt(i,10)|0:0,f=l.length>0?parseInt(l,10)|0:0;return o?f+=t.c:--f,d?u+=t.r:--u,s+(o?"":"$")+$r(f)+(d?"":"$")+pa(u)}return function(s,i){return t=i,s.replace(e,r)}})(),jE=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,EE=(function(){return function(t,r){return t.replace(jE,function(a,s,i,l,o,d){var u=fE(l)-(i?0:r.c),f=AE(d)-(o?0:r.r),p=f==0?"":o?f+1:"["+f+"]",x=u==0?"":i?u+1:"["+u+"]";return s+"R"+p+"C"+x})}})();function P9(e,t){return e.replace(jE,function(r,a,s,i,l,o){return a+(s=="$"?s+i:$r(fE(i)+t.c))+(l=="$"?l+o:pa(AE(o)+t.r))})}function wwe(e,t,r){var a=xs(t),s=a.s,i=Vr(r),l={r:i.r-s.r,c:i.c-s.c};return P9(e,l)}function Nwe(e){return e.length!=1}function JD(e){return e.replace(/_xlfn\./g,"")}function wa(e){e.l+=1}function Uc(e,t){var r=e.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function L9(e,t,r){var a=2;if(r){if(r.biff>=2&&r.biff<=5)return Q9(e);r.biff==12&&(a=4)}var s=e.read_shift(a),i=e.read_shift(a),l=Uc(e),o=Uc(e);return{s:{r:s,c:l[0],cRel:l[1],rRel:l[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function Q9(e){var t=Uc(e),r=Uc(e),a=e.read_shift(1),s=e.read_shift(1);return{s:{r:t[0],c:a,cRel:t[1],rRel:t[2]},e:{r:r[0],c:s,cRel:r[1],rRel:r[2]}}}function Cwe(e,t,r){if(r.biff<8)return Q9(e);var a=e.read_shift(r.biff==12?4:2),s=e.read_shift(r.biff==12?4:2),i=Uc(e),l=Uc(e);return{s:{r:a,c:i[0],cRel:i[1],rRel:i[2]},e:{r:s,c:l[0],cRel:l[1],rRel:l[2]}}}function H9(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return kwe(e);var a=e.read_shift(r&&r.biff==12?4:2),s=Uc(e);return{r:a,c:s[0],cRel:s[1],rRel:s[2]}}function kwe(e){var t=Uc(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function jwe(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function Ewe(e,t,r){var a=r&&r.biff?r.biff:8;if(a>=2&&a<=5)return Swe(e);var s=e.read_shift(a>=12?4:2),i=e.read_shift(2),l=(i&16384)>>14,o=(i&32768)>>15;if(i&=16383,o==1)for(;s>524287;)s-=1048576;if(l==1)for(;i>8191;)i=i-16384;return{r:s,c:i,cRel:l,rRel:o}}function Swe(e){var t=e.read_shift(2),r=e.read_shift(1),a=(t&32768)>>15,s=(t&16384)>>14;return t&=16383,a==1&&t>=8192&&(t=t-16384),s==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:s,rRel:a}}function Bwe(e,t,r){var a=(e[e.l++]&96)>>5,s=L9(e,r.biff>=2&&r.biff<=5?6:8,r);return[a,s]}function _we(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2,"i"),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}var l=L9(e,i,r);return[a,s,l]}function Twe(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[a]}function Fwe(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}return e.l+=i,[a,s]}function Iwe(e,t,r){var a=(e[e.l++]&96)>>5,s=Cwe(e,t-1,r);return[a,s]}function Dwe(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[a]}function ZD(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function Uwe(e,t,r){e.l+=2;for(var a=e.read_shift(r&&r.biff==2?1:2),s=[],i=0;i<=a;++i)s.push(e.read_shift(r&&r.biff==2?1:2));return s}function Mwe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function Rwe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function Owe(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function Pwe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[a]}function z9(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function Lwe(e){return e.read_shift(2),z9(e)}function Qwe(e){return e.read_shift(2),z9(e)}function Hwe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=H9(e,0,r);return[a,s]}function zwe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=Ewe(e,0,r);return[a,s]}function $we(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var i=H9(e,0,r);return[a,s,i]}function Vwe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=e.read_shift(r&&r.biff<=3?1:2);return[q2e[s],G9[s],a]}function Gwe(e,t,r){var a=e[e.l++],s=e.read_shift(1),i=r&&r.biff<=3?[a==88?-1:0,e.read_shift(1)]:Kwe(e);return[s,(i[0]===0?G9:K2e)[i[1]]]}function Kwe(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function qwe(e,t,r){e.l+=r&&r.biff==2?3:4}function Wwe(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var a=e.read_shift(2),s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function Ywe(e){return e.l++,Oo[e.read_shift(1)]}function Xwe(e){return e.l++,e.read_shift(2)}function Jwe(e){return e.l++,e.read_shift(1)!==0}function Zwe(e){return e.l++,Un(e)}function e2e(e,t,r){return e.l++,Jp(e,t-1,r)}function t2e(e,t){var r=[e.read_shift(1)];if(t==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=Aa(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=Oo[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=Un(e);break;case 2:r[1]=cu(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function r2e(e,t,r){for(var a=e.read_shift(r.biff==12?4:2),s=[],i=0;i!=a;++i)s.push((r.biff==12?ou:dv)(e));return s}function a2e(e,t,r){var a=0,s=0;r.biff==12?(a=e.read_shift(4),s=e.read_shift(4)):(s=1+e.read_shift(1),a=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--a,--s==0&&(s=256));for(var i=0,l=[];i!=a&&(l[i]=[]);++i)for(var o=0;o!=s;++o)l[i][o]=t2e(e,r.biff);return l}function n2e(e,t,r){var a=e.read_shift(1)>>>5&3,s=!r||r.biff>=8?4:2,i=e.read_shift(s);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[a,0,i]}function s2e(e,t,r){if(r.biff==5)return i2e(e);var a=e.read_shift(1)>>>5&3,s=e.read_shift(2),i=e.read_shift(4);return[a,s,i]}function i2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var a=e.read_shift(2);return e.l+=12,[t,r,a]}function l2e(e,t,r){var a=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function o2e(e,t,r){var a=e.read_shift(1)>>>5&3,s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function c2e(e,t,r){var a=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[a]}function d2e(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2),i=4;if(r)switch(r.biff){case 5:i=15;break;case 12:i=6;break}return e.l+=i,[a,s]}var u2e=On,A2e=On,f2e=On;function eh(e,t,r){return e.l+=2,[jwe(e)]}function SE(e){return e.l+=6,[]}var p2e=eh,h2e=SE,x2e=SE,m2e=eh;function $9(e){return e.l+=2,[Ca(e),e.read_shift(2)&1]}var g2e=eh,b2e=$9,v2e=SE,y2e=eh,w2e=eh,N2e=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function C2e(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(4),s=e.read_shift(2),i=e.read_shift(2),l=N2e[r>>2&31];return{ixti:t,coltype:r&3,rt:l,idx:a,c:s,C:i}}function k2e(e){return e.l+=2,[e.read_shift(4)]}function j2e(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function E2e(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function S2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function B2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function _2e(e){return e.l+=4,[0,0]}var eU={1:{n:"PtgExp",f:Wwe},2:{n:"PtgTbl",f:f2e},3:{n:"PtgAdd",f:wa},4:{n:"PtgSub",f:wa},5:{n:"PtgMul",f:wa},6:{n:"PtgDiv",f:wa},7:{n:"PtgPower",f:wa},8:{n:"PtgConcat",f:wa},9:{n:"PtgLt",f:wa},10:{n:"PtgLe",f:wa},11:{n:"PtgEq",f:wa},12:{n:"PtgGe",f:wa},13:{n:"PtgGt",f:wa},14:{n:"PtgNe",f:wa},15:{n:"PtgIsect",f:wa},16:{n:"PtgUnion",f:wa},17:{n:"PtgRange",f:wa},18:{n:"PtgUplus",f:wa},19:{n:"PtgUminus",f:wa},20:{n:"PtgPercent",f:wa},21:{n:"PtgParen",f:wa},22:{n:"PtgMissArg",f:wa},23:{n:"PtgStr",f:e2e},26:{n:"PtgSheet",f:j2e},27:{n:"PtgEndSheet",f:E2e},28:{n:"PtgErr",f:Ywe},29:{n:"PtgBool",f:Jwe},30:{n:"PtgInt",f:Xwe},31:{n:"PtgNum",f:Zwe},32:{n:"PtgArray",f:Dwe},33:{n:"PtgFunc",f:Vwe},34:{n:"PtgFuncVar",f:Gwe},35:{n:"PtgName",f:n2e},36:{n:"PtgRef",f:Hwe},37:{n:"PtgArea",f:Bwe},38:{n:"PtgMemArea",f:l2e},39:{n:"PtgMemErr",f:u2e},40:{n:"PtgMemNoMem",f:A2e},41:{n:"PtgMemFunc",f:o2e},42:{n:"PtgRefErr",f:c2e},43:{n:"PtgAreaErr",f:Twe},44:{n:"PtgRefN",f:zwe},45:{n:"PtgAreaN",f:Iwe},46:{n:"PtgMemAreaN",f:S2e},47:{n:"PtgMemNoMemN",f:B2e},57:{n:"PtgNameX",f:s2e},58:{n:"PtgRef3d",f:$we},59:{n:"PtgArea3d",f:_we},60:{n:"PtgRefErr3d",f:d2e},61:{n:"PtgAreaErr3d",f:Fwe},255:{}},T2e={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},F2e={1:{n:"PtgElfLel",f:$9},2:{n:"PtgElfRw",f:y2e},3:{n:"PtgElfCol",f:p2e},6:{n:"PtgElfRwV",f:w2e},7:{n:"PtgElfColV",f:m2e},10:{n:"PtgElfRadical",f:g2e},11:{n:"PtgElfRadicalS",f:v2e},13:{n:"PtgElfColS",f:h2e},15:{n:"PtgElfColSV",f:x2e},16:{n:"PtgElfRadicalLel",f:b2e},25:{n:"PtgList",f:C2e},29:{n:"PtgSxName",f:k2e},255:{}},I2e={0:{n:"PtgAttrNoop",f:_2e},1:{n:"PtgAttrSemi",f:Pwe},2:{n:"PtgAttrIf",f:Rwe},4:{n:"PtgAttrChoose",f:Uwe},8:{n:"PtgAttrGoto",f:Mwe},16:{n:"PtgAttrSum",f:qwe},32:{n:"PtgAttrBaxcel",f:ZD},33:{n:"PtgAttrBaxcel",f:ZD},64:{n:"PtgAttrSpace",f:Lwe},65:{n:"PtgAttrSpaceSemi",f:Qwe},128:{n:"PtgAttrIfError",f:Owe},255:{}};function th(e,t,r,a){if(a.biff<8)return On(e,t);for(var s=e.l+t,i=[],l=0;l!==r.length;++l)switch(r[l][0]){case"PtgArray":r[l][1]=a2e(e,0,a),i.push(r[l][1]);break;case"PtgMemArea":r[l][2]=r2e(e,r[l][1],a),i.push(r[l][2]);break;case"PtgExp":a&&a.biff==12&&(r[l][1][1]=e.read_shift(4),i.push(r[l][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[l][0]}return t=s-e.l,t!==0&&i.push(On(e,t)),i}function rh(e,t,r){for(var a=e.l+t,s,i,l=[];a!=e.l;)t=a-e.l,i=e[e.l],s=eU[i]||eU[T2e[i]],(i===24||i===25)&&(s=(i===24?F2e:I2e)[e[e.l+1]]),!s||!s.f?On(e,t):l.push([s.n,s.f(e,t,r)]);return l}function D2e(e){for(var t=[],r=0;r<e.length;++r){for(var a=e[r],s=[],i=0;i<a.length;++i){var l=a[i];if(l)switch(l[0]){case 2:s.push('"'+l[1].replace(/"/g,'""')+'"');break;default:s.push(l[1])}else s.push("")}t.push(s.join(","))}return t.join(";")}var U2e={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function M2e(e,t){if(!e&&!(t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function V9(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var a=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!a)return"SH33TJSERR1";var s="";if(r.biff>8)switch(e[a[0]][0]){case 357:return s=a[1]==-1?"#REF":e.SheetNames[a[1]],a[1]==a[2]?s:s+":"+e.SheetNames[a[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[a[0]][0];case 355:default:return"SH33TJSSRC"+e[a[0]][0]}switch(e[a[0]][0][0]){case 1025:return s=a[1]==-1?"#REF":e.SheetNames[a[1]]||"SH33TJSERR3",a[1]==a[2]?s:s+":"+e.SheetNames[a[2]];case 14849:return e[a[0]].slice(1).map(function(i){return i.Name}).join(";;");default:return e[a[0]][0][3]?(s=a[1]==-1?"#REF":e[a[0]][0][3][a[1]]||"SH33TJSERR4",a[1]==a[2]?s:s+":"+e[a[0]][0][3][a[2]]):"SH33TJSERR2"}}function tU(e,t,r){var a=V9(e,t,r);return a=="#REF"?a:M2e(a,r)}function Tn(e,t,r,a,s){var i=s&&s.biff||8,l={s:{c:0,r:0}},o=[],d,u,f,p=0,x=0,m,b="";if(!e[0]||!e[0][0])return"";for(var v=-1,y="",k=0,_=e[0].length;k<_;++k){var C=e[0][k];switch(C[0]){case"PtgUminus":o.push("-"+o.pop());break;case"PtgUplus":o.push("+"+o.pop());break;case"PtgPercent":o.push(o.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(d=o.pop(),u=o.pop(),v>=0){switch(e[0][v][1][0]){case 0:y=ra(" ",e[0][v][1][1]);break;case 1:y=ra("\r",e[0][v][1][1]);break;default:if(y="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][v][1][0])}u=u+y,v=-1}o.push(u+U2e[C[0]]+d);break;case"PtgIsect":d=o.pop(),u=o.pop(),o.push(u+" "+d);break;case"PtgUnion":d=o.pop(),u=o.pop(),o.push(u+","+d);break;case"PtgRange":d=o.pop(),u=o.pop(),o.push(u+":"+d);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":f=Ff(C[1][1],l,s),o.push(If(f,i));break;case"PtgRefN":f=r?Ff(C[1][1],r,s):C[1][1],o.push(If(f,i));break;case"PtgRef3d":p=C[1][1],f=Ff(C[1][2],l,s),b=tU(a,p,s),o.push(b+"!"+If(f,i));break;case"PtgFunc":case"PtgFuncVar":var E=C[1][0],T=C[1][1];E||(E=0),E&=127;var B=E==0?[]:o.slice(-E);o.length-=E,T==="User"&&(T=B.shift()),o.push(T+"("+B.join(",")+")");break;case"PtgBool":o.push(C[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(C[1]);break;case"PtgNum":o.push(String(C[1]));break;case"PtgStr":o.push('"'+C[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(C[1]);break;case"PtgAreaN":m=_D(C[1][1],r?{s:r}:l,s),o.push(k2(m,s));break;case"PtgArea":m=_D(C[1][1],l,s),o.push(k2(m,s));break;case"PtgArea3d":p=C[1][1],m=C[1][2],b=tU(a,p,s),o.push(b+"!"+k2(m,s));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":x=C[1][2];var I=(a.names||[])[x-1]||(a[0]||[])[x],M=I?I.Name:"SH33TJSNAME"+String(x);M&&M.slice(0,6)=="_xlfn."&&!s.xlfn&&(M=M.slice(6)),o.push(M);break;case"PtgNameX":var U=C[1][1];x=C[1][2];var D;if(s.biff<=5)U<0&&(U=-U),a[U]&&(D=a[U][x]);else{var L="";if(((a[U]||[])[0]||[])[0]==14849||(((a[U]||[])[0]||[])[0]==1025?a[U][x]&&a[U][x].itab>0&&(L=a.SheetNames[a[U][x].itab-1]+"!"):L=a.SheetNames[x-1]+"!"),a[U]&&a[U][x])L+=a[U][x].Name;else if(a[0]&&a[0][x])L+=a[0][x].Name;else{var R=(V9(a,U,s)||"").split(";;");R[x-1]?L=R[x-1]:L+="SH33TJSERRX"}o.push(L);break}D||(D={Name:"SH33TJSERRY"}),o.push(D.Name);break;case"PtgParen":var Q="(",G=")";if(v>=0){switch(y="",e[0][v][1][0]){case 2:Q=ra(" ",e[0][v][1][1])+Q;break;case 3:Q=ra("\r",e[0][v][1][1])+Q;break;case 4:G=ra(" ",e[0][v][1][1])+G;break;case 5:G=ra("\r",e[0][v][1][1])+G;break;default:if(s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][v][1][0])}v=-1}o.push(Q+o.pop()+G);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":f={c:C[1][1],r:C[1][0]};var K={c:r.c,r:r.r};if(a.sharedf[bt(f)]){var W=a.sharedf[bt(f)];o.push(Tn(W,l,K,a,s))}else{var z=!1;for(d=0;d!=a.arrayf.length;++d)if(u=a.arrayf[d],!(f.c<u[0].s.c||f.c>u[0].e.c)&&!(f.r<u[0].s.r||f.r>u[0].e.r)){o.push(Tn(u[1],l,K,a,s)),z=!0;break}z||o.push(C[1])}break;case"PtgArray":o.push("{"+D2e(C[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":v=k;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":o.push("");break;case"PtgAreaErr":o.push("#REF!");break;case"PtgAreaErr3d":o.push("#REF!");break;case"PtgList":o.push("Table"+C[1].idx+"[#"+C[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(C));default:throw new Error("Unrecognized Formula Token: "+String(C))}var Z=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(s.biff!=3&&v>=0&&Z.indexOf(e[0][k][0])==-1){C=e[0][v];var Y=!0;switch(C[1][0]){case 4:Y=!1;case 0:y=ra(" ",C[1][1]);break;case 5:Y=!1;case 1:y=ra("\r",C[1][1]);break;default:if(y="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+C[1][0])}o.push((Y?y:"")+o.pop()+(Y?"":y)),v=-1}}if(o.length>1&&s.WTF)throw new Error("bad formula stack");return o[0]}function R2e(e,t,r){var a=e.l+t,s=r.biff==2?1:2,i,l=e.read_shift(s);if(l==65535)return[[],On(e,t-2)];var o=rh(e,l,r);return t!==l+s&&(i=th(e,t-l-s,o,r)),e.l=a,[o,i]}function O2e(e,t,r){var a=e.l+t,s=r.biff==2?1:2,i,l=e.read_shift(s);if(l==65535)return[[],On(e,t-2)];var o=rh(e,l,r);return t!==l+s&&(i=th(e,t-l-s,o,r)),e.l=a,[o,i]}function P2e(e,t,r,a){var s=e.l+t,i=rh(e,a,r),l;return s!==e.l&&(l=th(e,s-e.l,i,r)),[i,l]}function L2e(e,t,r){var a=e.l+t,s,i=e.read_shift(2),l=rh(e,i,r);return i==65535?[[],On(e,t-2)]:(t!==i+2&&(s=th(e,a-i-2,l,r)),[l,s])}function Q2e(e){var t;if(io(e,e.l+6)!==65535)return[Un(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=e[e.l+2]===1,e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}function H2e(e){if(e==null){var t=Re(8);return t.write_shift(1,3),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,65535),t}else if(typeof e=="number")return Kd(e);return Kd(0)}function _2(e,t,r){var a=e.l+t,s=Tl(e);r.biff==2&&++e.l;var i=Q2e(e),l=e.read_shift(1);r.biff!=2&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var o=O2e(e,a-e.l,r);return{cell:s,val:i[0],formula:o,shared:l>>3&1,tt:i[1]}}function z2e(e,t,r,a,s){var i=Wd(t,r,s),l=H2e(e.v),o=Re(6),d=33;o.write_shift(2,d),o.write_shift(4,0);for(var u=Re(e.bf.length),f=0;f<e.bf.length;++f)u[f]=e.bf[f];var p=Xa([i,l,o,u]);return p}function uv(e,t,r){var a=e.read_shift(4),s=rh(e,a,r),i=e.read_shift(4),l=i>0?th(e,i,s,r):null;return[s,l]}var $2e=uv,Av=uv,V2e=uv,G2e=uv,K2e={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},G9={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},q2e={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function rU(e){return e.slice(0,3)=="of:"&&(e=e.slice(3)),e.charCodeAt(0)==61&&(e=e.slice(1),e.charCodeAt(0)==61&&(e=e.slice(1))),e=e.replace(/COM\.MICROSOFT\./g,""),e=e.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(t,r){return r.replace(/\./g,"")}),e=e.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),e.replace(/[;~]/g,",").replace(/\|/g,";")}function W2e(e){var t="of:="+e.replace(jE,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return t.replace(/;/g,"|").replace(/,/g,";")}function T2(e){var t=e.split(":"),r=t[0].split(".")[0];return[r,t[0].split(".")[1]+(t.length>1?":"+(t[1].split(".")[1]||t[1].split(".")[0]):"")]}function Y2e(e){return e.replace(/\./,"!")}var Uf={},NA={},Mf=typeof Map<"u";function BE(e,t,r){var a=0,s=e.length;if(r){if(Mf?r.has(t):Object.prototype.hasOwnProperty.call(r,t)){for(var i=Mf?r.get(t):r[t];a<i.length;++a)if(e[i[a]].t===t)return e.Count++,i[a]}}else for(;a<s;++a)if(e[a].t===t)return e.Count++,a;return e[s]={t},e.Count++,e.Unique++,r&&(Mf?(r.has(t)||r.set(t,[]),r.get(t).push(s)):(Object.prototype.hasOwnProperty.call(r,t)||(r[t]=[]),r[t].push(s))),s}function fv(e,t){var r={min:e+1,max:e+1},a=-1;return t.MDW&&(Dn=t.MDW),t.width!=null?r.customWidth=1:t.wpx!=null?a=yp(t.wpx):t.wch!=null&&(a=t.wch),a>-1?(r.width=Wg(a),r.customWidth=1):t.width!=null&&(r.width=t.width),t.hidden&&(r.hidden=!0),t.level!=null&&(r.outlineLevel=r.level=t.level),r}function Id(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];t=="xlml"&&(r=[1,1,1,1,.5,.5]),e.left==null&&(e.left=r[0]),e.right==null&&(e.right=r[1]),e.top==null&&(e.top=r[2]),e.bottom==null&&(e.bottom=r[3]),e.header==null&&(e.header=r[4]),e.footer==null&&(e.footer=r[5])}}function Kc(e,t,r){var a=r.revssf[t.z!=null?t.z:"General"],s=60,i=e.length;if(a==null&&r.ssf){for(;s<392;++s)if(r.ssf[s]==null){uo(t.z,s),r.ssf[s]=t.z,r.revssf[t.z]=a=s;break}}for(s=0;s!=i;++s)if(e[s].numFmtId===a)return s;return e[i]={numFmtId:a,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},i}function K9(e,t,r,a,s,i){try{a.cellNF&&(e.z=gt[t])}catch(o){if(a.WTF)throw o}if(!(e.t==="z"&&!a.cellStyles)){if(e.t==="d"&&typeof e.v=="string"&&(e.v=_r(e.v)),(!a||a.cellText!==!1)&&e.t!=="z")try{if(gt[t]==null&&uo(Kme[t]||"General",t),e.t==="e")e.w=e.w||Oo[e.v];else if(t===0)if(e.t==="n")(e.v|0)===e.v?e.w=e.v.toString(10):e.w=pp(e.v);else if(e.t==="d"){var l=Qa(e.v);(l|0)===l?e.w=l.toString(10):e.w=pp(l)}else{if(e.v===void 0)return"";e.w=Vd(e.v,NA)}else e.t==="d"?e.w=Ni(t,Qa(e.v),NA):e.w=Ni(t,e.v,NA)}catch(o){if(a.WTF)throw o}if(a.cellStyles&&r!=null)try{e.s=i.Fills[r],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=qg(s.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),a.WTF&&(e.s.fgColor.raw_rgb=s.themeElements.clrScheme[e.s.fgColor.theme].rgb)),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=qg(s.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),a.WTF&&(e.s.bgColor.raw_rgb=s.themeElements.clrScheme[e.s.bgColor.theme].rgb))}catch(o){if(a.WTF&&i.Fills)throw o}}}function X2e(e,t,r){if(e&&e["!ref"]){var a=Kt(e["!ref"]);if(a.e.c<a.s.c||a.e.r<a.s.r)throw new Error("Bad range ("+r+"): "+e["!ref"])}}function J2e(e,t){var r=Kt(t);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(e["!ref"]=St(r))}var Z2e=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,eNe=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,tNe=/<(?:\w:)?hyperlink [^>]*>/mg,rNe=/"(\w*:\w*)"/,aNe=/<(?:\w:)?col\b[^>]*[\/]?>/g,nNe=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,sNe=/<(?:\w:)?pageMargins[^>]*\/>/g,q9=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,iNe=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,lNe=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function oNe(e,t,r,a,s,i,l){if(!e)return e;a||(a={"!id":{}});var o=t.dense?[]:{},d={s:{r:2e6,c:2e6},e:{r:0,c:0}},u="",f="",p=e.match(eNe);p?(u=e.slice(0,p.index),f=e.slice(p.index+p[0].length)):u=f=e;var x=u.match(q9);x?_E(x[0],o,s,r):(x=u.match(iNe))&&dNe(x[0],x[1]||"",o,s,r);var m=(u.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(m>0){var b=u.slice(m,m+50).match(rNe);b&&J2e(o,b[1])}var v=u.match(lNe);v&&v[1]&&NNe(v[1],s);var y=[];if(t.cellStyles){var k=u.match(aNe);k&&gNe(y,k)}p&&jNe(p[1],o,t,d,i,l);var _=f.match(nNe);_&&(o["!autofilter"]=vNe(_[0]));var C=[],E=f.match(Z2e);if(E)for(m=0;m!=E.length;++m)C[m]=Kt(E[m].slice(E[m].indexOf('"')+1));var T=f.match(tNe);T&&hNe(o,T,a);var B=f.match(sNe);if(B&&(o["!margins"]=xNe(vt(B[0]))),!o["!ref"]&&d.e.c>=d.s.c&&d.e.r>=d.s.r&&(o["!ref"]=St(d)),t.sheetRows>0&&o["!ref"]){var I=Kt(o["!ref"]);t.sheetRows<=+I.e.r&&(I.e.r=t.sheetRows-1,I.e.r>d.e.r&&(I.e.r=d.e.r),I.e.r<I.s.r&&(I.s.r=I.e.r),I.e.c>d.e.c&&(I.e.c=d.e.c),I.e.c<I.s.c&&(I.s.c=I.e.c),o["!fullref"]=o["!ref"],o["!ref"]=St(I))}return y.length>0&&(o["!cols"]=y),C.length>0&&(o["!merges"]=C),o}function cNe(e){if(e.length===0)return"";for(var t='<mergeCells count="'+e.length+'">',r=0;r!=e.length;++r)t+='<mergeCell ref="'+St(e[r])+'"/>';return t+"</mergeCells>"}function _E(e,t,r,a){var s=vt(e);r.Sheets[a]||(r.Sheets[a]={}),s.codeName&&(r.Sheets[a].CodeName=Gt(hr(s.codeName)))}function dNe(e,t,r,a,s){_E(e.slice(0,e.indexOf(">")),r,a,s)}function uNe(e,t,r,a,s){var i=!1,l={},o=null;if(a.bookType!=="xlsx"&&t.vbaraw){var d=t.SheetNames[r];try{t.Workbook&&(d=t.Workbook.Sheets[r].CodeName||d)}catch{}i=!0,l.codeName=ml(cr(d))}if(e&&e["!outline"]){var u={summaryBelow:1,summaryRight:1};e["!outline"].above&&(u.summaryBelow=0),e["!outline"].left&&(u.summaryRight=0),o=(o||"")+Ke("outlinePr",null,u)}!i&&!o||(s[s.length]=Ke("sheetPr",o,l))}var ANe=["objects","scenarios","selectLockedCells","selectUnlockedCells"],fNe=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function pNe(e){var t={sheet:1};return ANe.forEach(function(r){e[r]!=null&&e[r]&&(t[r]="1")}),fNe.forEach(function(r){e[r]!=null&&!e[r]&&(t[r]="0")}),e.password&&(t.password=NE(e.password).toString(16).toUpperCase()),Ke("sheetProtection",null,t)}function hNe(e,t,r){for(var a=Array.isArray(e),s=0;s!=t.length;++s){var i=vt(hr(t[s]),!0);if(!i.ref)return;var l=((r||{})["!id"]||[])[i.id];l?(i.Target=l.Target,i.location&&(i.Target+="#"+Gt(i.location))):(i.Target="#"+Gt(i.location),l={Target:i.Target,TargetMode:"Internal"}),i.Rel=l,i.tooltip&&(i.Tooltip=i.tooltip,delete i.tooltip);for(var o=Kt(i.ref),d=o.s.r;d<=o.e.r;++d)for(var u=o.s.c;u<=o.e.c;++u){var f=bt({c:u,r:d});a?(e[d]||(e[d]=[]),e[d][u]||(e[d][u]={t:"z",v:void 0}),e[d][u].l=i):(e[f]||(e[f]={t:"z",v:void 0}),e[f].l=i)}}}function xNe(e){var t={};return["left","right","top","bottom","header","footer"].forEach(function(r){e[r]&&(t[r]=parseFloat(e[r]))}),t}function mNe(e){return Id(e),Ke("pageMargins",null,e)}function gNe(e,t){for(var r=!1,a=0;a!=t.length;++a){var s=vt(t[a],!0);s.hidden&&(s.hidden=Br(s.hidden));var i=parseInt(s.min,10)-1,l=parseInt(s.max,10)-1;for(s.outlineLevel&&(s.level=+s.outlineLevel||0),delete s.min,delete s.max,s.width=+s.width,!r&&s.width&&(r=!0,CE(s.width)),Dc(s);i<=l;)e[i++]=Tr(s)}}function bNe(e,t){for(var r=["<cols>"],a,s=0;s!=t.length;++s)(a=t[s])&&(r[r.length]=Ke("col",null,fv(s,a)));return r[r.length]="</cols>",r.join("")}function vNe(e){var t={ref:(e.match(/ref="([^"]*)"/)||[])[1]};return t}function yNe(e,t,r,a){var s=typeof e.ref=="string"?e.ref:St(e.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var i=r.Workbook.Names,l=xs(s);l.s.r==l.e.r&&(l.e.r=xs(t["!ref"]).e.r,s=St(l));for(var o=0;o<i.length;++o){var d=i[o];if(d.Name=="_xlnm._FilterDatabase"&&d.Sheet==a){d.Ref="'"+r.SheetNames[a]+"'!"+s;break}}return o==i.length&&i.push({Name:"_xlnm._FilterDatabase",Sheet:a,Ref:"'"+r.SheetNames[a]+"'!"+s}),Ke("autoFilter",null,{ref:s})}var wNe=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function NNe(e,t){t.Views||(t.Views=[{}]),(e.match(wNe)||[]).forEach(function(r,a){var s=vt(r);t.Views[a]||(t.Views[a]={}),+s.zoomScale&&(t.Views[a].zoom=+s.zoomScale),Br(s.rightToLeft)&&(t.Views[a].RTL=!0)})}function CNe(e,t,r,a){var s={workbookViewId:"0"};return(((a||{}).Workbook||{}).Views||[])[0]&&(s.rightToLeft=a.Workbook.Views[0].RTL?"1":"0"),Ke("sheetViews",Ke("sheetView",null,s),{})}function kNe(e,t,r,a){if(e.c&&r["!comments"].push([t,e.c]),e.v===void 0&&typeof e.f!="string"||e.t==="z"&&!e.f)return"";var s="",i=e.t,l=e.v;if(e.t!=="z")switch(e.t){case"b":s=e.v?"1":"0";break;case"n":s=""+e.v;break;case"e":s=Oo[e.v];break;case"d":a&&a.cellDates?s=_r(e.v,-1).toISOString():(e=Tr(e),e.t="n",s=""+(e.v=Qa(_r(e.v)))),typeof e.z>"u"&&(e.z=gt[14]);break;default:s=e.v;break}var o=mn("v",cr(s)),d={r:t},u=Kc(a.cellXfs,e,a);switch(u!==0&&(d.s=u),e.t){case"n":break;case"d":d.t="d";break;case"b":d.t="b";break;case"e":d.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(a&&a.bookSST){o=mn("v",""+BE(a.Strings,e.v,a.revStrings)),d.t="s";break}d.t="str";break}if(e.t!=i&&(e.t=i,e.v=l),typeof e.f=="string"&&e.f){var f=e.F&&e.F.slice(0,t.length)==t?{t:"array",ref:e.F}:null;o=Ke("f",cr(e.f),f)+(e.v!=null?o:"")}return e.l&&r["!links"].push([t,e.l]),e.D&&(d.cm=1),Ke("c",o,d)}var jNe=(function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,a=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,s=/ref=["']([^"']*)["']/,i=hp("v"),l=hp("f");return function(d,u,f,p,x,m){for(var b=0,v="",y=[],k=[],_=0,C=0,E=0,T="",B,I,M=0,U=0,D,L,R=0,Q=0,G=Array.isArray(m.CellXf),K,W=[],z=[],Z=Array.isArray(u),Y=[],te={},O=!1,P=!!f.sheetStubs,q=d.split(t),H=0,J=q.length;H!=J;++H){v=q[H].trim();var ae=v.length;if(ae!==0){var oe=0;e:for(b=0;b<ae;++b)switch(v[b]){case">":if(v[b-1]!="/"){++b;break e}if(f&&f.cellStyles){if(I=vt(v.slice(oe,b),!0),M=I.r!=null?parseInt(I.r,10):M+1,U=-1,f.sheetRows&&f.sheetRows<M)continue;te={},O=!1,I.ht&&(O=!0,te.hpt=parseFloat(I.ht),te.hpx=UA(te.hpt)),I.hidden=="1"&&(O=!0,te.hidden=!0),I.outlineLevel!=null&&(O=!0,te.level=+I.outlineLevel),O&&(Y[M-1]=te)}break;case"<":oe=b;break}if(oe>=b)break;if(I=vt(v.slice(oe,b),!0),M=I.r!=null?parseInt(I.r,10):M+1,U=-1,!(f.sheetRows&&f.sheetRows<M)){p.s.r>M-1&&(p.s.r=M-1),p.e.r<M-1&&(p.e.r=M-1),f&&f.cellStyles&&(te={},O=!1,I.ht&&(O=!0,te.hpt=parseFloat(I.ht),te.hpx=UA(te.hpt)),I.hidden=="1"&&(O=!0,te.hidden=!0),I.outlineLevel!=null&&(O=!0,te.level=+I.outlineLevel),O&&(Y[M-1]=te)),y=v.slice(b).split(e);for(var ce=0;ce!=y.length&&y[ce].trim().charAt(0)=="<";++ce);for(y=y.slice(ce),b=0;b!=y.length;++b)if(v=y[b].trim(),v.length!==0){if(k=v.match(r),_=b,C=0,E=0,v="<c "+(v.slice(0,1)=="<"?">":"")+v,k!=null&&k.length===2){for(_=0,T=k[1],C=0;C!=T.length&&!((E=T.charCodeAt(C)-64)<1||E>26);++C)_=26*_+E;--_,U=_}else++U;for(C=0;C!=v.length&&v.charCodeAt(C)!==62;++C);if(++C,I=vt(v.slice(0,C),!0),I.r||(I.r=bt({r:M-1,c:U})),T=v.slice(C),B={t:""},(k=T.match(i))!=null&&k[1]!==""&&(B.v=Gt(k[1])),f.cellFormula){if((k=T.match(l))!=null&&k[1]!==""){if(B.f=Gt(hr(k[1])).replace(/\r\n/g,`
`),f.xlfn||(B.f=JD(B.f)),k[0].indexOf('t="array"')>-1)B.F=(T.match(s)||[])[1],B.F.indexOf(":")>-1&&W.push([Kt(B.F),B.F]);else if(k[0].indexOf('t="shared"')>-1){L=vt(k[0]);var ne=Gt(hr(k[1]));f.xlfn||(ne=JD(ne)),z[parseInt(L.si,10)]=[L,ne,I.r]}}else(k=T.match(/<f[^>]*\/>/))&&(L=vt(k[0]),z[L.si]&&(B.f=wwe(z[L.si][1],z[L.si][2],I.r)));var le=Vr(I.r);for(C=0;C<W.length;++C)le.r>=W[C][0].s.r&&le.r<=W[C][0].e.r&&le.c>=W[C][0].s.c&&le.c<=W[C][0].e.c&&(B.F=W[C][1])}if(I.t==null&&B.v===void 0)if(B.f||B.F)B.v=0,B.t="n";else if(P)B.t="z";else continue;else B.t=I.t||"n";switch(p.s.c>U&&(p.s.c=U),p.e.c<U&&(p.e.c=U),B.t){case"n":if(B.v==""||B.v==null){if(!P)continue;B.t="z"}else B.v=parseFloat(B.v);break;case"s":if(typeof B.v>"u"){if(!P)continue;B.t="z"}else D=Uf[parseInt(B.v,10)],B.v=D.t,B.r=D.r,f.cellHTML&&(B.h=D.h);break;case"str":B.t="s",B.v=B.v!=null?hr(B.v):"",f.cellHTML&&(B.h=oE(B.v));break;case"inlineStr":k=T.match(a),B.t="s",k!=null&&(D=wE(k[1]))?(B.v=D.t,f.cellHTML&&(B.h=D.h)):B.v="";break;case"b":B.v=Br(B.v);break;case"d":f.cellDates?B.v=_r(B.v,1):(B.v=Qa(_r(B.v,1)),B.t="n");break;case"e":(!f||f.cellText!==!1)&&(B.w=B.v),B.v=YQ[B.v];break}if(R=Q=0,K=null,G&&I.s!==void 0&&(K=m.CellXf[I.s],K!=null&&(K.numFmtId!=null&&(R=K.numFmtId),f.cellStyles&&K.fillId!=null&&(Q=K.fillId))),K9(B,R,Q,f,x,m),f.cellDates&&G&&B.t=="n"&&e0(gt[R])&&(B.t="d",B.v=cv(B.v)),I.cm&&f.xlmeta){var ge=(f.xlmeta.Cell||[])[+I.cm-1];ge&&ge.type=="XLDAPR"&&(B.D=!0)}if(Z){var X=Vr(I.r);u[X.r]||(u[X.r]=[]),u[X.r][X.c]=B}else u[I.r]=B}}}}Y.length>0&&(u["!rows"]=Y)}})();function ENe(e,t,r,a){var s=[],i=[],l=Kt(e["!ref"]),o="",d,u="",f=[],p=0,x=0,m=e["!rows"],b=Array.isArray(e),v={r:u},y,k=-1;for(x=l.s.c;x<=l.e.c;++x)f[x]=$r(x);for(p=l.s.r;p<=l.e.r;++p){for(i=[],u=pa(p),x=l.s.c;x<=l.e.c;++x){d=f[x]+u;var _=b?(e[p]||[])[x]:e[d];_!==void 0&&(o=kNe(_,d,e,t))!=null&&i.push(o)}(i.length>0||m&&m[p])&&(v={r:u},m&&m[p]&&(y=m[p],y.hidden&&(v.hidden=1),k=-1,y.hpx?k=wp(y.hpx):y.hpt&&(k=y.hpt),k>-1&&(v.ht=k,v.customHeight=1),y.level&&(v.outlineLevel=y.level)),s[s.length]=Ke("row",i.join(""),v))}if(m)for(;p<m.length;++p)m&&m[p]&&(v={r:p+1},y=m[p],y.hidden&&(v.hidden=1),k=-1,y.hpx?k=wp(y.hpx):y.hpt&&(k=y.hpt),k>-1&&(v.ht=k,v.customHeight=1),y.level&&(v.outlineLevel=y.level),s[s.length]=Ke("row","",v));return s.join("")}function W9(e,t,r,a){var s=[xa,Ke("worksheet",null,{xmlns:nu[0],"xmlns:r":Pa.r})],i=r.SheetNames[e],l=0,o="",d=r.Sheets[i];d==null&&(d={});var u=d["!ref"]||"A1",f=Kt(u);if(f.e.c>16383||f.e.r>1048575){if(t.WTF)throw new Error("Range "+u+" exceeds format limit A1:XFD1048576");f.e.c=Math.min(f.e.c,16383),f.e.r=Math.min(f.e.c,1048575),u=St(f)}a||(a={}),d["!comments"]=[];var p=[];uNe(d,r,e,t,s),s[s.length]=Ke("dimension",null,{ref:u}),s[s.length]=CNe(d,t,e,r),t.sheetFormat&&(s[s.length]=Ke("sheetFormatPr",null,{defaultRowHeight:t.sheetFormat.defaultRowHeight||"16",baseColWidth:t.sheetFormat.baseColWidth||"10",outlineLevelRow:t.sheetFormat.outlineLevelRow||"7"})),d["!cols"]!=null&&d["!cols"].length>0&&(s[s.length]=bNe(d,d["!cols"])),s[l=s.length]="<sheetData/>",d["!links"]=[],d["!ref"]!=null&&(o=ENe(d,t),o.length>0&&(s[s.length]=o)),s.length>l+1&&(s[s.length]="</sheetData>",s[l]=s[l].replace("/>",">")),d["!protect"]&&(s[s.length]=pNe(d["!protect"])),d["!autofilter"]!=null&&(s[s.length]=yNe(d["!autofilter"],d,r,e)),d["!merges"]!=null&&d["!merges"].length>0&&(s[s.length]=cNe(d["!merges"]));var x=-1,m,b=-1;return d["!links"].length>0&&(s[s.length]="<hyperlinks>",d["!links"].forEach(function(v){v[1].Target&&(m={ref:v[0]},v[1].Target.charAt(0)!="#"&&(b=lr(a,-1,cr(v[1].Target).replace(/#.*$/,""),Ut.HLINK),m["r:id"]="rId"+b),(x=v[1].Target.indexOf("#"))>-1&&(m.location=cr(v[1].Target.slice(x+1))),v[1].Tooltip&&(m.tooltip=cr(v[1].Tooltip)),s[s.length]=Ke("hyperlink",null,m))}),s[s.length]="</hyperlinks>"),delete d["!links"],d["!margins"]!=null&&(s[s.length]=mNe(d["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&(s[s.length]=mn("ignoredErrors",Ke("ignoredError",null,{numberStoredAsText:1,sqref:u}))),p.length>0&&(b=lr(a,-1,"../drawings/drawing"+(e+1)+".xml",Ut.DRAW),s[s.length]=Ke("drawing",null,{"r:id":"rId"+b}),d["!drawing"]=p),d["!comments"].length>0&&(b=lr(a,-1,"../drawings/vmlDrawing"+(e+1)+".vml",Ut.VML),s[s.length]=Ke("legacyDrawing",null,{"r:id":"rId"+b}),d["!legacy"]=b),s.length>1&&(s[s.length]="</worksheet>",s[1]=s[1].replace("/>",">")),s.join("")}function SNe(e,t){var r={},a=e.l+t;r.r=e.read_shift(4),e.l+=4;var s=e.read_shift(2);e.l+=1;var i=e.read_shift(1);return e.l=a,i&7&&(r.level=i&7),i&16&&(r.hidden=!0),i&32&&(r.hpt=s/20),r}function BNe(e,t,r){var a=Re(145),s=(r["!rows"]||[])[e]||{};a.write_shift(4,e),a.write_shift(4,0);var i=320;s.hpx?i=wp(s.hpx)*20:s.hpt&&(i=s.hpt*20),a.write_shift(2,i),a.write_shift(1,0);var l=0;s.level&&(l|=s.level),s.hidden&&(l|=16),(s.hpx||s.hpt)&&(l|=32),a.write_shift(1,l),a.write_shift(1,0);var o=0,d=a.l;a.l+=4;for(var u={r:e,c:0},f=0;f<16;++f)if(!(t.s.c>f+1<<10||t.e.c<f<<10)){for(var p=-1,x=-1,m=f<<10;m<f+1<<10;++m){u.c=m;var b=Array.isArray(r)?(r[u.r]||[])[u.c]:r[bt(u)];b&&(p<0&&(p=m),x=m)}p<0||(++o,a.write_shift(4,p),a.write_shift(4,x))}var v=a.l;return a.l=d,a.write_shift(4,o),a.l=v,a.length>a.l?a.slice(0,a.l):a}function _Ne(e,t,r,a){var s=BNe(a,r,t);(s.length>17||(t["!rows"]||[])[a])&&Qe(e,0,s)}var TNe=ou,FNe=a0;function INe(){}function DNe(e,t){var r={},a=e[e.l];return++e.l,r.above=!(a&64),r.left=!(a&128),e.l+=18,r.name=Rge(e),r}function UNe(e,t,r){r==null&&(r=Re(84+4*e.length));var a=192;t&&(t.above&&(a&=-65),t.left&&(a&=-129)),r.write_shift(1,a);for(var s=1;s<3;++s)r.write_shift(1,0);return Vg({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),VQ(e,r),r.slice(0,r.l)}function MNe(e){var t=ki(e);return[t]}function RNe(e,t,r){return r==null&&(r=Re(8)),su(t,r)}function ONe(e){var t=iu(e);return[t]}function PNe(e,t,r){return r==null&&(r=Re(4)),lu(t,r)}function LNe(e){var t=ki(e),r=e.read_shift(1);return[t,r,"b"]}function QNe(e,t,r){return r==null&&(r=Re(9)),su(t,r),r.write_shift(1,e.v?1:0),r}function HNe(e){var t=iu(e),r=e.read_shift(1);return[t,r,"b"]}function zNe(e,t,r){return r==null&&(r=Re(5)),lu(t,r),r.write_shift(1,e.v?1:0),r}function $Ne(e){var t=ki(e),r=e.read_shift(1);return[t,r,"e"]}function VNe(e,t,r){return r==null&&(r=Re(9)),su(t,r),r.write_shift(1,e.v),r}function GNe(e){var t=iu(e),r=e.read_shift(1);return[t,r,"e"]}function KNe(e,t,r){return r==null&&(r=Re(8)),lu(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}function qNe(e){var t=ki(e),r=e.read_shift(4);return[t,r,"s"]}function WNe(e,t,r){return r==null&&(r=Re(12)),su(t,r),r.write_shift(4,t.v),r}function YNe(e){var t=iu(e),r=e.read_shift(4);return[t,r,"s"]}function XNe(e,t,r){return r==null&&(r=Re(8)),lu(t,r),r.write_shift(4,t.v),r}function JNe(e){var t=ki(e),r=Un(e);return[t,r,"n"]}function ZNe(e,t,r){return r==null&&(r=Re(16)),su(t,r),Kd(e.v,r),r}function Y9(e){var t=iu(e),r=Un(e);return[t,r,"n"]}function eCe(e,t,r){return r==null&&(r=Re(12)),lu(t,r),Kd(e.v,r),r}function tCe(e){var t=ki(e),r=mE(e);return[t,r,"n"]}function rCe(e,t,r){return r==null&&(r=Re(12)),su(t,r),GQ(e.v,r),r}function aCe(e){var t=iu(e),r=mE(e);return[t,r,"n"]}function nCe(e,t,r){return r==null&&(r=Re(8)),lu(t,r),GQ(e.v,r),r}function sCe(e){var t=ki(e),r=pE(e);return[t,r,"is"]}function iCe(e){var t=ki(e),r=Mn(e);return[t,r,"str"]}function lCe(e,t,r){return r==null&&(r=Re(12+4*e.v.length)),su(t,r),Za(e.v,r),r.length>r.l?r.slice(0,r.l):r}function oCe(e){var t=iu(e),r=Mn(e);return[t,r,"str"]}function cCe(e,t,r){return r==null&&(r=Re(8+4*e.v.length)),lu(t,r),Za(e.v,r),r.length>r.l?r.slice(0,r.l):r}function dCe(e,t,r){var a=e.l+t,s=ki(e);s.r=r["!row"];var i=e.read_shift(1),l=[s,i,"b"];if(r.cellFormula){e.l+=2;var o=Av(e,a-e.l,r);l[3]=Tn(o,null,s,r.supbooks,r)}else e.l=a;return l}function uCe(e,t,r){var a=e.l+t,s=ki(e);s.r=r["!row"];var i=e.read_shift(1),l=[s,i,"e"];if(r.cellFormula){e.l+=2;var o=Av(e,a-e.l,r);l[3]=Tn(o,null,s,r.supbooks,r)}else e.l=a;return l}function ACe(e,t,r){var a=e.l+t,s=ki(e);s.r=r["!row"];var i=Un(e),l=[s,i,"n"];if(r.cellFormula){e.l+=2;var o=Av(e,a-e.l,r);l[3]=Tn(o,null,s,r.supbooks,r)}else e.l=a;return l}function fCe(e,t,r){var a=e.l+t,s=ki(e);s.r=r["!row"];var i=Mn(e),l=[s,i,"str"];if(r.cellFormula){e.l+=2;var o=Av(e,a-e.l,r);l[3]=Tn(o,null,s,r.supbooks,r)}else e.l=a;return l}var pCe=ou,hCe=a0;function xCe(e,t){return t==null&&(t=Re(4)),t.write_shift(4,e),t}function mCe(e,t){var r=e.l+t,a=ou(e),s=hE(e),i=Mn(e),l=Mn(e),o=Mn(e);e.l=r;var d={rfx:a,relId:s,loc:i,display:o};return l&&(d.Tooltip=l),d}function gCe(e,t){var r=Re(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));a0({s:Vr(e[0]),e:Vr(e[0])},r),xE("rId"+t,r);var a=e[1].Target.indexOf("#"),s=a==-1?"":e[1].Target.slice(a+1);return Za(s||"",r),Za(e[1].Tooltip||"",r),Za("",r),r.slice(0,r.l)}function bCe(){}function vCe(e,t,r){var a=e.l+t,s=KQ(e),i=e.read_shift(1),l=[s];if(l[2]=i,r.cellFormula){var o=$2e(e,a-e.l,r);l[1]=o}else e.l=a;return l}function yCe(e,t,r){var a=e.l+t,s=ou(e),i=[s];if(r.cellFormula){var l=G2e(e,a-e.l,r);i[1]=l,e.l=a}else e.l=a;return i}function wCe(e,t,r){r==null&&(r=Re(18));var a=fv(e,t);r.write_shift(-4,e),r.write_shift(-4,e),r.write_shift(4,(a.width||10)*256),r.write_shift(4,0);var s=0;return t.hidden&&(s|=1),typeof a.width=="number"&&(s|=2),t.level&&(s|=t.level<<8),r.write_shift(2,s),r}var X9=["left","right","top","bottom","header","footer"];function NCe(e){var t={};return X9.forEach(function(r){t[r]=Un(e)}),t}function CCe(e,t){return t==null&&(t=Re(48)),Id(e),X9.forEach(function(r){Kd(e[r],t)}),t}function kCe(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function jCe(e,t,r){r==null&&(r=Re(30));var a=924;return(((t||{}).Views||[])[0]||{}).RTL&&(a|=32),r.write_shift(2,a),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(2,0),r.write_shift(2,100),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(4,0),r}function ECe(e){var t=Re(24);return t.write_shift(4,4),t.write_shift(4,1),a0(e,t),t}function SCe(e,t){return t==null&&(t=Re(66)),t.write_shift(2,e.password?NE(e.password):0),t.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(r){r[1]?t.write_shift(4,e[r[0]]!=null&&!e[r[0]]?1:0):t.write_shift(4,e[r[0]]!=null&&e[r[0]]?0:1)}),t}function BCe(){}function _Ce(){}function TCe(e,t,r,a,s,i,l){if(!e)return e;var o=t||{};a||(a={"!id":{}});var d=o.dense?[]:{},u,f={s:{r:2e6,c:2e6},e:{r:0,c:0}},p=!1,x=!1,m,b,v,y,k,_,C,E,T,B=[];o.biff=12,o["!row"]=0;var I=0,M=!1,U=[],D={},L=o.supbooks||s.supbooks||[[]];if(L.sharedf=D,L.arrayf=U,L.SheetNames=s.SheetNames||s.Sheets.map(function(Z){return Z.name}),!o.supbooks&&(o.supbooks=L,s.Names))for(var R=0;R<s.Names.length;++R)L[0][R+1]=s.Names[R];var Q=[],G=[],K=!1;Np[16]={n:"BrtShortReal",f:Y9};var W;if(Ro(e,function(Y,te,O){if(!x)switch(O){case 148:u=Y;break;case 0:m=Y,o.sheetRows&&o.sheetRows<=m.r&&(x=!0),E=pa(y=m.r),o["!row"]=m.r,(Y.hidden||Y.hpt||Y.level!=null)&&(Y.hpt&&(Y.hpx=UA(Y.hpt)),G[Y.r]=Y);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(b={t:Y[2]},Y[2]){case"n":b.v=Y[1];break;case"s":C=Uf[Y[1]],b.v=C.t,b.r=C.r;break;case"b":b.v=!!Y[1];break;case"e":b.v=Y[1],o.cellText!==!1&&(b.w=Oo[b.v]);break;case"str":b.t="s",b.v=Y[1];break;case"is":b.t="s",b.v=Y[1].t;break}if((v=l.CellXf[Y[0].iStyleRef])&&K9(b,v.numFmtId,null,o,i,l),k=Y[0].c==-1?k+1:Y[0].c,o.dense?(d[y]||(d[y]=[]),d[y][k]=b):d[$r(k)+E]=b,o.cellFormula){for(M=!1,I=0;I<U.length;++I){var P=U[I];m.r>=P[0].s.r&&m.r<=P[0].e.r&&k>=P[0].s.c&&k<=P[0].e.c&&(b.F=St(P[0]),M=!0)}!M&&Y.length>3&&(b.f=Y[3])}if(f.s.r>m.r&&(f.s.r=m.r),f.s.c>k&&(f.s.c=k),f.e.r<m.r&&(f.e.r=m.r),f.e.c<k&&(f.e.c=k),o.cellDates&&v&&b.t=="n"&&e0(gt[v.numFmtId])){var q=Cd(b.v);q&&(b.t="d",b.v=new Date(q.y,q.m-1,q.d,q.H,q.M,q.S,q.u))}W&&(W.type=="XLDAPR"&&(b.D=!0),W=void 0);break;case 1:case 12:if(!o.sheetStubs||p)break;b={t:"z",v:void 0},k=Y[0].c==-1?k+1:Y[0].c,o.dense?(d[y]||(d[y]=[]),d[y][k]=b):d[$r(k)+E]=b,f.s.r>m.r&&(f.s.r=m.r),f.s.c>k&&(f.s.c=k),f.e.r<m.r&&(f.e.r=m.r),f.e.c<k&&(f.e.c=k),W&&(W.type=="XLDAPR"&&(b.D=!0),W=void 0);break;case 176:B.push(Y);break;case 49:W=((o.xlmeta||{}).Cell||[])[Y-1];break;case 494:var H=a["!id"][Y.relId];for(H?(Y.Target=H.Target,Y.loc&&(Y.Target+="#"+Y.loc),Y.Rel=H):Y.relId==""&&(Y.Target="#"+Y.loc),y=Y.rfx.s.r;y<=Y.rfx.e.r;++y)for(k=Y.rfx.s.c;k<=Y.rfx.e.c;++k)o.dense?(d[y]||(d[y]=[]),d[y][k]||(d[y][k]={t:"z",v:void 0}),d[y][k].l=Y):(_=bt({c:k,r:y}),d[_]||(d[_]={t:"z",v:void 0}),d[_].l=Y);break;case 426:if(!o.cellFormula)break;U.push(Y),T=o.dense?d[y][k]:d[$r(k)+E],T.f=Tn(Y[1],f,{r:m.r,c:k},L,o),T.F=St(Y[0]);break;case 427:if(!o.cellFormula)break;D[bt(Y[0].s)]=Y[1],T=o.dense?d[y][k]:d[$r(k)+E],T.f=Tn(Y[1],f,{r:m.r,c:k},L,o);break;case 60:if(!o.cellStyles)break;for(;Y.e>=Y.s;)Q[Y.e--]={width:Y.w/256,hidden:!!(Y.flags&1),level:Y.level},K||(K=!0,CE(Y.w/256)),Dc(Q[Y.e+1]);break;case 161:d["!autofilter"]={ref:St(Y)};break;case 476:d["!margins"]=Y;break;case 147:s.Sheets[r]||(s.Sheets[r]={}),Y.name&&(s.Sheets[r].CodeName=Y.name),(Y.above||Y.left)&&(d["!outline"]={above:Y.above,left:Y.left});break;case 137:s.Views||(s.Views=[{}]),s.Views[0]||(s.Views[0]={}),Y.RTL&&(s.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:p=!0;break;case 36:p=!1;break;case 37:p=!0;break;case 38:p=!1;break;default:if(!te.T){if(!p||o.WTF)throw new Error("Unexpected record 0x"+O.toString(16))}}},o),delete o.supbooks,delete o["!row"],!d["!ref"]&&(f.s.r<2e6||u&&(u.e.r>0||u.e.c>0||u.s.r>0||u.s.c>0))&&(d["!ref"]=St(u||f)),o.sheetRows&&d["!ref"]){var z=Kt(d["!ref"]);o.sheetRows<=+z.e.r&&(z.e.r=o.sheetRows-1,z.e.r>f.e.r&&(z.e.r=f.e.r),z.e.r<z.s.r&&(z.s.r=z.e.r),z.e.c>f.e.c&&(z.e.c=f.e.c),z.e.c<z.s.c&&(z.s.c=z.e.c),d["!fullref"]=d["!ref"],d["!ref"]=St(z))}return B.length>0&&(d["!merges"]=B),Q.length>0&&(d["!cols"]=Q),G.length>0&&(d["!rows"]=G),d}function FCe(e,t,r,a,s,i,l){if(t.v===void 0)return!1;var o="";switch(t.t){case"b":o=t.v?"1":"0";break;case"d":t=Tr(t),t.z=t.z||gt[14],t.v=Qa(_r(t.v)),t.t="n";break;case"n":case"e":o=""+t.v;break;default:o=t.v;break}var d={r,c:a};switch(d.s=Kc(s.cellXfs,t,s),t.l&&i["!links"].push([bt(d),t.l]),t.c&&i["!comments"].push([bt(d),t.c]),t.t){case"s":case"str":return s.bookSST?(o=BE(s.Strings,t.v,s.revStrings),d.t="s",d.v=o,l?Qe(e,18,XNe(t,d)):Qe(e,7,WNe(t,d))):(d.t="str",l?Qe(e,17,cCe(t,d)):Qe(e,6,lCe(t,d))),!0;case"n":return t.v==(t.v|0)&&t.v>-1e3&&t.v<1e3?l?Qe(e,13,nCe(t,d)):Qe(e,2,rCe(t,d)):l?Qe(e,16,eCe(t,d)):Qe(e,5,ZNe(t,d)),!0;case"b":return d.t="b",l?Qe(e,15,zNe(t,d)):Qe(e,4,QNe(t,d)),!0;case"e":return d.t="e",l?Qe(e,14,KNe(t,d)):Qe(e,3,VNe(t,d)),!0}return l?Qe(e,12,PNe(t,d)):Qe(e,1,RNe(t,d)),!0}function ICe(e,t,r,a){var s=Kt(t["!ref"]||"A1"),i,l="",o=[];Qe(e,145);var d=Array.isArray(t),u=s.e.r;t["!rows"]&&(u=Math.max(s.e.r,t["!rows"].length-1));for(var f=s.s.r;f<=u;++f){l=pa(f),_Ne(e,t,s,f);var p=!1;if(f<=s.e.r)for(var x=s.s.c;x<=s.e.c;++x){f===s.s.r&&(o[x]=$r(x)),i=o[x]+l;var m=d?(t[f]||[])[x]:t[i];if(!m){p=!1;continue}p=FCe(e,m,f,x,a,t,p)}}Qe(e,146)}function DCe(e,t){!t||!t["!merges"]||(Qe(e,177,xCe(t["!merges"].length)),t["!merges"].forEach(function(r){Qe(e,176,hCe(r))}),Qe(e,178))}function UCe(e,t){!t||!t["!cols"]||(Qe(e,390),t["!cols"].forEach(function(r,a){r&&Qe(e,60,wCe(a,r))}),Qe(e,391))}function MCe(e,t){!t||!t["!ref"]||(Qe(e,648),Qe(e,649,ECe(Kt(t["!ref"]))),Qe(e,650))}function RCe(e,t,r){t["!links"].forEach(function(a){if(a[1].Target){var s=lr(r,-1,a[1].Target.replace(/#.*$/,""),Ut.HLINK);Qe(e,494,gCe(a,s))}}),delete t["!links"]}function OCe(e,t,r,a){if(t["!comments"].length>0){var s=lr(a,-1,"../drawings/vmlDrawing"+(r+1)+".vml",Ut.VML);Qe(e,551,xE("rId"+s)),t["!legacy"]=s}}function PCe(e,t,r,a){if(t["!autofilter"]){var s=t["!autofilter"],i=typeof s.ref=="string"?s.ref:St(s.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var l=r.Workbook.Names,o=xs(i);o.s.r==o.e.r&&(o.e.r=xs(t["!ref"]).e.r,i=St(o));for(var d=0;d<l.length;++d){var u=l[d];if(u.Name=="_xlnm._FilterDatabase"&&u.Sheet==a){u.Ref="'"+r.SheetNames[a]+"'!"+i;break}}d==l.length&&l.push({Name:"_xlnm._FilterDatabase",Sheet:a,Ref:"'"+r.SheetNames[a]+"'!"+i}),Qe(e,161,a0(Kt(i))),Qe(e,162)}}function LCe(e,t,r){Qe(e,133),Qe(e,137,jCe(t,r)),Qe(e,138),Qe(e,134)}function QCe(e,t){t["!protect"]&&Qe(e,535,SCe(t["!protect"]))}function HCe(e,t,r,a){var s=As(),i=r.SheetNames[e],l=r.Sheets[i]||{},o=i;try{r&&r.Workbook&&(o=r.Workbook.Sheets[e].CodeName||o)}catch{}var d=Kt(l["!ref"]||"A1");if(d.e.c>16383||d.e.r>1048575){if(t.WTF)throw new Error("Range "+(l["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");d.e.c=Math.min(d.e.c,16383),d.e.r=Math.min(d.e.c,1048575)}return l["!links"]=[],l["!comments"]=[],Qe(s,129),(r.vbaraw||l["!outline"])&&Qe(s,147,UNe(o,l["!outline"])),Qe(s,148,FNe(d)),LCe(s,l,r.Workbook),UCe(s,l),ICe(s,l,e,t),QCe(s,l),PCe(s,l,r,e),DCe(s,l),RCe(s,l,a),l["!margins"]&&Qe(s,476,CCe(l["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&MCe(s,l),OCe(s,l,e,a),Qe(s,130),s.end()}function zCe(e){var t=[],r=e.match(/^<c:numCache>/),a;(e.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(i){var l=i.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);l&&(t[+l[1]]=r?+l[2]:l[2])});var s=Gt((e.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(e.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(i){a=i.replace(/<.*?>/g,"")}),[t,s,a]}function $Ce(e,t,r,a,s,i){var l=i||{"!type":"chart"};if(!e)return i;var o=0,d=0,u="A",f={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(e.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(p){var x=zCe(p);f.s.r=f.s.c=0,f.e.c=o,u=$r(o),x[0].forEach(function(m,b){l[u+pa(b)]={t:"n",v:m,z:x[1]},d=b}),f.e.r<d&&(f.e.r=d),++o}),o>0&&(l["!ref"]=St(f)),l}function VCe(e,t,r,a,s){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},l,o=e.match(q9);return o&&_E(o[0],i,s,r),(l=e.match(/drawing r:id="(.*?)"/))&&(i["!rel"]=l[1]),a["!id"][i["!rel"]]&&(i["!drawel"]=a["!id"][i["!rel"]]),i}function GCe(e,t){e.l+=10;var r=Mn(e);return{name:r}}function KCe(e,t,r,a,s){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},l=!1;return Ro(e,function(d,u,f){switch(f){case 550:i["!rel"]=d;break;case 651:s.Sheets[r]||(s.Sheets[r]={}),d.name&&(s.Sheets[r].CodeName=d.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:l=!0;break;case 36:l=!1;break;case 37:break;case 38:break;default:if(!(u.T>0)){if(!(u.T<0)){if(!l||t.WTF)throw new Error("Unexpected record 0x"+f.toString(16))}}}},t),a["!id"][i["!rel"]]&&(i["!drawel"]=a["!id"][i["!rel"]]),i}var TE=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],qCe=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],WCe=[],YCe=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function aU(e,t){for(var r=0;r!=e.length;++r)for(var a=e[r],s=0;s!=t.length;++s){var i=t[s];if(a[i[0]]==null)a[i[0]]=i[1];else switch(i[2]){case"bool":typeof a[i[0]]=="string"&&(a[i[0]]=Br(a[i[0]]));break;case"int":typeof a[i[0]]=="string"&&(a[i[0]]=parseInt(a[i[0]],10));break}}}function nU(e,t){for(var r=0;r!=t.length;++r){var a=t[r];if(e[a[0]]==null)e[a[0]]=a[1];else switch(a[2]){case"bool":typeof e[a[0]]=="string"&&(e[a[0]]=Br(e[a[0]]));break;case"int":typeof e[a[0]]=="string"&&(e[a[0]]=parseInt(e[a[0]],10));break}}}function J9(e){nU(e.WBProps,TE),nU(e.CalcPr,YCe),aU(e.WBView,qCe),aU(e.Sheets,WCe),NA.date1904=Br(e.WBProps.date1904)}function XCe(e){return!e.Workbook||!e.Workbook.WBProps?"false":Br(e.Workbook.WBProps.date1904)?"true":"false"}var JCe="][*?/\\".split("");function Z9(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return JCe.forEach(function(a){if(e.indexOf(a)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}function ZCe(e,t,r){e.forEach(function(a,s){Z9(a);for(var i=0;i<s;++i)if(a==e[i])throw new Error("Duplicate Sheet Name: "+a);if(r){var l=t&&t[s]&&t[s].CodeName||a;if(l.charCodeAt(0)==95&&l.length>22)throw new Error("Bad Code Name: Worksheet"+l)}})}function eke(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var t=e.Workbook&&e.Workbook.Sheets||[];ZCe(e.SheetNames,t,!!e.vbaraw);for(var r=0;r<e.SheetNames.length;++r)X2e(e.Sheets[e.SheetNames[r]],e.SheetNames[r],r)}var tke=/<\w+:workbook/;function rke(e,t){if(!e)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},a=!1,s="xmlns",i={},l=0;if(e.replace(Pn,function(d,u){var f=vt(d);switch(_l(f[0])){case"<?xml":break;case"<workbook":d.match(tke)&&(s="xmlns"+d.match(/<(\w+):/)[1]),r.xmlns=f[s];break;case"</workbook>":break;case"<fileVersion":delete f[0],r.AppVersion=f;break;case"<fileVersion/>":case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":TE.forEach(function(p){if(f[p[0]]!=null)switch(p[2]){case"bool":r.WBProps[p[0]]=Br(f[p[0]]);break;case"int":r.WBProps[p[0]]=parseInt(f[p[0]],10);break;default:r.WBProps[p[0]]=f[p[0]]}}),f.codeName&&(r.WBProps.CodeName=hr(f.codeName));break;case"</workbookPr>":break;case"<workbookProtection":break;case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete f[0],r.WBView.push(f);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(f.state){case"hidden":f.Hidden=1;break;case"veryHidden":f.Hidden=2;break;default:f.Hidden=0}delete f.state,f.name=Gt(hr(f.name)),delete f[0],r.Sheets.push(f);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":break;case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":break;case"<externalReference":break;case"<definedNames/>":break;case"<definedNames>":case"<definedNames":a=!0;break;case"</definedNames>":a=!1;break;case"<definedName":i={},i.Name=hr(f.name),f.comment&&(i.Comment=f.comment),f.localSheetId&&(i.Sheet=+f.localSheetId),Br(f.hidden||"0")&&(i.Hidden=!0),l=u+d.length;break;case"</definedName>":i.Ref=Gt(hr(e.slice(l,u))),r.Names.push(i);break;case"<definedName/>":break;case"<calcPr":delete f[0],r.CalcPr=f;break;case"<calcPr/>":delete f[0],r.CalcPr=f;break;case"</calcPr>":break;case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":break;case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":break;case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":break;case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":a=!0;break;case"</AlternateContent>":a=!1;break;case"<revisionPtr":break;default:if(!a&&t.WTF)throw new Error("unrecognized "+f[0]+" in workbook")}return d}),nu.indexOf(r.xmlns)===-1)throw new Error("Unknown Namespace: "+r.xmlns);return J9(r),r}function eH(e){var t=[xa];t[t.length]=Ke("workbook",null,{xmlns:nu[0],"xmlns:r":Pa.r});var r=e.Workbook&&(e.Workbook.Names||[]).length>0,a={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(TE.forEach(function(o){e.Workbook.WBProps[o[0]]!=null&&e.Workbook.WBProps[o[0]]!=o[1]&&(a[o[0]]=e.Workbook.WBProps[o[0]])}),e.Workbook.WBProps.CodeName&&(a.codeName=e.Workbook.WBProps.CodeName,delete a.CodeName)),t[t.length]=Ke("workbookPr",null,a);var s=e.Workbook&&e.Workbook.Sheets||[],i=0;if(s&&s[0]&&s[0].Hidden){for(t[t.length]="<bookViews>",i=0;i!=e.SheetNames.length&&!(!s[i]||!s[i].Hidden);++i);i==e.SheetNames.length&&(i=0),t[t.length]='<workbookView firstSheet="'+i+'" activeTab="'+i+'"/>',t[t.length]="</bookViews>"}for(t[t.length]="<sheets>",i=0;i!=e.SheetNames.length;++i){var l={name:cr(e.SheetNames[i].slice(0,31))};if(l.sheetId=""+(i+1),l["r:id"]="rId"+(i+1),s[i])switch(s[i].Hidden){case 1:l.state="hidden";break;case 2:l.state="veryHidden";break}t[t.length]=Ke("sheet",null,l)}return t[t.length]="</sheets>",r&&(t[t.length]="<definedNames>",e.Workbook&&e.Workbook.Names&&e.Workbook.Names.forEach(function(o){var d={name:o.Name};o.Comment&&(d.comment=o.Comment),o.Sheet!=null&&(d.localSheetId=""+o.Sheet),o.Hidden&&(d.hidden="1"),o.Ref&&(t[t.length]=Ke("definedName",cr(o.Ref),d))}),t[t.length]="</definedNames>"),t.length>2&&(t[t.length]="</workbook>",t[1]=t[1].replace("/>",">")),t.join("")}function ake(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=bC(e),r.name=Mn(e),r}function nke(e,t){return t||(t=Re(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),xE(e.strRelID,t),Za(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function ske(e,t){var r={},a=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var s=t>8?Mn(e):"";return s.length>0&&(r.CodeName=s),r.autoCompressPictures=!!(a&65536),r.backupFile=!!(a&64),r.checkCompatibility=!!(a&4096),r.date1904=!!(a&1),r.filterPrivacy=!!(a&8),r.hidePivotFieldList=!!(a&1024),r.promptedSolutions=!!(a&16),r.publishItems=!!(a&2048),r.refreshAllConnections=!!(a&262144),r.saveExternalLinkValues=!!(a&128),r.showBorderUnselectedTables=!!(a&4),r.showInkAnnotation=!!(a&32),r.showObjects=["all","placeholders","none"][a>>13&3],r.showPivotChartFilter=!!(a&32768),r.updateLinks=["userSet","never","always"][a>>8&3],r}function ike(e,t){t||(t=Re(72));var r=0;return e&&e.filterPrivacy&&(r|=8),t.write_shift(4,r),t.write_shift(4,0),VQ(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}function lke(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function oke(e,t,r){var a=e.l+t;e.l+=4,e.l+=1;var s=e.read_shift(4),i=Oge(e),l=V2e(e,0,r),o=hE(e);e.l=a;var d={Name:i,Ptg:l};return s<268435455&&(d.Sheet=s),o&&(d.Comment=o),d}function cke(e,t){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},a=[],s=!1;t||(t={}),t.biff=12;var i=[],l=[[]];return l.SheetNames=[],l.XTI=[],Np[16]={n:"BrtFRTArchID$",f:lke},Ro(e,function(d,u,f){switch(f){case 156:l.SheetNames.push(d.name),r.Sheets.push(d);break;case 153:r.WBProps=d;break;case 39:d.Sheet!=null&&(t.SID=d.Sheet),d.Ref=Tn(d.Ptg,null,null,l,t),delete t.SID,delete d.Ptg,i.push(d);break;case 1036:break;case 357:case 358:case 355:case 667:l[0].length?l.push([f,d]):l[0]=[f,d],l[l.length-1].XTI=[];break;case 362:l.length===0&&(l[0]=[],l[0].XTI=[]),l[l.length-1].XTI=l[l.length-1].XTI.concat(d),l.XTI=l.XTI.concat(d);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:a.push(f),s=!0;break;case 36:a.pop(),s=!1;break;case 37:a.push(f),s=!0;break;case 38:a.pop(),s=!1;break;case 16:break;default:if(!u.T){if(!s||t.WTF&&a[a.length-1]!=37&&a[a.length-1]!=35)throw new Error("Unexpected record 0x"+f.toString(16))}}},t),J9(r),r.Names=i,r.supbooks=l,r}function dke(e,t){Qe(e,143);for(var r=0;r!=t.SheetNames.length;++r){var a=t.Workbook&&t.Workbook.Sheets&&t.Workbook.Sheets[r]&&t.Workbook.Sheets[r].Hidden||0,s={Hidden:a,iTabID:r+1,strRelID:"rId"+(r+1),name:t.SheetNames[r]};Qe(e,156,nke(s))}Qe(e,144)}function uke(e,t){t||(t=Re(127));for(var r=0;r!=4;++r)t.write_shift(4,0);return Za("SheetJS",t),Za(Og.version,t),Za(Og.version,t),Za("7262",t),t.length>t.l?t.slice(0,t.l):t}function Ake(e,t){t||(t=Re(29)),t.write_shift(-4,0),t.write_shift(-4,460),t.write_shift(4,28800),t.write_shift(4,17600),t.write_shift(4,500),t.write_shift(4,e),t.write_shift(4,e);var r=120;return t.write_shift(1,r),t.length>t.l?t.slice(0,t.l):t}function fke(e,t){if(!(!t.Workbook||!t.Workbook.Sheets)){for(var r=t.Workbook.Sheets,a=0,s=-1,i=-1;a<r.length;++a)!r[a]||!r[a].Hidden&&s==-1?s=a:r[a].Hidden==1&&i==-1&&(i=a);i>s||(Qe(e,135),Qe(e,158,Ake(s)),Qe(e,136))}}function pke(e,t){var r=As();return Qe(r,131),Qe(r,128,uke()),Qe(r,153,ike(e.Workbook&&e.Workbook.WBProps||null)),fke(r,e),dke(r,e),Qe(r,132),r.end()}function hke(e,t,r){return t.slice(-4)===".bin"?cke(e,r):rke(e,r)}function xke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?TCe(e,a,r,s,i,l,o):oNe(e,a,r,s,i,l,o)}function mke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?KCe(e,a,r,s,i):VCe(e,a,r,s,i)}function gke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?vwe():ywe()}function bke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?gwe():bwe()}function vke(e,t,r,a){return t.slice(-4)===".bin"?hye(e,r,a):aye(e,r,a)}function yke(e,t,r){return D9(e,r)}function wke(e,t,r){return t.slice(-4)===".bin"?w1e(e,r):b1e(e,r)}function Nke(e,t,r){return t.slice(-4)===".bin"?fwe(e,r):nwe(e,r)}function Cke(e,t,r){return t.slice(-4)===".bin"?twe(e):Zye(e)}function kke(e,t,r,a){return r.slice(-4)===".bin"?rwe(e,t,r,a):void 0}function jke(e,t,r){return t.slice(-4)===".bin"?Yye(e,t,r):Jye(e,t,r)}function Eke(e,t,r){return(t.slice(-4)===".bin"?pke:eH)(e)}function Ske(e,t,r,a,s){return(t.slice(-4)===".bin"?HCe:W9)(e,r,a,s)}function Bke(e,t,r){return(t.slice(-4)===".bin"?kye:F9)(e,r)}function _ke(e,t,r){return(t.slice(-4)===".bin"?k1e:C9)(e,r)}function Tke(e,t,r){return(t.slice(-4)===".bin"?pwe:R9)(e)}function Fke(e){return(e.slice(-4)===".bin"?Xye:U9)()}var tH=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,rH=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function Ti(e,t){var r=e.split(/\s+/),a=[];if(a[0]=r[0],r.length===1)return a;var s=e.match(tH),i,l,o,d;if(s)for(d=0;d!=s.length;++d)i=s[d].match(rH),(l=i[1].indexOf(":"))===-1?a[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?o="xmlns"+i[1].slice(6):o=i[1].slice(l+1),a[o]=i[2].slice(1,i[2].length-1));return a}function Ike(e){var t=e.split(/\s+/),r={};if(t.length===1)return r;var a=e.match(tH),s,i,l,o;if(a)for(o=0;o!=a.length;++o)s=a[o].match(rH),(i=s[1].indexOf(":"))===-1?r[s[1]]=s[2].slice(1,s[2].length-1):(s[1].slice(0,6)==="xmlns:"?l="xmlns"+s[1].slice(6):l=s[1].slice(i+1),r[l]=s[2].slice(1,s[2].length-1));return r}var Rf;function Dke(e,t){var r=Rf[e]||Gt(e);return r==="General"?Vd(t):Ni(r,t)}function Uke(e,t,r,a){var s=a;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":s=Br(a);break;case"i2":case"int":s=parseInt(a,10);break;case"r4":case"float":s=parseFloat(a);break;case"date":case"dateTime.tz":s=_r(a);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}e[Gt(t)]=s}function Mke(e,t,r){if(e.t!=="z"){if(!r||r.cellText!==!1)try{e.t==="e"?e.w=e.w||Oo[e.v]:t==="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=pp(e.v):e.w=Vd(e.v):e.w=Dke(t||"General",e.v)}catch(i){if(r.WTF)throw i}try{var a=Rf[t]||t||"General";if(r.cellNF&&(e.z=a),r.cellDates&&e.t=="n"&&e0(a)){var s=Cd(e.v);s&&(e.t="d",e.v=new Date(s.y,s.m-1,s.d,s.H,s.M,s.S,s.u))}}catch(i){if(r.WTF)throw i}}}function Rke(e,t,r){if(r.cellStyles&&t.Interior){var a=t.Interior;a.Pattern&&(a.patternType=W1e[a.Pattern]||a.Pattern)}e[t.ID]=t}function Oke(e,t,r,a,s,i,l,o,d,u){var f="General",p=a.StyleID,x={};u=u||{};var m=[],b=0;for(p===void 0&&o&&(p=o.StyleID),p===void 0&&l&&(p=l.StyleID);i[p]!==void 0&&(i[p].nf&&(f=i[p].nf),i[p].Interior&&m.push(i[p].Interior),!!i[p].Parent);)p=i[p].Parent;switch(r.Type){case"Boolean":a.t="b",a.v=Br(e);break;case"String":a.t="s",a.r=yD(Gt(e)),a.v=e.indexOf("<")>-1?Gt(t||e).replace(/<.*?>/g,""):a.r;break;case"DateTime":e.slice(-1)!="Z"&&(e+="Z"),a.v=(_r(e)-new Date(Date.UTC(1899,11,30)))/(1440*60*1e3),a.v!==a.v?a.v=Gt(e):a.v<60&&(a.v=a.v-1),(!f||f=="General")&&(f="yyyy-mm-dd");case"Number":a.v===void 0&&(a.v=+e),a.t||(a.t="n");break;case"Error":a.t="e",a.v=YQ[e],u.cellText!==!1&&(a.w=e);break;default:e==""&&t==""?a.t="z":(a.t="s",a.v=yD(t||e));break}if(Mke(a,f,u),u.cellFormula!==!1)if(a.Formula){var v=Gt(a.Formula);v.charCodeAt(0)==61&&(v=v.slice(1)),a.f=wA(v,s),delete a.Formula,a.ArrayRange=="RC"?a.F=wA("RC:RC",s):a.ArrayRange&&(a.F=wA(a.ArrayRange,s),d.push([Kt(a.F),a.F]))}else for(b=0;b<d.length;++b)s.r>=d[b][0].s.r&&s.r<=d[b][0].e.r&&s.c>=d[b][0].s.c&&s.c<=d[b][0].e.c&&(a.F=d[b][1]);u.cellStyles&&(m.forEach(function(y){!x.patternType&&y.patternType&&(x.patternType=y.patternType)}),a.s=x),a.StyleID!==void 0&&(a.ixfe=a.StyleID)}function Pke(e){e.t=e.v||"",e.t=e.t.replace(/\r\n/g,`
`).replace(/\r/g,`
`),e.v=e.w=e.ixfe=void 0}function F2(e,t){var r=t||{};t0();var a=vf(cE(e));(r.type=="binary"||r.type=="array"||r.type=="base64")&&(a=hr(a));var s=a.slice(0,1024).toLowerCase(),i=!1;if(s=s.replace(/".*?"/g,""),(s.indexOf(">")&1023)>Math.min(s.indexOf(",")&1023,s.indexOf(";")&1023)){var l=Tr(r);return l.type="string",DA.to_workbook(a,l)}if(s.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(Xe){s.indexOf("<"+Xe)>=0&&(i=!0)}),i)return Cje(a,r);Rf={"General Number":"General","General Date":gt[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":gt[15],"Short Date":gt[14],"Long Time":gt[19],"Medium Time":gt[18],"Short Time":gt[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:gt[2],Standard:gt[4],Percent:gt[10],Scientific:gt[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var o,d=[],u,f={},p=[],x=r.dense?[]:{},m="",b={},v={},y=Ti('<Data ss:Type="String">'),k=0,_=0,C=0,E={s:{r:2e6,c:2e6},e:{r:0,c:0}},T={},B={},I="",M=0,U=[],D={},L={},R=0,Q=[],G=[],K={},W=[],z,Z=!1,Y=[],te=[],O={},P=0,q=0,H={Sheets:[],WBProps:{date1904:!1}},J={};mp.lastIndex=0,a=a.replace(/<!--([\s\S]*?)-->/mg,"");for(var ae="";o=mp.exec(a);)switch(o[3]=(ae=o[3]).toLowerCase()){case"data":if(ae=="data"){if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&d.push([o[3],!0]);break}if(d[d.length-1][1])break;o[1]==="/"?Oke(a.slice(k,o.index),I,y,d[d.length-1][0]=="comment"?K:b,{c:_,r:C},T,W[_],v,Y,r):(I="",y=Ti(o[0]),k=o.index+o[0].length);break;case"cell":if(o[1]==="/")if(G.length>0&&(b.c=G),(!r.sheetRows||r.sheetRows>C)&&b.v!==void 0&&(r.dense?(x[C]||(x[C]=[]),x[C][_]=b):x[$r(_)+pa(C)]=b),b.HRef&&(b.l={Target:Gt(b.HRef)},b.HRefScreenTip&&(b.l.Tooltip=b.HRefScreenTip),delete b.HRef,delete b.HRefScreenTip),(b.MergeAcross||b.MergeDown)&&(P=_+(parseInt(b.MergeAcross,10)|0),q=C+(parseInt(b.MergeDown,10)|0),U.push({s:{c:_,r:C},e:{c:P,r:q}})),!r.sheetStubs)b.MergeAcross?_=P+1:++_;else if(b.MergeAcross||b.MergeDown){for(var oe=_;oe<=P;++oe)for(var ce=C;ce<=q;++ce)(oe>_||ce>C)&&(r.dense?(x[ce]||(x[ce]=[]),x[ce][oe]={t:"z"}):x[$r(oe)+pa(ce)]={t:"z"});_=P+1}else++_;else b=Ike(o[0]),b.Index&&(_=+b.Index-1),_<E.s.c&&(E.s.c=_),_>E.e.c&&(E.e.c=_),o[0].slice(-2)==="/>"&&++_,G=[];break;case"row":o[1]==="/"||o[0].slice(-2)==="/>"?(C<E.s.r&&(E.s.r=C),C>E.e.r&&(E.e.r=C),o[0].slice(-2)==="/>"&&(v=Ti(o[0]),v.Index&&(C=+v.Index-1)),_=0,++C):(v=Ti(o[0]),v.Index&&(C=+v.Index-1),O={},(v.AutoFitHeight=="0"||v.Height)&&(O.hpx=parseInt(v.Height,10),O.hpt=wp(O.hpx),te[C]=O),v.Hidden=="1"&&(O.hidden=!0,te[C]=O));break;case"worksheet":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"));p.push(m),E.s.r<=E.e.r&&E.s.c<=E.e.c&&(x["!ref"]=St(E),r.sheetRows&&r.sheetRows<=E.e.r&&(x["!fullref"]=x["!ref"],E.e.r=r.sheetRows-1,x["!ref"]=St(E))),U.length&&(x["!merges"]=U),W.length>0&&(x["!cols"]=W),te.length>0&&(x["!rows"]=te),f[m]=x}else E={s:{r:2e6,c:2e6},e:{r:0,c:0}},C=_=0,d.push([o[3],!1]),u=Ti(o[0]),m=Gt(u.Name),x=r.dense?[]:{},U=[],Y=[],te=[],J={name:m,Hidden:0},H.Sheets.push(J);break;case"table":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else{if(o[0].slice(-2)=="/>")break;d.push([o[3],!1]),W=[],Z=!1}break;case"style":o[1]==="/"?Rke(T,B,r):B=Ti(o[0]);break;case"numberformat":B.nf=Gt(Ti(o[0]).Format||"General"),Rf[B.nf]&&(B.nf=Rf[B.nf]);for(var ne=0;ne!=392&&gt[ne]!=B.nf;++ne);if(ne==392){for(ne=57;ne!=392;++ne)if(gt[ne]==null){uo(B.nf,ne);break}}break;case"column":if(d[d.length-1][0]!=="table")break;if(z=Ti(o[0]),z.Hidden&&(z.hidden=!0,delete z.Hidden),z.Width&&(z.wpx=parseInt(z.Width,10)),!Z&&z.wpx>10){Z=!0,Dn=_9;for(var le=0;le<W.length;++le)W[le]&&Dc(W[le])}Z&&Dc(z),W[z.Index-1||W.length]=z;for(var ge=0;ge<+z.Span;++ge)W[W.length]=Tr(z);break;case"namedrange":if(o[1]==="/")break;H.Names||(H.Names=[]);var X=vt(o[0]),pe={Name:X.Name,Ref:wA(X.RefersTo.slice(1),{r:0,c:0})};H.Sheets.length>0&&(pe.Sheet=H.Sheets.length-1),H.Names.push(pe);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(o[0].slice(-2)==="/>")break;o[1]==="/"?I+=a.slice(M,o.index):M=o.index+o[0].length;break;case"interior":if(!r.cellStyles)break;B.Interior=Ti(o[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(o[0].slice(-2)==="/>")break;o[1]==="/"?cbe(D,ae,a.slice(R,o.index)):R=o.index+o[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else d.push([o[3],!1]);break;case"comment":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"));Pke(K),G.push(K)}else d.push([o[3],!1]),u=Ti(o[0]),K={a:u.Author};break;case"autofilter":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else if(o[0].charAt(o[0].length-2)!=="/"){var be=Ti(o[0]);x["!autofilter"]={ref:wA(be.Range).replace(/\$/g,"")},d.push([o[3],!0])}break;case"name":break;case"datavalidation":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&d.push([o[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&d.push([o[3],!0]);break;case"null":break;default:if(d.length==0&&o[3]=="document"||d.length==0&&o[3]=="uof")return cU(a,r);var me=!0;switch(d[d.length-1][0]){case"officedocumentsettings":switch(o[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:me=!1}break;case"componentoptions":switch(o[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:me=!1}break;case"excelworkbook":switch(o[3]){case"date1904":H.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:me=!1}break;case"workbookoptions":switch(o[3]){case"owcversion":break;case"height":break;case"width":break;default:me=!1}break;case"worksheetoptions":switch(o[3]){case"visible":if(o[0].slice(-2)!=="/>")if(o[1]==="/")switch(a.slice(R,o.index)){case"SheetHidden":J.Hidden=1;break;case"SheetVeryHidden":J.Hidden=2;break}else R=o.index+o[0].length;break;case"header":x["!margins"]||Id(x["!margins"]={},"xlml"),isNaN(+vt(o[0]).Margin)||(x["!margins"].header=+vt(o[0]).Margin);break;case"footer":x["!margins"]||Id(x["!margins"]={},"xlml"),isNaN(+vt(o[0]).Margin)||(x["!margins"].footer=+vt(o[0]).Margin);break;case"pagemargins":var _e=vt(o[0]);x["!margins"]||Id(x["!margins"]={},"xlml"),isNaN(+_e.Top)||(x["!margins"].top=+_e.Top),isNaN(+_e.Left)||(x["!margins"].left=+_e.Left),isNaN(+_e.Right)||(x["!margins"].right=+_e.Right),isNaN(+_e.Bottom)||(x["!margins"].bottom=+_e.Bottom);break;case"displayrighttoleft":H.Views||(H.Views=[]),H.Views[0]||(H.Views[0]={}),H.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":x["!outline"]||(x["!outline"]={}),x["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":x["!outline"]||(x["!outline"]={}),x["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:me=!1}break;case"pivottable":case"pivotcache":switch(o[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:me=!1}break;case"pagebreaks":switch(o[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:me=!1}break;case"autofilter":switch(o[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:me=!1}break;case"querytable":switch(o[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:me=!1}break;case"datavalidation":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:me=!1}break;case"sorting":case"conditionalformatting":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:me=!1}break;case"mapinfo":case"schema":case"data":switch(o[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:me=!1}break;case"smarttags":break;default:me=!1;break}if(me||o[3].match(/!\[CDATA/))break;if(!d[d.length-1][1])throw"Unrecognized tag: "+o[3]+"|"+d.join("|");if(d[d.length-1][0]==="customdocumentproperties"){if(o[0].slice(-2)==="/>")break;o[1]==="/"?Uke(L,ae,Q,a.slice(R,o.index)):(Q=o,R=o.index+o[0].length);break}if(r.WTF)throw"Unrecognized tag: "+o[3]+"|"+d.join("|")}var Te={};return!r.bookSheets&&!r.bookProps&&(Te.Sheets=f),Te.SheetNames=p,Te.Workbook=H,Te.SSF=Tr(gt),Te.Props=D,Te.Custprops=L,Te}function jC(e,t){switch(IE(t=t||{}),t.type||"base64"){case"base64":return F2(Qs(e),t);case"binary":case"buffer":case"file":return F2(e,t);case"array":return F2(Vc(e),t)}}function Lke(e,t){var r=[];return e.Props&&r.push(dbe(e.Props,t)),e.Custprops&&r.push(ube(e.Props,e.Custprops)),r.join("")}function Qke(){return""}function Hke(e,t){var r=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return t.cellXfs.forEach(function(a,s){var i=[];i.push(Ke("NumberFormat",null,{"ss:Format":cr(gt[a.numFmtId])}));var l={"ss:ID":"s"+(21+s)};r.push(Ke("Style",i.join(""),l))}),Ke("Styles",r.join(""))}function aH(e){return Ke("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+EE(e.Ref,{r:0,c:0})})}function zke(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],a=0;a<t.length;++a){var s=t[a];s.Sheet==null&&(s.Name.match(/^_xlfn\./)||r.push(aH(s)))}return Ke("Names",r.join(""))}function $ke(e,t,r,a){if(!e||!((a||{}).Workbook||{}).Names)return"";for(var s=a.Workbook.Names,i=[],l=0;l<s.length;++l){var o=s[l];o.Sheet==r&&(o.Name.match(/^_xlfn\./)||i.push(aH(o)))}return i.join("")}function Vke(e,t,r,a){if(!e)return"";var s=[];if(e["!margins"]&&(s.push("<PageSetup>"),e["!margins"].header&&s.push(Ke("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&s.push(Ke("Footer",null,{"x:Margin":e["!margins"].footer})),s.push(Ke("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),s.push("</PageSetup>")),a&&a.Workbook&&a.Workbook.Sheets&&a.Workbook.Sheets[r])if(a.Workbook.Sheets[r].Hidden)s.push(Ke("Visible",a.Workbook.Sheets[r].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i<r&&!(a.Workbook.Sheets[i]&&!a.Workbook.Sheets[i].Hidden);++i);i==r&&s.push("<Selected/>")}return((((a||{}).Workbook||{}).Views||[])[0]||{}).RTL&&s.push("<DisplayRightToLeft/>"),e["!protect"]&&(s.push(mn("ProtectContents","True")),e["!protect"].objects&&s.push(mn("ProtectObjects","True")),e["!protect"].scenarios&&s.push(mn("ProtectScenarios","True")),e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells?s.push(mn("EnableSelection","NoSelection")):e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells&&s.push(mn("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(l){e["!protect"][l[0]]&&s.push("<"+l[1]+"/>")})),s.length==0?"":Ke("WorksheetOptions",s.join(""),{xmlns:_s.x})}function Gke(e){return e.map(function(t){var r=fge(t.t||""),a=Ke("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return Ke("Comment",a,{"ss:Author":t.a})}).join("")}function Kke(e,t,r,a,s,i,l){if(!e||e.v==null&&e.f==null)return"";var o={};if(e.f&&(o["ss:Formula"]="="+cr(EE(e.f,l))),e.F&&e.F.slice(0,t.length)==t){var d=Vr(e.F.slice(t.length+1));o["ss:ArrayRange"]="RC:R"+(d.r==l.r?"":"["+(d.r-l.r)+"]")+"C"+(d.c==l.c?"":"["+(d.c-l.c)+"]")}if(e.l&&e.l.Target&&(o["ss:HRef"]=cr(e.l.Target),e.l.Tooltip&&(o["x:HRefScreenTip"]=cr(e.l.Tooltip))),r["!merges"])for(var u=r["!merges"],f=0;f!=u.length;++f)u[f].s.c!=l.c||u[f].s.r!=l.r||(u[f].e.c>u[f].s.c&&(o["ss:MergeAcross"]=u[f].e.c-u[f].s.c),u[f].e.r>u[f].s.r&&(o["ss:MergeDown"]=u[f].e.r-u[f].s.r));var p="",x="";switch(e.t){case"z":if(!a.sheetStubs)return"";break;case"n":p="Number",x=String(e.v);break;case"b":p="Boolean",x=e.v?"1":"0";break;case"e":p="Error",x=Oo[e.v];break;case"d":p="DateTime",x=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||gt[14]);break;case"s":p="String",x=Age(e.v||"");break}var m=Kc(a.cellXfs,e,a);o["ss:StyleID"]="s"+(21+m),o["ss:Index"]=l.c+1;var b=e.v!=null?x:"",v=e.t=="z"?"":'<Data ss:Type="'+p+'">'+b+"</Data>";return(e.c||[]).length>0&&(v+=Gke(e.c)),Ke("Cell",v,o)}function qke(e,t){var r='<Row ss:Index="'+(e+1)+'"';return t&&(t.hpt&&!t.hpx&&(t.hpx=UA(t.hpt)),t.hpx&&(r+=' ss:AutoFitHeight="0" ss:Height="'+t.hpx+'"'),t.hidden&&(r+=' ss:Hidden="1"')),r+">"}function Wke(e,t,r,a){if(!e["!ref"])return"";var s=Kt(e["!ref"]),i=e["!merges"]||[],l=0,o=[];e["!cols"]&&e["!cols"].forEach(function(y,k){Dc(y);var _=!!y.width,C=fv(k,y),E={"ss:Index":k+1};_&&(E["ss:Width"]=vp(C.width)),y.hidden&&(E["ss:Hidden"]="1"),o.push(Ke("Column",null,E))});for(var d=Array.isArray(e),u=s.s.r;u<=s.e.r;++u){for(var f=[qke(u,(e["!rows"]||[])[u])],p=s.s.c;p<=s.e.c;++p){var x=!1;for(l=0;l!=i.length;++l)if(!(i[l].s.c>p)&&!(i[l].s.r>u)&&!(i[l].e.c<p)&&!(i[l].e.r<u)){(i[l].s.c!=p||i[l].s.r!=u)&&(x=!0);break}if(!x){var m={r:u,c:p},b=bt(m),v=d?(e[u]||[])[p]:e[b];f.push(Kke(v,b,e,t,r,a,m))}}f.push("</Row>"),f.length>2&&o.push(f.join(""))}return o.join("")}function Yke(e,t,r){var a=[],s=r.SheetNames[e],i=r.Sheets[s],l=i?$ke(i,t,e,r):"";return l.length>0&&a.push("<Names>"+l+"</Names>"),l=i?Wke(i,t,e,r):"",l.length>0&&a.push("<Table>"+l+"</Table>"),a.push(Vke(i,t,e,r)),a.join("")}function Xke(e,t){t||(t={}),e.SSF||(e.SSF=Tr(gt)),e.SSF&&(t0(),iv(e.SSF),t.revssf=ov(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],Kc(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(Lke(e,t)),r.push(Qke()),r.push(""),r.push("");for(var a=0;a<e.SheetNames.length;++a)r.push(Ke("Worksheet",Yke(a,t,e),{"ss:Name":cr(e.SheetNames[a])}));return r[2]=Hke(e,t),r[3]=zke(e),xa+Ke("Workbook",r.join(""),{xmlns:_s.ss,"xmlns:o":_s.o,"xmlns:x":_s.x,"xmlns:ss":_s.ss,"xmlns:dt":_s.dt,"xmlns:html":_s.html})}function Jke(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=zge(r),r.length-r.l<=4)return t;var a=r.read_shift(4);if(a==0||a>40||(r.l-=4,t.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4)||(a=r.read_shift(4),a!==1907505652)||(t.UnicodeClipboardFormat=$ge(r),a=r.read_shift(4),a==0||a>40))return t;r.l-=4,t.Reserved2=r.read_shift(0,"lpwstr")}var Zke=[60,1084,2066,2165,2175];function eje(e,t,r,a,s){var i=a,l=[],o=r.slice(r.l,r.l+i);if(s&&s.enc&&s.enc.insitu&&o.length>0)switch(e){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:s.enc.insitu(o)}l.push(o),r.l+=i;for(var d=io(r,r.l),u=EC[d],f=0;u!=null&&Zke.indexOf(d)>-1;)i=io(r,r.l+2),f=r.l+4,d==2066?f+=4:(d==2165||d==2175)&&(f+=12),o=r.slice(f,r.l+4+i),l.push(o),r.l+=4+i,u=EC[d=io(r,r.l)];var p=Xa(l);xn(p,0);var x=0;p.lens=[];for(var m=0;m<l.length;++m)p.lens.push(x),x+=l[m].length;if(p.length<a)throw"XLS Record 0x"+e.toString(16)+" Truncated: "+p.length+" < "+a;return t.f(p,p.length,s)}function cl(e,t,r){if(e.t!=="z"&&e.XF){var a=0;try{a=e.z||e.XF.numFmtId||0,t.cellNF&&(e.z=gt[a])}catch(i){if(t.WTF)throw i}if(!t||t.cellText!==!1)try{e.t==="e"?e.w=e.w||Oo[e.v]:a===0||a=="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=pp(e.v):e.w=Vd(e.v):e.w=Ni(a,e.v,{date1904:!!r,dateNF:t&&t.dateNF})}catch(i){if(t.WTF)throw i}if(t.cellDates&&a&&e.t=="n"&&e0(gt[a]||String(a))){var s=Cd(e.v);s&&(e.t="d",e.v=new Date(s.y,s.m-1,s.d,s.H,s.M,s.S,s.u))}}}function Kx(e,t,r){return{v:e,ixfe:t,t:r}}function tje(e,t){var r={opts:{}},a={},s=t.dense?[]:{},i={},l={},o=null,d=[],u="",f={},p,x="",m,b,v,y,k={},_=[],C,E,T=[],B=[],I={Sheets:[],WBProps:{date1904:!1},Views:[{}]},M={},U=function(rt){return rt<8?_d[rt]:rt<64&&B[rt-8]||_d[rt]},D=function(rt,Ct,Vt){var jt=Ct.XF.data;if(!(!jt||!jt.patternType||!Vt||!Vt.cellStyles)){Ct.s={},Ct.s.patternType=jt.patternType;var er;(er=bp(U(jt.icvFore)))&&(Ct.s.fgColor={rgb:er}),(er=bp(U(jt.icvBack)))&&(Ct.s.bgColor={rgb:er})}},L=function(rt,Ct,Vt){if(!(O>1)&&!(Vt.sheetRows&&rt.r>=Vt.sheetRows)){if(Vt.cellStyles&&Ct.XF&&Ct.XF.data&&D(rt,Ct,Vt),delete Ct.ixfe,delete Ct.XF,p=rt,x=bt(rt),(!l||!l.s||!l.e)&&(l={s:{r:0,c:0},e:{r:0,c:0}}),rt.r<l.s.r&&(l.s.r=rt.r),rt.c<l.s.c&&(l.s.c=rt.c),rt.r+1>l.e.r&&(l.e.r=rt.r+1),rt.c+1>l.e.c&&(l.e.c=rt.c+1),Vt.cellFormula&&Ct.f){for(var jt=0;jt<_.length;++jt)if(!(_[jt][0].s.c>rt.c||_[jt][0].s.r>rt.r)&&!(_[jt][0].e.c<rt.c||_[jt][0].e.r<rt.r)){Ct.F=St(_[jt][0]),(_[jt][0].s.c!=rt.c||_[jt][0].s.r!=rt.r)&&delete Ct.f,Ct.f&&(Ct.f=""+Tn(_[jt][1],l,rt,Y,R));break}}Vt.dense?(s[rt.r]||(s[rt.r]=[]),s[rt.r][rt.c]=Ct):s[x]=Ct}},R={enc:!1,sbcch:0,snames:[],sharedf:k,arrayf:_,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!t&&!!t.cellStyles,WTF:!!t&&!!t.wtf};t.password&&(R.password=t.password);var Q,G=[],K=[],W=[],z=[],Z=!1,Y=[];Y.SheetNames=R.snames,Y.sharedf=R.sharedf,Y.arrayf=R.arrayf,Y.names=[],Y.XTI=[];var te=0,O=0,P=0,q=[],H=[],J;R.codepage=1200,Mi(1200);for(var ae=!1;e.l<e.length-1;){var oe=e.l,ce=e.read_shift(2);if(ce===0&&te===10)break;var ne=e.l===e.length?0:e.read_shift(2),le=EC[ce];if(le&&le.f){if(t.bookSheets&&te===133&&ce!==133)break;if(te=ce,le.r===2||le.r==12){var ge=e.read_shift(2);if(ne-=2,!R.enc&&ge!==ce&&((ge&255)<<8|ge>>8)!==ce)throw new Error("rt mismatch: "+ge+"!="+ce);le.r==12&&(e.l+=10,ne-=10)}var X={};if(ce===10?X=le.f(e,ne,R):X=eje(ce,le,e,ne,R),O==0&&[9,521,1033,2057].indexOf(te)===-1)continue;switch(ce){case 34:r.opts.Date1904=I.WBProps.date1904=X;break;case 134:r.opts.WriteProtect=!0;break;case 47:if(R.enc||(e.l=0),R.enc=X,!t.password)throw new Error("File is password-protected");if(X.valid==null)throw new Error("Encryption scheme unsupported");if(!X.valid)throw new Error("Password is incorrect");break;case 92:R.lastuser=X;break;case 66:var pe=Number(X);switch(pe){case 21010:pe=1200;break;case 32768:pe=1e4;break;case 32769:pe=1252;break}Mi(R.codepage=pe),ae=!0;break;case 317:R.rrtabid=X;break;case 25:R.winlocked=X;break;case 439:r.opts.RefreshAll=X;break;case 12:r.opts.CalcCount=X;break;case 16:r.opts.CalcDelta=X;break;case 17:r.opts.CalcIter=X;break;case 13:r.opts.CalcMode=X;break;case 14:r.opts.CalcPrecision=X;break;case 95:r.opts.CalcSaveRecalc=X;break;case 15:R.CalcRefMode=X;break;case 2211:r.opts.FullCalc=X;break;case 129:X.fDialog&&(s["!type"]="dialog"),X.fBelow||((s["!outline"]||(s["!outline"]={})).above=!0),X.fRight||((s["!outline"]||(s["!outline"]={})).left=!0);break;case 224:T.push(X);break;case 430:Y.push([X]),Y[Y.length-1].XTI=[];break;case 35:case 547:Y[Y.length-1].push(X);break;case 24:case 536:J={Name:X.Name,Ref:Tn(X.rgce,l,null,Y,R)},X.itab>0&&(J.Sheet=X.itab-1),Y.names.push(J),Y[0]||(Y[0]=[],Y[0].XTI=[]),Y[Y.length-1].push(X),X.Name=="_xlnm._FilterDatabase"&&X.itab>0&&X.rgce&&X.rgce[0]&&X.rgce[0][0]&&X.rgce[0][0][0]=="PtgArea3d"&&(H[X.itab-1]={ref:St(X.rgce[0][0][1][2])});break;case 22:R.ExternCount=X;break;case 23:Y.length==0&&(Y[0]=[],Y[0].XTI=[]),Y[Y.length-1].XTI=Y[Y.length-1].XTI.concat(X),Y.XTI=Y.XTI.concat(X);break;case 2196:if(R.biff<8)break;J!=null&&(J.Comment=X[1]);break;case 18:s["!protect"]=X;break;case 19:X!==0&&R.WTF&&console.error("Password verifier: "+X);break;case 133:i[X.pos]=X,R.snames.push(X.name);break;case 10:{if(--O)break;if(l.e){if(l.e.r>0&&l.e.c>0){if(l.e.r--,l.e.c--,s["!ref"]=St(l),t.sheetRows&&t.sheetRows<=l.e.r){var be=l.e.r;l.e.r=t.sheetRows-1,s["!fullref"]=s["!ref"],s["!ref"]=St(l),l.e.r=be}l.e.r++,l.e.c++}G.length>0&&(s["!merges"]=G),K.length>0&&(s["!objects"]=K),W.length>0&&(s["!cols"]=W),z.length>0&&(s["!rows"]=z),I.Sheets.push(M)}u===""?f=s:a[u]=s,s=t.dense?[]:{}}break;case 9:case 521:case 1033:case 2057:{if(R.biff===8&&(R.biff={9:2,521:3,1033:4}[ce]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[X.BIFFVer]||8),R.biffguess=X.BIFFVer==0,X.BIFFVer==0&&X.dt==4096&&(R.biff=5,ae=!0,Mi(R.codepage=28591)),R.biff==8&&X.BIFFVer==0&&X.dt==16&&(R.biff=2),O++)break;if(s=t.dense?[]:{},R.biff<8&&!ae&&(ae=!0,Mi(R.codepage=t.codepage||1252)),R.biff<5||X.BIFFVer==0&&X.dt==4096){u===""&&(u="Sheet1"),l={s:{r:0,c:0},e:{r:0,c:0}};var me={pos:e.l-ne,name:u};i[me.pos]=me,R.snames.push(u)}else u=(i[oe]||{name:""}).name;X.dt==32&&(s["!type"]="chart"),X.dt==64&&(s["!type"]="macro"),G=[],K=[],R.arrayf=_=[],W=[],z=[],Z=!1,M={Hidden:(i[oe]||{hs:0}).hs,name:u}}break;case 515:case 3:case 2:s["!type"]=="chart"&&(t.dense?(s[X.r]||[])[X.c]:s[bt({c:X.c,r:X.r})])&&++X.c,C={ixfe:X.ixfe,XF:T[X.ixfe]||{},v:X.val,t:"n"},P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:X.c,r:X.r},C,t);break;case 5:case 517:C={ixfe:X.ixfe,XF:T[X.ixfe],v:X.val,t:X.t},P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:X.c,r:X.r},C,t);break;case 638:C={ixfe:X.ixfe,XF:T[X.ixfe],v:X.rknum,t:"n"},P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:X.c,r:X.r},C,t);break;case 189:for(var _e=X.c;_e<=X.C;++_e){var Te=X.rkrec[_e-X.c][0];C={ixfe:Te,XF:T[Te],v:X.rkrec[_e-X.c][1],t:"n"},P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:_e,r:X.r},C,t)}break;case 6:case 518:case 1030:{if(X.val=="String"){o=X;break}if(C=Kx(X.val,X.cell.ixfe,X.tt),C.XF=T[C.ixfe],t.cellFormula){var Xe=X.formula;if(Xe&&Xe[0]&&Xe[0][0]&&Xe[0][0][0]=="PtgExp"){var At=Xe[0][0][1][0],kt=Xe[0][0][1][1],Bt=bt({r:At,c:kt});k[Bt]?C.f=""+Tn(X.formula,l,X.cell,Y,R):C.F=((t.dense?(s[At]||[])[kt]:s[Bt])||{}).F}else C.f=""+Tn(X.formula,l,X.cell,Y,R)}P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L(X.cell,C,t),o=X}break;case 7:case 519:if(o)o.val=X,C=Kx(X,o.cell.ixfe,"s"),C.XF=T[C.ixfe],t.cellFormula&&(C.f=""+Tn(o.formula,l,o.cell,Y,R)),P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L(o.cell,C,t),o=null;else throw new Error("String record expects Formula");break;case 33:case 545:{_.push(X);var Kr=bt(X[0].s);if(m=t.dense?(s[X[0].s.r]||[])[X[0].s.c]:s[Kr],t.cellFormula&&m){if(!o||!Kr||!m)break;m.f=""+Tn(X[1],l,X[0],Y,R),m.F=St(X[0])}}break;case 1212:{if(!t.cellFormula)break;if(x){if(!o)break;k[bt(o.cell)]=X[0],m=t.dense?(s[o.cell.r]||[])[o.cell.c]:s[bt(o.cell)],(m||{}).f=""+Tn(X[0],l,p,Y,R)}}break;case 253:C=Kx(d[X.isst].t,X.ixfe,"s"),d[X.isst].h&&(C.h=d[X.isst].h),C.XF=T[C.ixfe],P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:X.c,r:X.r},C,t);break;case 513:t.sheetStubs&&(C={ixfe:X.ixfe,XF:T[X.ixfe],t:"z"},P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:X.c,r:X.r},C,t));break;case 190:if(t.sheetStubs)for(var qr=X.c;qr<=X.C;++qr){var _t=X.ixfe[qr-X.c];C={ixfe:_t,XF:T[_t],t:"z"},P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:qr,r:X.r},C,t)}break;case 214:case 516:case 4:C=Kx(X.val,X.ixfe,"s"),C.XF=T[C.ixfe],P>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:X.c,r:X.r},C,t);break;case 0:case 512:O===1&&(l=X);break;case 252:d=X;break;case 1054:if(R.biff==4){q[P++]=X[1];for(var Ir=0;Ir<P+163&&gt[Ir]!=X[1];++Ir);Ir>=163&&uo(X[1],P+163)}else uo(X[1],X[0]);break;case 30:{q[P++]=X;for(var vr=0;vr<P+163&&gt[vr]!=X;++vr);vr>=163&&uo(X,P+163)}break;case 229:G=G.concat(X);break;case 93:K[X.cmo[0]]=R.lastobj=X;break;case 438:R.lastobj.TxO=X;break;case 127:R.lastobj.ImData=X;break;case 440:for(y=X[0].s.r;y<=X[0].e.r;++y)for(v=X[0].s.c;v<=X[0].e.c;++v)m=t.dense?(s[y]||[])[v]:s[bt({c:v,r:y})],m&&(m.l=X[1]);break;case 2048:for(y=X[0].s.r;y<=X[0].e.r;++y)for(v=X[0].s.c;v<=X[0].e.c;++v)m=t.dense?(s[y]||[])[v]:s[bt({c:v,r:y})],m&&m.l&&(m.l.Tooltip=X[1]);break;case 28:{if(R.biff<=5&&R.biff>=2)break;m=t.dense?(s[X[0].r]||[])[X[0].c]:s[bt(X[0])];var Fa=K[X[2]];m||(t.dense?(s[X[0].r]||(s[X[0].r]=[]),m=s[X[0].r][X[0].c]={t:"z"}):m=s[bt(X[0])]={t:"z"},l.e.r=Math.max(l.e.r,X[0].r),l.s.r=Math.min(l.s.r,X[0].r),l.e.c=Math.max(l.e.c,X[0].c),l.s.c=Math.min(l.s.c,X[0].c)),m.c||(m.c=[]),b={a:X[1],t:Fa.TxO.t},m.c.push(b)}break;case 2173:Hye(T[X.ixfe],X.ext);break;case 125:{if(!R.cellStyles)break;for(;X.e>=X.s;)W[X.e--]={width:X.w/256,level:X.level||0,hidden:!!(X.flags&1)},Z||(Z=!0,CE(X.w/256)),Dc(W[X.e+1])}break;case 520:{var xt={};X.level!=null&&(z[X.r]=xt,xt.level=X.level),X.hidden&&(z[X.r]=xt,xt.hidden=!0),X.hpt&&(z[X.r]=xt,xt.hpt=X.hpt,xt.hpx=UA(X.hpt))}break;case 38:case 39:case 40:case 41:s["!margins"]||Id(s["!margins"]={}),s["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[ce]]=X;break;case 161:s["!margins"]||Id(s["!margins"]={}),s["!margins"].header=X.header,s["!margins"].footer=X.footer;break;case 574:X.RTL&&(I.Views[0].RTL=!0);break;case 146:B=X;break;case 2198:Q=X;break;case 140:E=X;break;case 442:u?M.CodeName=X||M.name:I.WBProps.CodeName=X||"ThisWorkbook";break}}else le||console.error("Missing Info for XLS Record 0x"+ce.toString(16)),e.l+=ne}return r.SheetNames=oa(i).sort(function(dr,rt){return Number(dr)-Number(rt)}).map(function(dr){return i[dr].name}),t.bookSheets||(r.Sheets=a),!r.SheetNames.length&&f["!ref"]?(r.SheetNames.push("Sheet1"),r.Sheets&&(r.Sheets.Sheet1=f)):r.Preamble=f,r.Sheets&&H.forEach(function(dr,rt){r.Sheets[r.SheetNames[rt]]["!autofilter"]=dr}),r.Strings=d,r.SSF=Tr(gt),R.enc&&(r.Encryption=R.enc),Q&&(r.Themes=Q),r.Metadata={},E!==void 0&&(r.Metadata.Country=E),Y.names.length>0&&(I.Names=Y.names),r.Workbook=I,r}var Of={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function rje(e,t,r){var a=ut.find(e,"/!DocumentSummaryInformation");if(a&&a.size>0)try{var s=PD(a,vC,Of.DSI);for(var i in s)t[i]=s[i]}catch(u){if(r.WTF)throw u}var l=ut.find(e,"/!SummaryInformation");if(l&&l.size>0)try{var o=PD(l,yC,Of.SI);for(var d in o)t[d]==null&&(t[d]=o[d])}catch(u){if(r.WTF)throw u}t.HeadingPairs&&t.TitlesOfParts&&(r9(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}function aje(e,t){var r=[],a=[],s=[],i=0,l,o=hD(vC,"n"),d=hD(yC,"n");if(e.Props)for(l=oa(e.Props),i=0;i<l.length;++i)(Object.prototype.hasOwnProperty.call(o,l[i])?r:Object.prototype.hasOwnProperty.call(d,l[i])?a:s).push([l[i],e.Props[l[i]]]);if(e.Custprops)for(l=oa(e.Custprops),i=0;i<l.length;++i)Object.prototype.hasOwnProperty.call(e.Props||{},l[i])||(Object.prototype.hasOwnProperty.call(o,l[i])?r:Object.prototype.hasOwnProperty.call(d,l[i])?a:s).push([l[i],e.Custprops[l[i]]]);var u=[];for(i=0;i<s.length;++i)c9.indexOf(s[i][0])>-1||t9.indexOf(s[i][0])>-1||s[i][1]!=null&&u.push(s[i]);a.length&&ut.utils.cfb_add(t,"/SummaryInformation",LD(a,Of.SI,d,yC)),(r.length||u.length)&&ut.utils.cfb_add(t,"/DocumentSummaryInformation",LD(r,Of.DSI,o,vC,u.length?u:null,Of.UDI))}function nH(e,t){t||(t={}),IE(t),eE(),t.codepage&&Zj(t.codepage);var r,a;if(e.FullPaths){if(ut.find(e,"/encryption"))throw new Error("File is password-protected");r=ut.find(e,"!CompObj"),a=ut.find(e,"/Workbook")||ut.find(e,"/Book")}else{switch(t.type){case"base64":e=Is(Qs(e));break;case"binary":e=Is(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e));break}xn(e,0),a={content:e}}var s,i;if(r&&Jke(r),t.bookProps&&!t.bookSheets)s={};else{var l=Dt?"buffer":"array";if(a&&a.content)s=tje(a.content,t);else if((i=ut.find(e,"PerfectOffice_MAIN"))&&i.content)s=Fd.to_workbook(i.content,(t.type=l,t));else if((i=ut.find(e,"NativeContent_MAIN"))&&i.content)s=Fd.to_workbook(i.content,(t.type=l,t));else throw(i=ut.find(e,"MN0"))&&i.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");t.bookVBA&&e.FullPaths&&ut.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(s.vbaraw=xwe(e))}var o={};return e.FullPaths&&rje(e,o,t),s.Props=s.Custprops=o,t.bookFiles&&(s.cfb=e),s}function nje(e,t){var r=t||{},a=ut.utils.cfb_new({root:"R"}),s="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":s="/Workbook",r.biff=8;break;case"biff5":s="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return ut.utils.cfb_add(a,s,sH(e,r)),r.biff==8&&(e.Props||e.Custprops)&&aje(e,a),r.biff==8&&e.vbaraw&&mwe(a,ut.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),a}var Np={0:{f:SNe},1:{f:MNe},2:{f:tCe},3:{f:$Ne},4:{f:LNe},5:{f:JNe},6:{f:iCe},7:{f:qNe},8:{f:fCe},9:{f:ACe},10:{f:dCe},11:{f:uCe},12:{f:ONe},13:{f:aCe},14:{f:GNe},15:{f:HNe},16:{f:Y9},17:{f:oCe},18:{f:YNe},19:{f:pE},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:oke},40:{},42:{},43:{f:iye},44:{f:nye},45:{f:cye},46:{f:uye},47:{f:dye},48:{},49:{f:Tge},50:{},51:{f:Vye},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:v9},62:{f:sCe},63:{f:ewe},64:{f:BCe},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:On,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:kCe},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:DNe},148:{f:TNe,p:16},151:{f:bCe},152:{},153:{f:ske},154:{},155:{},156:{f:ake},157:{},158:{},159:{T:1,f:y1e},160:{T:-1},161:{T:1,f:ou},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:pCe},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:zye},336:{T:-1},337:{f:qye,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:bC},357:{},358:{},359:{},360:{T:1},361:{},362:{f:b9},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:vCe},427:{f:yCe},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:NCe},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:INe},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:mCe},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:bC},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:uwe},633:{T:1},634:{T:-1},635:{T:1,f:cwe},636:{T:-1},637:{f:Uge},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:GCe},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:_Ce},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},EC={6:{f:_2},10:{f:dc},12:{f:Ca},13:{f:Ca},14:{f:Aa},15:{f:Aa},16:{f:Un},17:{f:Aa},18:{f:Aa},19:{f:Ca},20:{f:GD},21:{f:GD},23:{f:b9},24:{f:qD},25:{f:Aa},26:{},27:{},28:{f:_ve},29:{},34:{f:Aa},35:{f:KD},38:{f:Un},39:{f:Un},40:{f:Un},41:{f:Un},42:{f:Aa},43:{f:Aa},47:{f:H1e},49:{f:ave},51:{f:Ca},60:{},61:{f:Jbe},64:{f:Aa},65:{f:rve},66:{f:Ca},77:{},80:{},81:{},82:{},85:{f:Ca},89:{},90:{},91:{},92:{f:Qbe},93:{f:Ive},94:{},95:{f:Aa},96:{},97:{},99:{f:Aa},125:{f:v9},128:{f:gve},129:{f:zbe},130:{f:Ca},131:{f:Aa},132:{f:Aa},133:{f:$be},134:{},140:{f:Qve},141:{f:Ca},144:{},146:{f:$ve},151:{},152:{},153:{},154:{},155:{},156:{f:Ca},157:{},158:{},160:{f:Xve},161:{f:Kve},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:pve},190:{f:hve},193:{f:dc},197:{},198:{},199:{},200:{},201:{},202:{f:Aa},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:Ca},220:{},221:{f:Aa},222:{},224:{f:mve},225:{f:Lbe},226:{f:dc},227:{},229:{f:Tve},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:Gbe},253:{f:sve},255:{f:qbe},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:d9},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:Aa},353:{f:dc},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:Nve},431:{f:Aa},432:{},433:{},434:{},437:{},438:{f:Mve},439:{f:Aa},440:{f:Rve},441:{},442:{f:Zp},443:{},444:{f:Ca},445:{},446:{},448:{f:dc},449:{f:Xbe,r:2},450:{f:dc},512:{f:zD},513:{f:Yve},515:{f:yve},516:{f:lve},517:{f:VD},519:{f:Jve},520:{f:Wbe},523:{},545:{f:WD},549:{f:HD},566:{},574:{f:eve},638:{f:fve},659:{},1048:{},1054:{f:cve},1084:{},1212:{f:Eve},2048:{f:Pve},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:$x},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:dc},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:Vve,r:12},2173:{f:Qye,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:Aa,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:jve,r:12},2197:{},2198:{f:Uye,r:12},2199:{},2200:{},2201:{},2202:{f:Sve,r:12},2203:{f:dc},2204:{},2205:{},2206:{},2207:{},2211:{f:Ybe},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:Ca},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:qve},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:zve},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:zD},1:{},2:{f:a1e},3:{f:t1e},4:{f:e1e},5:{f:VD},7:{f:s1e},8:{},9:{f:$x},11:{},22:{f:Ca},30:{f:uve},31:{},32:{},33:{f:WD},36:{},37:{f:HD},50:{f:i1e},62:{},52:{},67:{},68:{f:Ca},69:{},86:{},126:{},127:{f:Zve},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:l1e},223:{},234:{},354:{},421:{},518:{f:_2},521:{f:$x},536:{f:qD},547:{f:KD},561:{},579:{},1030:{f:_2},1033:{f:$x},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function We(e,t,r,a){var s=t;if(!isNaN(s)){var i=a||(r||[]).length||0,l=e.next(4);l.write_shift(2,s),l.write_shift(2,i),i>0&&uE(r)&&e.push(r)}}function sje(e,t,r,a){var s=(r||[]).length||0;if(s<=8224)return We(e,t,r,s);var i=t;if(!isNaN(i)){for(var l=r.parts||[],o=0,d=0,u=0;u+(l[o]||8224)<=8224;)u+=l[o]||8224,o++;var f=e.next(4);for(f.write_shift(2,i),f.write_shift(2,u),e.push(r.slice(d,d+u)),d+=u;d<s;){for(f=e.next(4),f.write_shift(2,60),u=0;u+(l[o]||8224)<=8224;)u+=l[o]||8224,o++;f.write_shift(2,u),e.push(r.slice(d,d+u)),d+=u}}}function ah(e,t,r){return e||(e=Re(7)),e.write_shift(2,t),e.write_shift(2,r),e.write_shift(2,0),e.write_shift(1,0),e}function ije(e,t,r,a){var s=Re(9);return ah(s,e,t),u9(r,a||"b",s),s}function lje(e,t,r){var a=Re(8+2*r.length);return ah(a,e,t),a.write_shift(1,r.length),a.write_shift(r.length,r,"sbcs"),a.l<a.length?a.slice(0,a.l):a}function oje(e,t,r,a){if(t.v!=null)switch(t.t){case"d":case"n":var s=t.t=="d"?Qa(_r(t.v)):t.v;s==(s|0)&&s>=0&&s<65536?We(e,2,n1e(r,a,s)):We(e,3,r1e(r,a,s));return;case"b":case"e":We(e,5,ije(r,a,t.v,t.t));return;case"s":case"str":We(e,4,lje(r,a,(t.v||"").slice(0,255)));return}We(e,1,ah(null,r,a))}function cje(e,t,r,a){var s=Array.isArray(t),i=Kt(t["!ref"]||"A1"),l,o="",d=[];if(i.e.c>255||i.e.r>16383){if(a.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");i.e.c=Math.min(i.e.c,255),i.e.r=Math.min(i.e.c,16383),l=St(i)}for(var u=i.s.r;u<=i.e.r;++u){o=pa(u);for(var f=i.s.c;f<=i.e.c;++f){u===i.s.r&&(d[f]=$r(f)),l=d[f]+o;var p=s?(t[u]||[])[f]:t[l];p&&oje(e,p,u,f)}}}function dje(e,t){for(var r=t||{},a=As(),s=0,i=0;i<e.SheetNames.length;++i)e.SheetNames[i]==r.sheet&&(s=i);if(s==0&&r.sheet&&e.SheetNames[0]!=r.sheet)throw new Error("Sheet not found: "+r.sheet);return We(a,r.biff==4?1033:r.biff==3?521:9,yE(e,16,r)),cje(a,e.Sheets[e.SheetNames[s]],s,r),We(a,10),a.end()}function uje(e,t,r){We(e,49,nve({sz:12,name:"Arial"},r))}function Aje(e,t,r){t&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&We(e,1054,dve(s,t[s],r))})}function fje(e,t){var r=Re(19);r.write_shift(4,2151),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,1),r.write_shift(4,0),We(e,2151,r),r=Re(39),r.write_shift(4,2152),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,0),r.write_shift(4,0),r.write_shift(2,1),r.write_shift(4,4),r.write_shift(2,0),x9(Kt(t["!ref"]||"A1"),r),r.write_shift(4,4),We(e,2152,r)}function pje(e,t){for(var r=0;r<16;++r)We(e,224,$D({numFmtId:0,style:!0},0,t));t.cellXfs.forEach(function(a){We(e,224,$D(a,0,t))})}function hje(e,t){for(var r=0;r<t["!links"].length;++r){var a=t["!links"][r];We(e,440,Ove(a)),a[1].Tooltip&&We(e,2048,Lve(a))}delete t["!links"]}function xje(e,t){if(t){var r=0;t.forEach(function(a,s){++r<=256&&a&&We(e,125,Gve(fv(s,a),s))})}}function mje(e,t,r,a,s){var i=16+Kc(s.cellXfs,t,s);if(t.v==null&&!t.bf){We(e,513,Wd(r,a,i));return}if(t.bf)We(e,6,z2e(t,r,a,s,i));else switch(t.t){case"d":case"n":var l=t.t=="d"?Qa(_r(t.v)):t.v;We(e,515,wve(r,a,l,i));break;case"b":case"e":We(e,517,vve(r,a,t.v,i,s,t.t));break;case"s":case"str":if(s.bookSST){var o=BE(s.Strings,t.v,s.revStrings);We(e,253,ive(r,a,o,i))}else We(e,516,ove(r,a,(t.v||"").slice(0,255),i,s));break;default:We(e,513,Wd(r,a,i))}}function gje(e,t,r){var a=As(),s=r.SheetNames[e],i=r.Sheets[s]||{},l=(r||{}).Workbook||{},o=(l.Sheets||[])[e]||{},d=Array.isArray(i),u=t.biff==8,f,p="",x=[],m=Kt(i["!ref"]||"A1"),b=u?65536:16384;if(m.e.c>255||m.e.r>=b){if(t.WTF)throw new Error("Range "+(i["!ref"]||"A1")+" exceeds format limit A1:IV16384");m.e.c=Math.min(m.e.c,255),m.e.r=Math.min(m.e.c,b-1)}We(a,2057,yE(r,16,t)),We(a,13,di(1)),We(a,12,di(100)),We(a,15,$n(!0)),We(a,17,$n(!1)),We(a,16,Kd(.001)),We(a,95,$n(!0)),We(a,42,$n(!1)),We(a,43,$n(!1)),We(a,130,di(1)),We(a,128,bve()),We(a,131,$n(!1)),We(a,132,$n(!1)),u&&xje(a,i["!cols"]),We(a,512,Ave(m,t)),u&&(i["!links"]=[]);for(var v=m.s.r;v<=m.e.r;++v){p=pa(v);for(var y=m.s.c;y<=m.e.c;++y){v===m.s.r&&(x[y]=$r(y)),f=x[y]+p;var k=d?(i[v]||[])[y]:i[f];k&&(mje(a,k,v,y,t),u&&k.l&&i["!links"].push([f,k.l]))}}var _=o.CodeName||o.name||s;return u&&We(a,574,tve((l.Views||[])[0])),u&&(i["!merges"]||[]).length&&We(a,229,Fve(i["!merges"])),u&&hje(a,i),We(a,442,A9(_)),u&&fje(a,i),We(a,10),a.end()}function bje(e,t,r){var a=As(),s=(e||{}).Workbook||{},i=s.Sheets||[],l=s.WBProps||{},o=r.biff==8,d=r.biff==5;if(We(a,2057,yE(e,5,r)),r.bookType=="xla"&&We(a,135),We(a,225,o?di(1200):null),We(a,193,vbe(2)),d&&We(a,191),d&&We(a,192),We(a,226),We(a,92,Hbe("SheetJS",r)),We(a,66,di(o?1200:1252)),o&&We(a,353,di(0)),o&&We(a,448),We(a,317,Wve(e.SheetNames.length)),o&&e.vbaraw&&We(a,211),o&&e.vbaraw){var u=l.CodeName||"ThisWorkbook";We(a,442,A9(u))}We(a,156,di(17)),We(a,25,$n(!1)),We(a,18,$n(!1)),We(a,19,di(0)),o&&We(a,431,$n(!1)),o&&We(a,444,di(0)),We(a,61,Zbe()),We(a,64,$n(!1)),We(a,141,di(0)),We(a,34,$n(XCe(e)=="true")),We(a,14,$n(!0)),o&&We(a,439,$n(!1)),We(a,218,di(0)),uje(a,e,r),Aje(a,e.SSF,r),pje(a,r),o&&We(a,352,$n(!1));var f=a.end(),p=As();o&&We(p,140,Hve()),o&&r.Strings&&sje(p,252,Kbe(r.Strings)),We(p,10);var x=p.end(),m=As(),b=0,v=0;for(v=0;v<e.SheetNames.length;++v)b+=(o?12:11)+(o?2:1)*e.SheetNames[v].length;var y=f.length+b+x.length;for(v=0;v<e.SheetNames.length;++v){var k=i[v]||{};We(m,133,Vbe({pos:y,hs:k.Hidden||0,dt:0,name:e.SheetNames[v]},r)),y+=t[v].length}var _=m.end();if(b!=_.length)throw new Error("BS8 "+b+" != "+_.length);var C=[];return f.length&&C.push(f),_.length&&C.push(_),x.length&&C.push(x),Xa(C)}function vje(e,t){var r=t||{},a=[];e&&!e.SSF&&(e.SSF=Tr(gt)),e&&e.SSF&&(t0(),iv(e.SSF),r.revssf=ov(e.SSF),r.revssf[e.SSF[65535]]=0,r.ssf=e.SSF),r.Strings=[],r.Strings.Count=0,r.Strings.Unique=0,DE(r),r.cellXfs=[],Kc(r.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={});for(var s=0;s<e.SheetNames.length;++s)a[a.length]=gje(s,r,e);return a.unshift(bje(e,a,r)),Xa(a)}function sH(e,t){for(var r=0;r<=e.SheetNames.length;++r){var a=e.Sheets[e.SheetNames[r]];if(!(!a||!a["!ref"])){var s=xs(a["!ref"]);s.e.c>255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+e.SheetNames[r]+"' extends beyond column IV (255).  Data may be lost.")}}var i=t||{};switch(i.biff||2){case 8:case 5:return vje(e,t);case 4:case 3:case 2:return dje(e,t)}throw new Error("invalid type "+i.bookType+" for BIFF")}function sU(e,t){var r=t||{},a=r.dense?[]:{};e=e.replace(/<!--.*?-->/g,"");var s=e.match(/<table/i);if(!s)throw new Error("Invalid HTML: could not find <table>");var i=e.match(/<\/table/i),l=s.index,o=i&&i.index||e.length,d=nge(e.slice(l,o),/(:?<tr[^>]*>)/i,"<tr>"),u=-1,f=0,p=0,x=0,m={s:{r:1e7,c:1e7},e:{r:0,c:0}},b=[];for(l=0;l<d.length;++l){var v=d[l].trim(),y=v.slice(0,3).toLowerCase();if(y=="<tr"){if(++u,r.sheetRows&&r.sheetRows<=u){--u;break}f=0;continue}if(!(y!="<td"&&y!="<th")){var k=v.split(/<\/t[dh]>/i);for(o=0;o<k.length;++o){var _=k[o].trim();if(_.match(/<t[dh]/i)){for(var C=_,E=0;C.charAt(0)=="<"&&(E=C.indexOf(">"))>-1;)C=C.slice(E+1);for(var T=0;T<b.length;++T){var B=b[T];B.s.c==f&&B.s.r<u&&u<=B.e.r&&(f=B.e.c+1,T=-1)}var I=vt(_.slice(0,_.indexOf(">")));x=I.colspan?+I.colspan:1,((p=+I.rowspan)>1||x>1)&&b.push({s:{r:u,c:f},e:{r:u+(p||1)-1,c:f+x-1}});var M=I.t||I["data-t"]||"";if(!C.length){f+=x;continue}if(C=BQ(C),m.s.r>u&&(m.s.r=u),m.e.r<u&&(m.e.r=u),m.s.c>f&&(m.s.c=f),m.e.c<f&&(m.e.c=f),!C.length){f+=x;continue}var U={t:"s",v:C};r.raw||!C.trim().length||M=="s"||(C==="TRUE"?U={t:"b",v:!0}:C==="FALSE"?U={t:"b",v:!1}:isNaN(Hi(C))?isNaN(IA(C).getDate())||(U={t:"d",v:_r(C)},r.cellDates||(U={t:"n",v:Qa(U.v)}),U.z=r.dateNF||gt[14]):U={t:"n",v:Hi(C)}),r.dense?(a[u]||(a[u]=[]),a[u][f]=U):a[bt({r:u,c:f})]=U,f+=x}}}}return a["!ref"]=St(m),b.length&&(a["!merges"]=b),a}function yje(e,t,r,a){for(var s=e["!merges"]||[],i=[],l=t.s.c;l<=t.e.c;++l){for(var o=0,d=0,u=0;u<s.length;++u)if(!(s[u].s.r>r||s[u].s.c>l)&&!(s[u].e.r<r||s[u].e.c<l)){if(s[u].s.r<r||s[u].s.c<l){o=-1;break}o=s[u].e.r-s[u].s.r+1,d=s[u].e.c-s[u].s.c+1;break}if(!(o<0)){var f=bt({r,c:l}),p=a.dense?(e[r]||[])[l]:e[f],x=p&&p.v!=null&&(p.h||oE(p.w||(No(p),p.w)||""))||"",m={};o>1&&(m.rowspan=o),d>1&&(m.colspan=d),a.editable?x='<span contenteditable="true">'+x+"</span>":p&&(m["data-t"]=p&&p.t||"z",p.v!=null&&(m["data-v"]=p.v),p.z!=null&&(m["data-z"]=p.z),p.l&&(p.l.Target||"#").charAt(0)!="#"&&(x='<a href="'+p.l.Target+'">'+x+"</a>")),m.id=(a.id||"sjs")+"-"+f,i.push(Ke("td",x,m))}}var b="<tr>";return b+i.join("")+"</tr>"}var wje='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',Nje="</body></html>";function Cje(e,t){var r=e.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!r||r.length==0)throw new Error("Invalid HTML: could not find <table>");if(r.length==1)return Gc(sU(r[0],t),t);var a=OE();return r.forEach(function(s,i){PE(a,sU(s,t),"Sheet"+(i+1))}),a}function kje(e,t,r){var a=[];return a.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function iH(e,t){var r=t||{},a=r.header!=null?r.header:wje,s=r.footer!=null?r.footer:Nje,i=[a],l=xs(e["!ref"]);r.dense=Array.isArray(e),i.push(kje(e,l,r));for(var o=l.s.r;o<=l.e.r;++o)i.push(yje(e,l,o,r));return i.push("</table>"+s),i.join("")}function lH(e,t,r){var a=r||{},s=0,i=0;if(a.origin!=null)if(typeof a.origin=="number")s=a.origin;else{var l=typeof a.origin=="string"?Vr(a.origin):a.origin;s=l.r,i=l.c}var o=t.getElementsByTagName("tr"),d=Math.min(a.sheetRows||1e7,o.length),u={s:{r:0,c:0},e:{r:s,c:i}};if(e["!ref"]){var f=xs(e["!ref"]);u.s.r=Math.min(u.s.r,f.s.r),u.s.c=Math.min(u.s.c,f.s.c),u.e.r=Math.max(u.e.r,f.e.r),u.e.c=Math.max(u.e.c,f.e.c),s==-1&&(u.e.r=s=f.e.r+1)}var p=[],x=0,m=e["!rows"]||(e["!rows"]=[]),b=0,v=0,y=0,k=0,_=0,C=0;for(e["!cols"]||(e["!cols"]=[]);b<o.length&&v<d;++b){var E=o[b];if(iU(E)){if(a.display)continue;m[v]={hidden:!0}}var T=E.children;for(y=k=0;y<T.length;++y){var B=T[y];if(!(a.display&&iU(B))){var I=B.hasAttribute("data-v")?B.getAttribute("data-v"):B.hasAttribute("v")?B.getAttribute("v"):BQ(B.innerHTML),M=B.getAttribute("data-z")||B.getAttribute("z");for(x=0;x<p.length;++x){var U=p[x];U.s.c==k+i&&U.s.r<v+s&&v+s<=U.e.r&&(k=U.e.c+1-i,x=-1)}C=+B.getAttribute("colspan")||1,((_=+B.getAttribute("rowspan")||1)>1||C>1)&&p.push({s:{r:v+s,c:k+i},e:{r:v+s+(_||1)-1,c:k+i+(C||1)-1}});var D={t:"s",v:I},L=B.getAttribute("data-t")||B.getAttribute("t")||"";I!=null&&(I.length==0?D.t=L||"z":a.raw||I.trim().length==0||L=="s"||(I==="TRUE"?D={t:"b",v:!0}:I==="FALSE"?D={t:"b",v:!1}:isNaN(Hi(I))?isNaN(IA(I).getDate())||(D={t:"d",v:_r(I)},a.cellDates||(D={t:"n",v:Qa(D.v)}),D.z=a.dateNF||gt[14]):D={t:"n",v:Hi(I)})),D.z===void 0&&M!=null&&(D.z=M);var R="",Q=B.getElementsByTagName("A");if(Q&&Q.length)for(var G=0;G<Q.length&&!(Q[G].hasAttribute("href")&&(R=Q[G].getAttribute("href"),R.charAt(0)!="#"));++G);R&&R.charAt(0)!="#"&&(D.l={Target:R}),a.dense?(e[v+s]||(e[v+s]=[]),e[v+s][k+i]=D):e[bt({c:k+i,r:v+s})]=D,u.e.c<k+i&&(u.e.c=k+i),k+=C}}++v}return p.length&&(e["!merges"]=(e["!merges"]||[]).concat(p)),u.e.r=Math.max(u.e.r,v-1+s),e["!ref"]=St(u),v>=d&&(e["!fullref"]=St((u.e.r=o.length-b+v-1+s,u))),e}function oH(e,t){var r=t||{},a=r.dense?[]:{};return lH(a,e,t)}function jje(e,t){return Gc(oH(e,t),t)}function iU(e){var t="",r=Eje(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function Eje(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function Sje(e){var t=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(a,s){return Array(parseInt(s,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g,"	").replace(/<text:line-break\/>/g,`
`),r=Gt(t.replace(/<[^>]*>/g,""));return[r]}var lU={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function cH(e,t){var r=t||{},a=cE(e),s=[],i,l,o={name:""},d="",u=0,f,p,x={},m=[],b=r.dense?[]:{},v,y,k={value:""},_="",C=0,E=[],T=-1,B=-1,I={s:{r:1e6,c:1e7},e:{r:0,c:0}},M=0,U={},D=[],L={},R=0,Q=0,G=[],K=1,W=1,z=[],Z={Names:[]},Y={},te=["",""],O=[],P={},q="",H=0,J=!1,ae=!1,oe=0;for(mp.lastIndex=0,a=a.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");v=mp.exec(a);)switch(v[3]=v[3].replace(/_.*$/,"")){case"table":case"工作表":v[1]==="/"?(I.e.c>=I.s.c&&I.e.r>=I.s.r?b["!ref"]=St(I):b["!ref"]="A1:A1",r.sheetRows>0&&r.sheetRows<=I.e.r&&(b["!fullref"]=b["!ref"],I.e.r=r.sheetRows-1,b["!ref"]=St(I)),D.length&&(b["!merges"]=D),G.length&&(b["!rows"]=G),f.name=f.名称||f.name,typeof JSON<"u"&&JSON.stringify(f),m.push(f.name),x[f.name]=b,ae=!1):v[0].charAt(v[0].length-2)!=="/"&&(f=vt(v[0],!1),T=B=-1,I.s.r=I.s.c=1e7,I.e.r=I.e.c=0,b=r.dense?[]:{},D=[],G=[],ae=!0);break;case"table-row-group":v[1]==="/"?--M:++M;break;case"table-row":case"行":if(v[1]==="/"){T+=K,K=1;break}if(p=vt(v[0],!1),p.行号?T=p.行号-1:T==-1&&(T=0),K=+p["number-rows-repeated"]||1,K<10)for(oe=0;oe<K;++oe)M>0&&(G[T+oe]={level:M});B=-1;break;case"covered-table-cell":v[1]!=="/"&&++B,r.sheetStubs&&(r.dense?(b[T]||(b[T]=[]),b[T][B]={t:"z"}):b[bt({r:T,c:B})]={t:"z"}),_="",E=[];break;case"table-cell":case"数据":if(v[0].charAt(v[0].length-2)==="/")++B,k=vt(v[0],!1),W=parseInt(k["number-columns-repeated"]||"1",10),y={t:"z",v:null},k.formula&&r.cellFormula!=!1&&(y.f=rU(Gt(k.formula))),(k.数据类型||k["value-type"])=="string"&&(y.t="s",y.v=Gt(k["string-value"]||""),r.dense?(b[T]||(b[T]=[]),b[T][B]=y):b[bt({r:T,c:B})]=y),B+=W-1;else if(v[1]!=="/"){++B,_="",C=0,E=[],W=1;var ce=K?T+K-1:T;if(B>I.e.c&&(I.e.c=B),B<I.s.c&&(I.s.c=B),T<I.s.r&&(I.s.r=T),ce>I.e.r&&(I.e.r=ce),k=vt(v[0],!1),O=[],P={},y={t:k.数据类型||k["value-type"],v:null},r.cellFormula)if(k.formula&&(k.formula=Gt(k.formula)),k["number-matrix-columns-spanned"]&&k["number-matrix-rows-spanned"]&&(R=parseInt(k["number-matrix-rows-spanned"],10)||0,Q=parseInt(k["number-matrix-columns-spanned"],10)||0,L={s:{r:T,c:B},e:{r:T+R-1,c:B+Q-1}},y.F=St(L),z.push([L,y.F])),k.formula)y.f=rU(k.formula);else for(oe=0;oe<z.length;++oe)T>=z[oe][0].s.r&&T<=z[oe][0].e.r&&B>=z[oe][0].s.c&&B<=z[oe][0].e.c&&(y.F=z[oe][1]);switch((k["number-columns-spanned"]||k["number-rows-spanned"])&&(R=parseInt(k["number-rows-spanned"],10)||0,Q=parseInt(k["number-columns-spanned"],10)||0,L={s:{r:T,c:B},e:{r:T+R-1,c:B+Q-1}},D.push(L)),k["number-columns-repeated"]&&(W=parseInt(k["number-columns-repeated"],10)),y.t){case"boolean":y.t="b",y.v=Br(k["boolean-value"]);break;case"float":y.t="n",y.v=parseFloat(k.value);break;case"percentage":y.t="n",y.v=parseFloat(k.value);break;case"currency":y.t="n",y.v=parseFloat(k.value);break;case"date":y.t="d",y.v=_r(k["date-value"]),r.cellDates||(y.t="n",y.v=Qa(y.v)),y.z="m/d/yy";break;case"time":y.t="n",y.v=tge(k["time-value"])/86400,r.cellDates&&(y.t="d",y.v=cv(y.v)),y.z="HH:MM:SS";break;case"number":y.t="n",y.v=parseFloat(k.数据数值);break;default:if(y.t==="string"||y.t==="text"||!y.t)y.t="s",k["string-value"]!=null&&(_=Gt(k["string-value"]),E=[]);else throw new Error("Unsupported value type "+y.t)}}else{if(J=!1,y.t==="s"&&(y.v=_||"",E.length&&(y.R=E),J=C==0),Y.Target&&(y.l=Y),O.length>0&&(y.c=O,O=[]),_&&r.cellText!==!1&&(y.w=_),J&&(y.t="z",delete y.v),(!J||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=T))for(var ne=0;ne<K;++ne){if(W=parseInt(k["number-columns-repeated"]||"1",10),r.dense)for(b[T+ne]||(b[T+ne]=[]),b[T+ne][B]=ne==0?y:Tr(y);--W>0;)b[T+ne][B+W]=Tr(y);else for(b[bt({r:T+ne,c:B})]=y;--W>0;)b[bt({r:T+ne,c:B+W})]=Tr(y);I.e.c<=B&&(I.e.c=B)}W=parseInt(k["number-columns-repeated"]||"1",10),B+=W-1,W=0,y={},_="",E=[]}Y={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(v[1]==="/"){if((i=s.pop())[0]!==v[3])throw"Bad state: "+i}else v[0].charAt(v[0].length-2)!=="/"&&s.push([v[3],!0]);break;case"annotation":if(v[1]==="/"){if((i=s.pop())[0]!==v[3])throw"Bad state: "+i;P.t=_,E.length&&(P.R=E),P.a=q,O.push(P)}else v[0].charAt(v[0].length-2)!=="/"&&s.push([v[3],!1]);q="",H=0,_="",C=0,E=[];break;case"creator":v[1]==="/"?q=a.slice(H,v.index):H=v.index+v[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(v[1]==="/"){if((i=s.pop())[0]!==v[3])throw"Bad state: "+i}else v[0].charAt(v[0].length-2)!=="/"&&s.push([v[3],!1]);_="",C=0,E=[];break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if(v[1]==="/"){if(U[o.name]=d,(i=s.pop())[0]!==v[3])throw"Bad state: "+i}else v[0].charAt(v[0].length-2)!=="/"&&(d="",o=vt(v[0],!1),s.push([v[3],!0]));break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":switch(s[s.length-1][0]){case"time-style":case"date-style":l=vt(v[0],!1),d+=lU[v[3]][l.style==="long"?1:0];break}break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(s[s.length-1][0]){case"time-style":case"date-style":l=vt(v[0],!1),d+=lU[v[3]][l.style==="long"?1:0];break}break;case"boolean-style":break;case"boolean":break;case"text-style":break;case"text":if(v[0].slice(-2)==="/>")break;if(v[1]==="/")switch(s[s.length-1][0]){case"number-style":case"date-style":case"time-style":d+=a.slice(u,v.index);break}else u=v.index+v[0].length;break;case"named-range":l=vt(v[0],!1),te=T2(l["cell-range-address"]);var le={Name:l.name,Ref:te[0]+"!"+te[1]};ae&&(le.Sheet=m.length),Z.Names.push(le);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"电子表格":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"文本串":if(["master-styles"].indexOf(s[s.length-1][0])>-1)break;if(v[1]==="/"&&(!k||!k["string-value"])){var ge=Sje(a.slice(C,v.index));_=(_.length>0?_+`
`:"")+ge[0]}else vt(v[0],!1),C=v.index+v[0].length;break;case"s":break;case"database-range":if(v[1]==="/")break;try{te=T2(vt(v[0])["target-range-address"]),x[te[0]]["!autofilter"]={ref:te[1]}}catch{}break;case"date":break;case"object":break;case"title":case"标题":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(v[1]!=="/"){if(Y=vt(v[0],!1),!Y.href)break;Y.Target=Gt(Y.href),delete Y.href,Y.Target.charAt(0)=="#"&&Y.Target.indexOf(".")>-1?(te=T2(Y.Target.slice(1)),Y.Target="#"+te[0]+"!"+te[1]):Y.Target.match(/^\.\.[\\\/]/)&&(Y.Target=Y.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(v[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(r.WTF)throw new Error(v)}}var X={Sheets:x,SheetNames:m,Workbook:Z};return r.bookSheets&&delete X.Sheets,X}function oU(e,t){t=t||{},oi(e,"META-INF/manifest.xml")&&tbe(Na(e,"META-INF/manifest.xml"),t);var r=Ds(e,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var a=cH(hr(r),t);return oi(e,"meta.xml")&&(a.Props=ZQ(Na(e,"meta.xml"))),a}function cU(e,t){return cH(e,t)}var Bje=(function(){var e=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),t="<office:document-styles "+xp({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+e+"</office:document-styles>";return function(){return xa+t}})(),dU=(function(){var e=function(i){return cr(i).replace(/  +/g,function(l){return'<text:s text:c="'+l.length+'"/>'}).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>")},t=`          <table:table-cell />
`,r=`          <table:covered-table-cell/>
`,a=function(i,l,o){var d=[];d.push('      <table:table table:name="'+cr(l.SheetNames[o])+`" table:style-name="ta1">
`);var u=0,f=0,p=xs(i["!ref"]||"A1"),x=i["!merges"]||[],m=0,b=Array.isArray(i);if(i["!cols"])for(f=0;f<=p.e.c;++f)d.push("        <table:table-column"+(i["!cols"][f]?' table:style-name="co'+i["!cols"][f].ods+'"':"")+`></table:table-column>
`);var v="",y=i["!rows"]||[];for(u=0;u<p.s.r;++u)v=y[u]?' table:style-name="ro'+y[u].ods+'"':"",d.push("        <table:table-row"+v+`></table:table-row>
`);for(;u<=p.e.r;++u){for(v=y[u]?' table:style-name="ro'+y[u].ods+'"':"",d.push("        <table:table-row"+v+`>
`),f=0;f<p.s.c;++f)d.push(t);for(;f<=p.e.c;++f){var k=!1,_={},C="";for(m=0;m!=x.length;++m)if(!(x[m].s.c>f)&&!(x[m].s.r>u)&&!(x[m].e.c<f)&&!(x[m].e.r<u)){(x[m].s.c!=f||x[m].s.r!=u)&&(k=!0),_["table:number-columns-spanned"]=x[m].e.c-x[m].s.c+1,_["table:number-rows-spanned"]=x[m].e.r-x[m].s.r+1;break}if(k){d.push(r);continue}var E=bt({r:u,c:f}),T=b?(i[u]||[])[f]:i[E];if(T&&T.f&&(_["table:formula"]=cr(W2e(T.f)),T.F&&T.F.slice(0,E.length)==E)){var B=xs(T.F);_["table:number-matrix-columns-spanned"]=B.e.c-B.s.c+1,_["table:number-matrix-rows-spanned"]=B.e.r-B.s.r+1}if(!T){d.push(t);continue}switch(T.t){case"b":C=T.v?"TRUE":"FALSE",_["office:value-type"]="boolean",_["office:boolean-value"]=T.v?"true":"false";break;case"n":C=T.w||String(T.v||0),_["office:value-type"]="float",_["office:value"]=T.v||0;break;case"s":case"str":C=T.v==null?"":T.v,_["office:value-type"]="string";break;case"d":C=T.w||_r(T.v).toISOString(),_["office:value-type"]="date",_["office:date-value"]=_r(T.v).toISOString(),_["table:style-name"]="ce1";break;default:d.push(t);continue}var I=e(C);if(T.l&&T.l.Target){var M=T.l.Target;M=M.charAt(0)=="#"?"#"+Y2e(M.slice(1)):M,M.charAt(0)!="#"&&!M.match(/^\w+:/)&&(M="../"+M),I=Ke("text:a",I,{"xlink:href":M.replace(/&/g,"&amp;")})}d.push("          "+Ke("table:table-cell",Ke("text:p",I,{}),_)+`
`)}d.push(`        </table:table-row>
`)}return d.push(`      </table:table>
`),d.join("")},s=function(i,l){i.push(` <office:automatic-styles>
`),i.push(`  <number:date-style style:name="N37" number:automatic-order="true">
`),i.push(`   <number:month number:style="long"/>
`),i.push(`   <number:text>/</number:text>
`),i.push(`   <number:day number:style="long"/>
`),i.push(`   <number:text>/</number:text>
`),i.push(`   <number:year/>
`),i.push(`  </number:date-style>
`);var o=0;l.SheetNames.map(function(u){return l.Sheets[u]}).forEach(function(u){if(u&&u["!cols"]){for(var f=0;f<u["!cols"].length;++f)if(u["!cols"][f]){var p=u["!cols"][f];if(p.width==null&&p.wpx==null&&p.wch==null)continue;Dc(p),p.ods=o;var x=u["!cols"][f].wpx+"px";i.push('  <style:style style:name="co'+o+`" style:family="table-column">
`),i.push('   <style:table-column-properties fo:break-before="auto" style:column-width="'+x+`"/>
`),i.push(`  </style:style>
`),++o}}});var d=0;l.SheetNames.map(function(u){return l.Sheets[u]}).forEach(function(u){if(u&&u["!rows"]){for(var f=0;f<u["!rows"].length;++f)if(u["!rows"][f]){u["!rows"][f].ods=d;var p=u["!rows"][f].hpx+"px";i.push('  <style:style style:name="ro'+d+`" style:family="table-row">
`),i.push('   <style:table-row-properties fo:break-before="auto" style:row-height="'+p+`"/>
`),i.push(`  </style:style>
`),++d}}}),i.push(`  <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">
`),i.push(`   <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
`),i.push(`  </style:style>
`),i.push(`  <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
`),i.push(` </office:automatic-styles>
`)};return function(l,o){var d=[xa],u=xp({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),f=xp({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});o.bookType=="fods"?(d.push("<office:document"+u+f+`>
`),d.push(JQ().replace(/office:document-meta/g,"office:meta"))):d.push("<office:document-content"+u+`>
`),s(d,l),d.push(`  <office:body>
`),d.push(`    <office:spreadsheet>
`);for(var p=0;p!=l.SheetNames.length;++p)d.push(a(l.Sheets[l.SheetNames[p]],l,p));return d.push(`    </office:spreadsheet>
`),d.push(`  </office:body>
`),o.bookType=="fods"?d.push("</office:document>"):d.push("</office:document-content>"),d.join("")}})();function dH(e,t){if(t.bookType=="fods")return dU(e,t);var r=sE(),a="",s=[],i=[];return a="mimetype",It(r,a,"application/vnd.oasis.opendocument.spreadsheet"),a="content.xml",It(r,a,dU(e,t)),s.push([a,"text/xml"]),i.push([a,"ContentFile"]),a="styles.xml",It(r,a,Bje(e,t)),s.push([a,"text/xml"]),i.push([a,"StylesFile"]),a="meta.xml",It(r,a,xa+JQ()),s.push([a,"text/xml"]),i.push([a,"MetadataFile"]),a="manifest.rdf",It(r,a,nbe(i)),s.push([a,"application/rdf+xml"]),a="META-INF/manifest.xml",It(r,a,rbe(s)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Yd(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function SC(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):hr(Vc(e))}function _je(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Is(ml(e))}function Tje(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var a=0;a<t.length;++a)if(e[r+a]!=t[a])continue e;return!0}return!1}function Mc(e){var t=e.reduce(function(s,i){return s+i.length},0),r=new Uint8Array(t),a=0;return e.forEach(function(s){r.set(s,a),a+=s.length}),r}function uU(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>>24}function Fje(e,t){for(var r=(e[t+15]&127)<<7|e[t+14]>>1,a=e[t+14]&1,s=t+13;s>=t;--s)a=a*256+e[s];return(e[t+15]&128?-a:a)*Math.pow(10,r-6176)}function Ije(e,t,r){var a=Math.floor(r==0?0:Math.LOG10E*Math.log(Math.abs(r)))+6176-20,s=r/Math.pow(10,a-6176);e[t+15]|=a>>7,e[t+14]|=(a&127)<<1;for(var i=0;s>=1;++i,s/=256)e[t+i]=s&255;e[t+15]|=r>=0?0:128}function Cp(e,t){var r=t?t[0]:0,a=e[r]&127;e:if(e[r++]>=128&&(a|=(e[r]&127)<<7,e[r++]<128||(a|=(e[r]&127)<<14,e[r++]<128)||(a|=(e[r]&127)<<21,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),a}function ir(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function ia(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function Yt(e){for(var t=[],r=[0];r[0]<e.length;){var a=r[0],s=Cp(e,r),i=s&7;s=Math.floor(s/8);var l=0,o;if(s==0)break;switch(i){case 0:{for(var d=r[0];e[r[0]++]>=128;);o=e.slice(d,r[0])}break;case 5:l=4,o=e.slice(r[0],r[0]+l),r[0]+=l;break;case 1:l=8,o=e.slice(r[0],r[0]+l),r[0]+=l;break;case 2:l=Cp(e,r),o=e.slice(r[0],r[0]+l),r[0]+=l;break;case 3:case 4:default:throw new Error("PB Type ".concat(i," for Field ").concat(s," at offset ").concat(a))}var u={data:o,type:i};t[s]==null?t[s]=[u]:t[s].push(u)}return t}function un(e){var t=[];return e.forEach(function(r,a){r.forEach(function(s){s.data&&(t.push(ir(a*8+s.type)),s.type==2&&t.push(ir(s.data.length)),t.push(s.data))})}),Mc(t)}function FE(e,t){return(e==null?void 0:e.map(function(r){return t(r.data)}))||[]}function ii(e){for(var t,r=[],a=[0];a[0]<e.length;){var s=Cp(e,a),i=Yt(e.slice(a[0],a[0]+s));a[0]+=s;var l={id:ia(i[1][0].data),messages:[]};i[2].forEach(function(o){var d=Yt(o.data),u=ia(d[3][0].data);l.messages.push({meta:d,data:e.slice(a[0],a[0]+u)}),a[0]+=u}),(t=i[3])!=null&&t[0]&&(l.merge=ia(i[3][0].data)>>>0>0),r.push(l)}return r}function Wu(e){var t=[];return e.forEach(function(r){var a=[];a[1]=[{data:ir(r.id),type:0}],a[2]=[],r.merge!=null&&(a[3]=[{data:ir(+!!r.merge),type:0}]);var s=[];r.messages.forEach(function(l){s.push(l.data),l.meta[3]=[{type:0,data:ir(l.data.length)}],a[2].push({data:un(l.meta),type:2})});var i=un(a);t.push(ir(i.length)),t.push(i),s.forEach(function(l){return t.push(l)})}),Mc(t)}function Dje(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],a=Cp(t,r),s=[];r[0]<t.length;){var i=t[r[0]]&3;if(i==0){var l=t[r[0]++]>>2;if(l<60)++l;else{var o=l-59;l=t[r[0]],o>1&&(l|=t[r[0]+1]<<8),o>2&&(l|=t[r[0]+2]<<16),o>3&&(l|=t[r[0]+3]<<24),l>>>=0,l++,r[0]+=o}s.push(t.slice(r[0],r[0]+l)),r[0]+=l;continue}else{var d=0,u=0;if(i==1?(u=(t[r[0]]>>2&7)+4,d=(t[r[0]++]&224)<<3,d|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,i==2?(d=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(d=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),s=[Mc(s)],d==0)throw new Error("Invalid offset 0");if(d>s[0].length)throw new Error("Invalid offset beyond length");if(u>=d)for(s.push(s[0].slice(-d)),u-=d;u>=s[s.length-1].length;)s.push(s[s.length-1]),u-=s[s.length-1].length;s.push(s[0].slice(-d,-d+u))}}var f=Mc(s);if(f.length!=a)throw new Error("Unexpected length: ".concat(f.length," != ").concat(a));return f}function li(e){for(var t=[],r=0;r<e.length;){var a=e[r++],s=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(Dje(a,e.slice(r,r+s))),r+=s}if(r!==e.length)throw new Error("data is not a valid framed stream!");return Mc(t)}function Yu(e){for(var t=[],r=0;r<e.length;){var a=Math.min(e.length-r,268435455),s=new Uint8Array(4);t.push(s);var i=ir(a),l=i.length;t.push(i),a<=60?(l++,t.push(new Uint8Array([a-1<<2]))):a<=256?(l+=2,t.push(new Uint8Array([240,a-1&255]))):a<=65536?(l+=3,t.push(new Uint8Array([244,a-1&255,a-1>>8&255]))):a<=16777216?(l+=4,t.push(new Uint8Array([248,a-1&255,a-1>>8&255,a-1>>16&255]))):a<=4294967296&&(l+=5,t.push(new Uint8Array([252,a-1&255,a-1>>8&255,a-1>>16&255,a-1>>>24&255]))),t.push(e.slice(r,r+a)),l+=a,s[0]=0,s[1]=l&255,s[2]=l>>8&255,s[3]=l>>16&255,r+=a}return Mc(t)}function Uje(e,t,r,a){var s=Yd(e),i=s.getUint32(4,!0),l=(a>1?12:8)+uU(i&(a>1?3470:398))*4,o=-1,d=-1,u=NaN,f=new Date(2001,0,1);i&512&&(o=s.getUint32(l,!0),l+=4),l+=uU(i&(a>1?12288:4096))*4,i&16&&(d=s.getUint32(l,!0),l+=4),i&32&&(u=s.getFloat64(l,!0),l+=8),i&64&&(f.setTime(f.getTime()+s.getFloat64(l,!0)*1e3),l+=8);var p;switch(e[2]){case 0:break;case 2:p={t:"n",v:u};break;case 3:p={t:"s",v:t[d]};break;case 5:p={t:"d",v:f};break;case 6:p={t:"b",v:u>0};break;case 7:p={t:"n",v:u/86400};break;case 8:p={t:"e",v:0};break;case 9:if(o>-1)p={t:"s",v:r[o]};else if(d>-1)p={t:"s",v:t[d]};else if(!isNaN(u))p={t:"n",v:u};else throw new Error("Unsupported cell type ".concat(e.slice(0,4)));break;default:throw new Error("Unsupported cell type ".concat(e.slice(0,4)))}return p}function Mje(e,t,r){var a=Yd(e),s=a.getUint32(8,!0),i=12,l=-1,o=-1,d=NaN,u=NaN,f=new Date(2001,0,1);s&1&&(d=Fje(e,i),i+=16),s&2&&(u=a.getFloat64(i,!0),i+=8),s&4&&(f.setTime(f.getTime()+a.getFloat64(i,!0)*1e3),i+=8),s&8&&(o=a.getUint32(i,!0),i+=4),s&16&&(l=a.getUint32(i,!0),i+=4);var p;switch(e[1]){case 0:break;case 2:p={t:"n",v:d};break;case 3:p={t:"s",v:t[o]};break;case 5:p={t:"d",v:f};break;case 6:p={t:"b",v:u>0};break;case 7:p={t:"n",v:u/86400};break;case 8:p={t:"e",v:0};break;case 9:if(l>-1)p={t:"s",v:r[l]};else throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(s&31," : ").concat(e.slice(0,4)));break;case 10:p={t:"n",v:d};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(s&31," : ").concat(e.slice(0,4)))}return p}function I2(e,t){var r=new Uint8Array(32),a=Yd(r),s=12,i=0;switch(r[0]=5,e.t){case"n":r[1]=2,Ije(r,s,e.v),i|=1,s+=16;break;case"b":r[1]=6,a.setFloat64(s,e.v?1:0,!0),i|=2,s+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,a.setUint32(s,t.indexOf(e.v),!0),i|=8,s+=4;break;default:throw"unsupported cell type "+e.t}return a.setUint32(8,i,!0),r.slice(0,s)}function D2(e,t){var r=new Uint8Array(32),a=Yd(r),s=12,i=0;switch(r[0]=3,e.t){case"n":r[2]=2,a.setFloat64(s,e.v,!0),i|=32,s+=8;break;case"b":r[2]=6,a.setFloat64(s,e.v?1:0,!0),i|=32,s+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,a.setUint32(s,t.indexOf(e.v),!0),i|=16,s+=4;break;default:throw"unsupported cell type "+e.t}return a.setUint32(4,i,!0),r.slice(0,s)}function Rje(e,t,r){switch(e[0]){case 0:case 1:case 2:case 3:return Uje(e,t,r,e[0]);case 5:return Mje(e,t,r);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function _n(e){var t=Yt(e);return Cp(t[1][0].data)}function AU(e,t){var r=Yt(t.data),a=ia(r[1][0].data),s=r[3],i=[];return(s||[]).forEach(function(l){var o=Yt(l.data),d=ia(o[1][0].data)>>>0;switch(a){case 1:i[d]=SC(o[3][0].data);break;case 8:{var u=e[_n(o[9][0].data)][0],f=Yt(u.data),p=e[_n(f[1][0].data)][0],x=ia(p.meta[1][0].data);if(x!=2001)throw new Error("2000 unexpected reference to ".concat(x));var m=Yt(p.data);i[d]=m[3].map(function(b){return SC(b.data)}).join("")}break}}),i}function Oje(e,t){var r,a,s,i,l,o,d,u,f,p,x,m,b,v,y=Yt(e),k=ia(y[1][0].data)>>>0,_=ia(y[2][0].data)>>>0,C=((a=(r=y[8])==null?void 0:r[0])==null?void 0:a.data)&&ia(y[8][0].data)>0||!1,E,T;if((i=(s=y[7])==null?void 0:s[0])!=null&&i.data&&t!=0)E=(o=(l=y[7])==null?void 0:l[0])==null?void 0:o.data,T=(u=(d=y[6])==null?void 0:d[0])==null?void 0:u.data;else if((p=(f=y[4])==null?void 0:f[0])!=null&&p.data&&t!=1)E=(m=(x=y[4])==null?void 0:x[0])==null?void 0:m.data,T=(v=(b=y[3])==null?void 0:b[0])==null?void 0:v.data;else throw"NUMBERS Tile missing ".concat(t," cell storage");for(var B=C?4:1,I=Yd(E),M=[],U=0;U<E.length/2;++U){var D=I.getUint16(U*2,!0);D<65535&&M.push([U,D])}if(M.length!=_)throw"Expected ".concat(_," cells, found ").concat(M.length);var L=[];for(U=0;U<M.length-1;++U)L[M[U][0]]=T.subarray(M[U][1]*B,M[U+1][1]*B);return M.length>=1&&(L[M[M.length-1][0]]=T.subarray(M[M.length-1][1]*B)),{R:k,cells:L}}function Pje(e,t){var r,a=Yt(t.data),s=(r=a==null?void 0:a[7])!=null&&r[0]?ia(a[7][0].data)>>>0>0?1:0:-1,i=FE(a[5],function(l){return Oje(l,s)});return{nrows:ia(a[4][0].data)>>>0,data:i.reduce(function(l,o){return l[o.R]||(l[o.R]=[]),o.cells.forEach(function(d,u){if(l[o.R][u])throw new Error("Duplicate cell r=".concat(o.R," c=").concat(u));l[o.R][u]=d}),l},[])}}function Lje(e,t,r){var a,s=Yt(t.data),i={s:{r:0,c:0},e:{r:0,c:0}};if(i.e.r=(ia(s[6][0].data)>>>0)-1,i.e.r<0)throw new Error("Invalid row varint ".concat(s[6][0].data));if(i.e.c=(ia(s[7][0].data)>>>0)-1,i.e.c<0)throw new Error("Invalid col varint ".concat(s[7][0].data));r["!ref"]=St(i);var l=Yt(s[4][0].data),o=AU(e,e[_n(l[4][0].data)][0]),d=(a=l[17])!=null&&a[0]?AU(e,e[_n(l[17][0].data)][0]):[],u=Yt(l[3][0].data),f=0;u[1].forEach(function(p){var x=Yt(p.data),m=e[_n(x[2][0].data)][0],b=ia(m.meta[1][0].data);if(b!=6002)throw new Error("6001 unexpected reference to ".concat(b));var v=Pje(e,m);v.data.forEach(function(y,k){y.forEach(function(_,C){var E=bt({r:f+k,c:C}),T=Rje(_,o,d);T&&(r[E]=T)})}),f+=v.nrows})}function Qje(e,t){var r=Yt(t.data),a={"!ref":"A1"},s=e[_n(r[2][0].data)],i=ia(s[0].meta[1][0].data);if(i!=6001)throw new Error("6000 unexpected reference to ".concat(i));return Lje(e,s[0],a),a}function Hje(e,t){var r,a=Yt(t.data),s={name:(r=a[1])!=null&&r[0]?SC(a[1][0].data):"",sheets:[]},i=FE(a[2],_n);return i.forEach(function(l){e[l].forEach(function(o){var d=ia(o.meta[1][0].data);d==6e3&&s.sheets.push(Qje(e,o))})}),s}function zje(e,t){var r=OE(),a=Yt(t.data),s=FE(a[1],_n);if(s.forEach(function(i){e[i].forEach(function(l){var o=ia(l.meta[1][0].data);if(o==2){var d=Hje(e,l);d.sheets.forEach(function(u,f){PE(r,u,f==0?d.name:d.name+"_"+f,!0)})}})}),r.SheetNames.length==0)throw new Error("Empty NUMBERS file");return r}function U2(e){var t,r,a,s,i={},l=[];if(e.FullPaths.forEach(function(d){if(d.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),e.FileIndex.forEach(function(d){if(d.name.match(/\.iwa$/)){var u;try{u=li(d.content)}catch(p){return console.log("?? "+d.content.length+" "+(p.message||p))}var f;try{f=ii(u)}catch(p){return console.log("## "+(p.message||p))}f.forEach(function(p){i[p.id]=p.messages,l.push(p.id)})}}),!l.length)throw new Error("File has no messages");var o=((s=(a=(r=(t=i==null?void 0:i[1])==null?void 0:t[0])==null?void 0:r.meta)==null?void 0:a[1])==null?void 0:s[0].data)&&ia(i[1][0].meta[1][0].data)==1&&i[1][0];if(o||l.forEach(function(d){i[d].forEach(function(u){var f=ia(u.meta[1][0].data)>>>0;if(f==1)if(!o)o=u;else throw new Error("Document has multiple roots")})}),!o)throw new Error("Cannot find Document root");return zje(i,o)}function $je(e,t,r){var a,s,i,l;if(!((a=e[6])!=null&&a[0])||!((s=e[7])!=null&&s[0]))throw"Mutation only works on post-BNC storages!";var o=((l=(i=e[8])==null?void 0:i[0])==null?void 0:l.data)&&ia(e[8][0].data)>0||!1;if(o)throw"Math only works with normal offsets";for(var d=0,u=Yd(e[7][0].data),f=0,p=[],x=Yd(e[4][0].data),m=0,b=[],v=0;v<t.length;++v){if(t[v]==null){u.setUint16(v*2,65535,!0),x.setUint16(v*2,65535);continue}u.setUint16(v*2,f,!0),x.setUint16(v*2,m,!0);var y,k;switch(typeof t[v]){case"string":y=I2({t:"s",v:t[v]},r),k=D2({t:"s",v:t[v]},r);break;case"number":y=I2({t:"n",v:t[v]},r),k=D2({t:"n",v:t[v]},r);break;case"boolean":y=I2({t:"b",v:t[v]},r),k=D2({t:"b",v:t[v]},r);break;default:throw new Error("Unsupported value "+t[v])}p.push(y),f+=y.length,b.push(k),m+=k.length,++d}for(e[2][0].data=ir(d);v<e[7][0].data.length/2;++v)u.setUint16(v*2,65535,!0),x.setUint16(v*2,65535,!0);return e[6][0].data=Mc(p),e[3][0].data=Mc(b),d}function Vje(e,t){if(!t||!t.numbers)throw new Error("Must pass a `numbers` option -- check the README");var r=e.Sheets[e.SheetNames[0]];e.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var a=xs(r["!ref"]);a.s.r=a.s.c=0;var s=!1;a.e.c>9&&(s=!0,a.e.c=9),a.e.r>49&&(s=!0,a.e.r=49),s&&console.error("The Numbers writer is currently limited to ".concat(St(a)));var i=Yg(r,{range:a,header:1}),l=["~Sh33tJ5~"];i.forEach(function(q){return q.forEach(function(H){typeof H=="string"&&l.push(H)})});var o={},d=[],u=ut.read(t.numbers,{type:"base64"});u.FileIndex.map(function(q,H){return[q,u.FullPaths[H]]}).forEach(function(q){var H=q[0],J=q[1];if(H.type==2&&H.name.match(/\.iwa/)){var ae=H.content,oe=li(ae),ce=ii(oe);ce.forEach(function(ne){d.push(ne.id),o[ne.id]={deps:[],location:J,type:ia(ne.messages[0].meta[1][0].data)}})}}),d.sort(function(q,H){return q-H});var f=d.filter(function(q){return q>1}).map(function(q){return[q,ir(q)]});u.FileIndex.map(function(q,H){return[q,u.FullPaths[H]]}).forEach(function(q){var H=q[0];if(q[1],!!H.name.match(/\.iwa/)){var J=ii(li(H.content));J.forEach(function(ae){ae.messages.forEach(function(oe){f.forEach(function(ce){ae.messages.some(function(ne){return ia(ne.meta[1][0].data)!=11006&&Tje(ne.data,ce[1])})&&o[ce[0]].deps.push(ae.id)})})})}});for(var p=ut.find(u,o[1].location),x=ii(li(p.content)),m,b=0;b<x.length;++b){var v=x[b];v.id==1&&(m=v)}var y=_n(Yt(m.messages[0].data)[1][0].data);for(p=ut.find(u,o[y].location),x=ii(li(p.content)),b=0;b<x.length;++b)v=x[b],v.id==y&&(m=v);for(y=_n(Yt(m.messages[0].data)[2][0].data),p=ut.find(u,o[y].location),x=ii(li(p.content)),b=0;b<x.length;++b)v=x[b],v.id==y&&(m=v);for(y=_n(Yt(m.messages[0].data)[2][0].data),p=ut.find(u,o[y].location),x=ii(li(p.content)),b=0;b<x.length;++b)v=x[b],v.id==y&&(m=v);var k=Yt(m.messages[0].data);{k[6][0].data=ir(a.e.r+1),k[7][0].data=ir(a.e.c+1);var _=_n(k[46][0].data),C=ut.find(u,o[_].location),E=ii(li(C.content));{for(var T=0;T<E.length&&E[T].id!=_;++T);if(E[T].id!=_)throw"Bad ColumnRowUIDMapArchive";var B=Yt(E[T].messages[0].data);B[1]=[],B[2]=[],B[3]=[];for(var I=0;I<=a.e.c;++I){var M=[];M[1]=M[2]=[{type:0,data:ir(I+420690)}],B[1].push({type:2,data:un(M)}),B[2].push({type:0,data:ir(I)}),B[3].push({type:0,data:ir(I)})}B[4]=[],B[5]=[],B[6]=[];for(var U=0;U<=a.e.r;++U)M=[],M[1]=M[2]=[{type:0,data:ir(U+726270)}],B[4].push({type:2,data:un(M)}),B[5].push({type:0,data:ir(U)}),B[6].push({type:0,data:ir(U)});E[T].messages[0].data=un(B)}C.content=Yu(Wu(E)),C.size=C.content.length,delete k[46];var D=Yt(k[4][0].data);{D[7][0].data=ir(a.e.r+1);var L=Yt(D[1][0].data),R=_n(L[2][0].data);C=ut.find(u,o[R].location),E=ii(li(C.content));{if(E[0].id!=R)throw"Bad HeaderStorageBucket";var Q=Yt(E[0].messages[0].data);for(U=0;U<i.length;++U){var G=Yt(Q[2][0].data);G[1][0].data=ir(U),G[4][0].data=ir(i[U].length),Q[2][U]={type:Q[2][0].type,data:un(G)}}E[0].messages[0].data=un(Q)}C.content=Yu(Wu(E)),C.size=C.content.length;var K=_n(D[2][0].data);C=ut.find(u,o[K].location),E=ii(li(C.content));{if(E[0].id!=K)throw"Bad HeaderStorageBucket";for(Q=Yt(E[0].messages[0].data),I=0;I<=a.e.c;++I)G=Yt(Q[2][0].data),G[1][0].data=ir(I),G[4][0].data=ir(a.e.r+1),Q[2][I]={type:Q[2][0].type,data:un(G)};E[0].messages[0].data=un(Q)}C.content=Yu(Wu(E)),C.size=C.content.length;var W=_n(D[4][0].data);(function(){for(var q=ut.find(u,o[W].location),H=ii(li(q.content)),J,ae=0;ae<H.length;++ae){var oe=H[ae];oe.id==W&&(J=oe)}var ce=Yt(J.messages[0].data);{ce[3]=[];var ne=[];l.forEach(function(X,pe){ne[1]=[{type:0,data:ir(pe)}],ne[2]=[{type:0,data:ir(1)}],ne[3]=[{type:2,data:_je(X)}],ce[3].push({type:2,data:un(ne)})})}J.messages[0].data=un(ce);var le=Wu(H),ge=Yu(le);q.content=ge,q.size=q.content.length})();var z=Yt(D[3][0].data);{var Z=z[1][0];delete z[2];var Y=Yt(Z.data);{var te=_n(Y[2][0].data);(function(){for(var q=ut.find(u,o[te].location),H=ii(li(q.content)),J,ae=0;ae<H.length;++ae){var oe=H[ae];oe.id==te&&(J=oe)}var ce=Yt(J.messages[0].data);{delete ce[6],delete z[7];var ne=new Uint8Array(ce[5][0].data);ce[5]=[];for(var le=0,ge=0;ge<=a.e.r;++ge){var X=Yt(ne);le+=$je(X,i[ge],l),X[1][0].data=ir(ge),ce[5].push({data:un(X),type:2})}ce[1]=[{type:0,data:ir(a.e.c+1)}],ce[2]=[{type:0,data:ir(a.e.r+1)}],ce[3]=[{type:0,data:ir(le)}],ce[4]=[{type:0,data:ir(a.e.r+1)}]}J.messages[0].data=un(ce);var pe=Wu(H),be=Yu(pe);q.content=be,q.size=q.content.length})()}Z.data=un(Y)}D[3][0].data=un(z)}k[4][0].data=un(D)}m.messages[0].data=un(k);var O=Wu(x),P=Yu(O);return p.content=P,p.size=p.content.length,u}function uH(e){return function(r){for(var a=0;a!=e.length;++a){var s=e[a];r[s[0]]===void 0&&(r[s[0]]=s[1]),s[2]==="n"&&(r[s[0]]=Number(r[s[0]]))}}}function IE(e){uH([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)}function DE(e){uH([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(e)}function Gje(e){return Ut.WS.indexOf(e)>-1?"sheet":e==Ut.CS?"chart":e==Ut.DS?"dialog":e==Ut.MS?"macro":e&&e.length?e:"sheet"}function Kje(e,t){if(!e)return 0;try{e=t.map(function(a){return a.id||(a.id=a.strRelID),[a.name,e["!id"][a.id].Target,Gje(e["!id"][a.id].Type)]})}catch{return null}return!e||e.length===0?null:e}function qje(e,t,r,a,s,i,l,o,d,u,f,p){try{i[a]=Df(Ds(e,r,!0),t);var x=Na(e,t),m;switch(o){case"sheet":m=xke(x,t,s,d,i[a],u,f,p);break;case"chart":if(m=mke(x,t,s,d,i[a],u,f,p),!m||!m["!drawel"])break;var b=wf(m["!drawel"].Target,t),v=gp(b),y=awe(Ds(e,b,!0),Df(Ds(e,v,!0),b)),k=wf(y,b),_=gp(k);m=$Ce(Ds(e,k,!0),k,d,Df(Ds(e,_,!0),k),u,m);break;case"macro":m=gke(x,t,s,d,i[a],u,f,p);break;case"dialog":m=bke(x,t,s,d,i[a],u,f,p);break;default:throw new Error("Unrecognized sheet type "+o)}l[a]=m;var C=[];i&&i[a]&&oa(i[a]).forEach(function(E){var T="";if(i[a][E].Type==Ut.CMNT){T=wf(i[a][E].Target,t);var B=Nke(Na(e,T,!0),T,d);if(!B||!B.length)return;XD(m,B,!1)}i[a][E].Type==Ut.TCMNT&&(T=wf(i[a][E].Target,t),C=C.concat(swe(Na(e,T,!0),d)))}),C&&C.length&&XD(m,C,!0,d.people||[])}catch(E){if(d.WTF)throw E}}function ri(e){return e.charAt(0)=="/"?e.slice(1):e}function Wje(e,t){if(t0(),t=t||{},IE(t),oi(e,"META-INF/manifest.xml")||oi(e,"objectdata.xml"))return oU(e,t);if(oi(e,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof U2<"u"){if(e.FileIndex)return U2(e);var r=ut.utils.cfb_new();return gD(e).forEach(function(G){It(r,G,ige(e,G))}),U2(r)}throw new Error("Unsupported NUMBERS file")}if(!oi(e,"[Content_Types].xml"))throw oi(e,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):oi(e,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var a=gD(e),s=Zge(Ds(e,"[Content_Types].xml")),i=!1,l,o;if(s.workbooks.length===0&&(o="xl/workbook.xml",Na(e,o,!0)&&s.workbooks.push(o)),s.workbooks.length===0){if(o="xl/workbook.bin",!Na(e,o,!0))throw new Error("Could not find workbook");s.workbooks.push(o),i=!0}s.workbooks[0].slice(-3)=="bin"&&(i=!0);var d={},u={};if(!t.bookSheets&&!t.bookProps){if(Uf=[],s.sst)try{Uf=wke(Na(e,ri(s.sst)),s.sst,t)}catch(G){if(t.WTF)throw G}t.cellStyles&&s.themes.length&&(d=yke(Ds(e,s.themes[0].replace(/^\//,""),!0)||"",s.themes[0],t)),s.style&&(u=vke(Na(e,ri(s.style)),s.style,d,t))}s.links.map(function(G){try{var K=Df(Ds(e,gp(ri(G))),G);return kke(Na(e,ri(G)),K,G,t)}catch{}});var f=hke(Na(e,ri(s.workbooks[0])),s.workbooks[0],t),p={},x="";s.coreprops.length&&(x=Na(e,ri(s.coreprops[0]),!0),x&&(p=ZQ(x)),s.extprops.length!==0&&(x=Na(e,ri(s.extprops[0]),!0),x&&ibe(x,p,t)));var m={};(!t.bookSheets||t.bookProps)&&s.custprops.length!==0&&(x=Ds(e,ri(s.custprops[0]),!0),x&&(m=obe(x,t)));var b={};if((t.bookSheets||t.bookProps)&&(f.Sheets?l=f.Sheets.map(function(K){return K.name}):p.Worksheets&&p.SheetNames.length>0&&(l=p.SheetNames),t.bookProps&&(b.Props=p,b.Custprops=m),t.bookSheets&&typeof l<"u"&&(b.SheetNames=l),t.bookSheets?b.SheetNames:t.bookProps))return b;l={};var v={};t.bookDeps&&s.calcchain&&(v=Cke(Na(e,ri(s.calcchain)),s.calcchain));var y=0,k={},_,C;{var E=f.Sheets;p.Worksheets=E.length,p.SheetNames=[];for(var T=0;T!=E.length;++T)p.SheetNames[T]=E[T].name}var B=i?"bin":"xml",I=s.workbooks[0].lastIndexOf("/"),M=(s.workbooks[0].slice(0,I+1)+"_rels/"+s.workbooks[0].slice(I+1)+".rels").replace(/^\//,"");oi(e,M)||(M="xl/_rels/workbook."+B+".rels");var U=Df(Ds(e,M,!0),M.replace(/_rels.*/,"s5s"));(s.metadata||[]).length>=1&&(t.xlmeta=jke(Na(e,ri(s.metadata[0])),s.metadata[0],t)),(s.people||[]).length>=1&&(t.people=lwe(Na(e,ri(s.people[0])),t)),U&&(U=Kje(U,f.Sheets));var D=Na(e,"xl/worksheets/sheet.xml",!0)?1:0;e:for(y=0;y!=p.Worksheets;++y){var L="sheet";if(U&&U[y]?(_="xl/"+U[y][1].replace(/[\/]?xl\//,""),oi(e,_)||(_=U[y][1]),oi(e,_)||(_=M.replace(/_rels\/.*$/,"")+U[y][1]),L=U[y][2]):(_="xl/worksheets/sheet"+(y+1-D)+"."+B,_=_.replace(/sheet0\./,"sheet.")),C=_.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&t.sheets!=null)switch(typeof t.sheets){case"number":if(y!=t.sheets)continue e;break;case"string":if(p.SheetNames[y].toLowerCase()!=t.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var R=!1,Q=0;Q!=t.sheets.length;++Q)typeof t.sheets[Q]=="number"&&t.sheets[Q]==y&&(R=1),typeof t.sheets[Q]=="string"&&t.sheets[Q].toLowerCase()==p.SheetNames[y].toLowerCase()&&(R=1);if(!R)continue e}}qje(e,_,C,p.SheetNames[y],y,k,l,L,t,f,d,u)}return b={Directory:s,Workbook:f,Props:p,Custprops:m,Deps:v,Sheets:l,SheetNames:p.SheetNames,Strings:Uf,Styles:u,Themes:d,SSF:Tr(gt)},t&&t.bookFiles&&(e.files?(b.keys=a,b.files=e.files):(b.keys=[],b.files={},e.FullPaths.forEach(function(G,K){G=G.replace(/^Root Entry[\/]/,""),b.keys.push(G),b.files[G]=e.FileIndex[K]}))),t&&t.bookVBA&&(s.vba.length>0?b.vbaraw=Na(e,ri(s.vba[0]),!0):s.defaults&&s.defaults.bin===hwe&&(b.vbaraw=Na(e,"xl/vbaProject.bin",!0))),b}function Yje(e,t){var r=t||{},a="Workbook",s=ut.find(e,a);try{if(a="/!DataSpaces/Version",s=ut.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(j1e(s.content),a="/!DataSpaces/DataSpaceMap",s=ut.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var i=S1e(s.content);if(i.length!==1||i[0].comps.length!==1||i[0].comps[0].t!==0||i[0].name!=="StrongEncryptionDataSpace"||i[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",s=ut.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var l=B1e(s.content);if(l.length!=1||l[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",s=ut.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);T1e(s.content)}catch{}if(a="/EncryptionInfo",s=ut.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var o=F1e(s.content);if(a="/EncryptedPackage",s=ut.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(o[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(o[1],s.content,r.password||"",r);if(o[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(o[1],s.content,r.password||"",r);throw new Error("File is password-protected")}function Xje(e,t){return t.bookType=="ods"?dH(e,t):t.bookType=="numbers"?Vje(e,t):t.bookType=="xlsb"?Jje(e,t):Zje(e,t)}function Jje(e,t){pA=1024,e&&!e.SSF&&(e.SSF=Tr(gt)),e&&e.SSF&&(t0(),iv(e.SSF),t.revssf=ov(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Mf?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r=t.bookType=="xlsb"?"bin":"xml",a=O9.indexOf(t.bookType)>-1,s=bE();DE(t=t||{});var i=sE(),l="",o=0;if(t.cellXfs=[],Kc(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",It(i,l,e9(e.Props,t)),s.coreprops.push(l),lr(t.rels,2,l,Ut.CORE_PROPS),l="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var d=[],u=0;u<e.SheetNames.length;++u)(e.Workbook.Sheets[u]||{}).Hidden!=2&&d.push(e.SheetNames[u]);e.Props.SheetNames=d}for(e.Props.Worksheets=e.Props.SheetNames.length,It(i,l,a9(e.Props)),s.extprops.push(l),lr(t.rels,3,l,Ut.EXT_PROPS),e.Custprops!==e.Props&&oa(e.Custprops||{}).length>0&&(l="docProps/custom.xml",It(i,l,n9(e.Custprops)),s.custprops.push(l),lr(t.rels,4,l,Ut.CUST_PROPS)),o=1;o<=e.SheetNames.length;++o){var f={"!id":{}},p=e.Sheets[e.SheetNames[o-1]],x=(p||{})["!type"]||"sheet";switch(x){case"chart":default:l="xl/worksheets/sheet"+o+"."+r,It(i,l,Ske(o-1,l,t,e,f)),s.sheets.push(l),lr(t.wbrels,-1,"worksheets/sheet"+o+"."+r,Ut.WS[0])}if(p){var m=p["!comments"],b=!1,v="";m&&m.length>0&&(v="xl/comments"+o+"."+r,It(i,v,Tke(m,v)),s.comments.push(v),lr(f,-1,"../comments"+o+"."+r,Ut.CMNT),b=!0),p["!legacy"]&&b&&It(i,"xl/drawings/vmlDrawing"+o+".vml",M9(o,p["!comments"])),delete p["!comments"],delete p["!legacy"]}f["!id"].rId1&&It(i,gp(l),yA(f))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,It(i,l,_ke(t.Strings,l,t)),s.strs.push(l),lr(t.wbrels,-1,"sharedStrings."+r,Ut.SST)),l="xl/workbook."+r,It(i,l,Eke(e,l)),s.workbooks.push(l),lr(t.rels,1,l,Ut.WB),l="xl/theme/theme1.xml",It(i,l,kE(e.Themes,t)),s.themes.push(l),lr(t.wbrels,-1,"theme/theme1.xml",Ut.THEME),l="xl/styles."+r,It(i,l,Bke(e,l,t)),s.styles.push(l),lr(t.wbrels,-1,"styles."+r,Ut.STY),e.vbaraw&&a&&(l="xl/vbaProject.bin",It(i,l,e.vbaraw),s.vba.push(l),lr(t.wbrels,-1,"vbaProject.bin",Ut.VBA)),l="xl/metadata."+r,It(i,l,Fke(l)),s.metadata.push(l),lr(t.wbrels,-1,"metadata."+r,Ut.XLMETA),It(i,"[Content_Types].xml",XQ(s,t)),It(i,"_rels/.rels",yA(t.rels)),It(i,"xl/_rels/workbook."+r+".rels",yA(t.wbrels)),delete t.revssf,delete t.ssf,i}function Zje(e,t){pA=1024,e&&!e.SSF&&(e.SSF=Tr(gt)),e&&e.SSF&&(t0(),iv(e.SSF),t.revssf=ov(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Mf?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",a=O9.indexOf(t.bookType)>-1,s=bE();DE(t=t||{});var i=sE(),l="",o=0;if(t.cellXfs=[],Kc(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",It(i,l,e9(e.Props,t)),s.coreprops.push(l),lr(t.rels,2,l,Ut.CORE_PROPS),l="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var d=[],u=0;u<e.SheetNames.length;++u)(e.Workbook.Sheets[u]||{}).Hidden!=2&&d.push(e.SheetNames[u]);e.Props.SheetNames=d}e.Props.Worksheets=e.Props.SheetNames.length,It(i,l,a9(e.Props)),s.extprops.push(l),lr(t.rels,3,l,Ut.EXT_PROPS),e.Custprops!==e.Props&&oa(e.Custprops||{}).length>0&&(l="docProps/custom.xml",It(i,l,n9(e.Custprops)),s.custprops.push(l),lr(t.rels,4,l,Ut.CUST_PROPS));var f=["SheetJ5"];for(t.tcid=0,o=1;o<=e.SheetNames.length;++o){var p={"!id":{}},x=e.Sheets[e.SheetNames[o-1]],m=(x||{})["!type"]||"sheet";switch(m){case"chart":default:l="xl/worksheets/sheet"+o+"."+r,It(i,l,W9(o-1,t,e,p)),s.sheets.push(l),lr(t.wbrels,-1,"worksheets/sheet"+o+"."+r,Ut.WS[0])}if(x){var b=x["!comments"],v=!1,y="";if(b&&b.length>0){var k=!1;b.forEach(function(_){_[1].forEach(function(C){C.T==!0&&(k=!0)})}),k&&(y="xl/threadedComments/threadedComment"+o+"."+r,It(i,y,iwe(b,f,t)),s.threadedcomments.push(y),lr(p,-1,"../threadedComments/threadedComment"+o+"."+r,Ut.TCMNT)),y="xl/comments"+o+"."+r,It(i,y,R9(b)),s.comments.push(y),lr(p,-1,"../comments"+o+"."+r,Ut.CMNT),v=!0}x["!legacy"]&&v&&It(i,"xl/drawings/vmlDrawing"+o+".vml",M9(o,x["!comments"])),delete x["!comments"],delete x["!legacy"]}p["!id"].rId1&&It(i,gp(l),yA(p))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,It(i,l,C9(t.Strings,t)),s.strs.push(l),lr(t.wbrels,-1,"sharedStrings."+r,Ut.SST)),l="xl/workbook."+r,It(i,l,eH(e)),s.workbooks.push(l),lr(t.rels,1,l,Ut.WB),l="xl/theme/theme1.xml",It(i,l,kE(e.Themes,t)),s.themes.push(l),lr(t.wbrels,-1,"theme/theme1.xml",Ut.THEME),l="xl/styles."+r,It(i,l,F9(e,t)),s.styles.push(l),lr(t.wbrels,-1,"styles."+r,Ut.STY),e.vbaraw&&a&&(l="xl/vbaProject.bin",It(i,l,e.vbaraw),s.vba.push(l),lr(t.wbrels,-1,"vbaProject.bin",Ut.VBA)),l="xl/metadata."+r,It(i,l,U9()),s.metadata.push(l),lr(t.wbrels,-1,"metadata."+r,Ut.XLMETA),f.length>1&&(l="xl/persons/person.xml",It(i,l,owe(f)),s.people.push(l),lr(t.wbrels,-1,"persons/person.xml",Ut.PEOPLE)),It(i,"[Content_Types].xml",XQ(s,t)),It(i,"_rels/.rels",yA(t.rels)),It(i,"xl/_rels/workbook."+r+".rels",yA(t.wbrels)),delete t.revssf,delete t.ssf,i}function UE(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=Qs(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function eEe(e,t){return ut.find(e,"EncryptedPackage")?Yje(e,t):nH(e,t)}function tEe(e,t){var r,a=e,s=t||{};return s.type||(s.type=Dt&&Buffer.isBuffer(e)?"buffer":"base64"),r=jQ(a,s),Wje(r,s)}function AH(e,t){var r=0;e:for(;r<e.length;)switch(e.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return jC(e.slice(r),t);default:break e}return DA.to_workbook(e,t)}function rEe(e,t){var r="",a=UE(e,t);switch(t.type){case"base64":r=Qs(e);break;case"binary":r=e;break;case"buffer":r=e.toString("binary");break;case"array":r=Gd(e);break;default:throw new Error("Unrecognized type "+t.type)}return a[0]==239&&a[1]==187&&a[2]==191&&(r=hr(r)),t.type="binary",AH(r,t)}function aEe(e,t){var r=e;return t.type=="base64"&&(r=Qs(r)),r=Ap.utils.decode(1200,r.slice(2),"str"),t.type="binary",AH(r,t)}function nEe(e){return e.match(/[^\x00-\x7F]/)?ml(e):e}function M2(e,t,r,a){return a?(r.type="string",DA.to_workbook(e,r)):DA.to_workbook(t,r)}function BC(e,t){eE();var r=t||{};if(typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer)return BC(new Uint8Array(e),(r=Tr(r),r.type="array",r));typeof Uint8Array<"u"&&e instanceof Uint8Array&&!r.type&&(r.type=typeof Deno<"u"?"buffer":"array");var a=e,s=[0,0,0,0],i=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),NA={},r.dateNF&&(NA.dateNF=r.dateNF),r.type||(r.type=Dt&&Buffer.isBuffer(e)?"buffer":"base64"),r.type=="file"&&(r.type=Dt?"buffer":"binary",a=Jme(e),typeof Uint8Array<"u"&&!Dt&&(r.type="array")),r.type=="string"&&(i=!0,r.type="binary",r.codepage=65001,a=nEe(e)),r.type=="array"&&typeof Uint8Array<"u"&&e instanceof Uint8Array&&typeof ArrayBuffer<"u"){var l=new ArrayBuffer(3),o=new Uint8Array(l);if(o.foo="bar",!o.foo)return r=Tr(r),r.type="array",BC(tE(a),r)}switch((s=UE(a,r))[0]){case 208:if(s[1]===207&&s[2]===17&&s[3]===224&&s[4]===161&&s[5]===177&&s[6]===26&&s[7]===225)return eEe(ut.read(a,r),r);break;case 9:if(s[1]<=8)return nH(a,r);break;case 60:return jC(a,r);case 73:if(s[1]===73&&s[2]===42&&s[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(s[1]===68)return c1e(a,r);break;case 84:if(s[1]===65&&s[2]===66&&s[3]===76)return w9.to_workbook(a,r);break;case 80:return s[1]===75&&s[2]<9&&s[3]<9?tEe(a,r):M2(e,a,r,i);case 239:return s[3]===60?jC(a,r):M2(e,a,r,i);case 255:if(s[1]===254)return aEe(a,r);if(s[1]===0&&s[2]===2&&s[3]===0)return Fd.to_workbook(a,r);break;case 0:if(s[1]===0&&(s[2]>=2&&s[3]===0||s[2]===0&&(s[3]===8||s[3]===9)))return Fd.to_workbook(a,r);break;case 3:case 131:case 139:case 140:return kC.to_workbook(a,r);case 123:if(s[1]===92&&s[2]===114&&s[3]===116)return B9.to_workbook(a,r);break;case 10:case 13:case 32:return rEe(a,r);case 137:if(s[1]===80&&s[2]===78&&s[3]===71)throw new Error("PNG Image File is not a spreadsheet");break}return o1e.indexOf(s[0])>-1&&s[2]<=12&&s[3]<=31?kC.to_workbook(a,r):M2(e,a,r,i)}function fH(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return Yp(t.file,ut.write(e,{type:Dt?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return ut.write(e,t)}function sEe(e,t){var r=Tr(t||{}),a=Xje(e,r);return iEe(a,r)}function iEe(e,t){var r={},a=Dt?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=a;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=a;break;default:throw new Error("Unrecognized type "+t.type)}var s=e.FullPaths?ut.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof s=="string"){if(t.type=="binary"||t.type=="base64")return s;s=new Uint8Array(sv(s))}return t.password&&typeof encrypt_agile<"u"?fH(encrypt_agile(s,t.password),t):t.type==="file"?Yp(t.file,s):t.type=="string"?hr(s):s}function lEe(e,t){var r=t||{},a=nje(e,r);return fH(a,r)}function fl(e,t,r){r||(r="");var a=r+e;switch(t.type){case"base64":return fp(ml(a));case"binary":return ml(a);case"string":return e;case"file":return Yp(t.file,a,"utf8");case"buffer":return Dt?Mo(a,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(a):fl(a,{type:"binary"}).split("").map(function(s){return s.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function oEe(e,t){switch(t.type){case"base64":return fp(e);case"binary":return e;case"string":return e;case"file":return Yp(t.file,e,"binary");case"buffer":return Dt?Mo(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function qx(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",a=0;a<e.length;++a)r+=String.fromCharCode(e[a]);return t.type=="base64"?fp(r):t.type=="string"?hr(r):r;case"file":return Yp(t.file,e);case"buffer":return e;default:throw new Error("Unrecognized type "+t.type)}}function pH(e,t){eE(),eke(e);var r=Tr(t||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),r.type=="array"){r.type="binary";var a=pH(e,r);return r.type="array",sv(a)}var s=0;if(r.sheet&&(typeof r.sheet=="number"?s=r.sheet:s=e.SheetNames.indexOf(r.sheet),!e.SheetNames[s]))throw new Error("Sheet not found: "+r.sheet+" : "+typeof r.sheet);switch(r.bookType||"xlsb"){case"xml":case"xlml":return fl(Xke(e,r),r);case"slk":case"sylk":return fl(y9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"htm":case"html":return fl(iH(e.Sheets[e.SheetNames[s]],r),r);case"txt":return oEe(hH(e.Sheets[e.SheetNames[s]],r),r);case"csv":return fl(RE(e.Sheets[e.SheetNames[s]],r),r,"\uFEFF");case"dif":return fl(w9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"dbf":return qx(kC.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"prn":return fl(DA.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"rtf":return fl(B9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"eth":return fl(N9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"fods":return fl(dH(e,r),r);case"wk1":return qx(Fd.sheet_to_wk1(e.Sheets[e.SheetNames[s]],r),r);case"wk3":return qx(Fd.book_to_wk3(e,r),r);case"biff2":r.biff||(r.biff=2);case"biff3":r.biff||(r.biff=3);case"biff4":return r.biff||(r.biff=4),qx(sH(e,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),lEe(e,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return sEe(e,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function cEe(e){if(!e.bookType){var t={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},r=e.file.slice(e.file.lastIndexOf(".")).toLowerCase();r.match(/^\.[a-z]+$/)&&(e.bookType=r.slice(1)),e.bookType=t[e.bookType]||e.bookType}}function ME(e,t,r){var a={};return a.type="file",a.file=t,cEe(a),pH(e,a)}function dEe(e,t,r,a,s,i,l,o){var d=pa(r),u=o.defval,f=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),p=!0,x=s===1?[]:{};if(s!==1)if(Object.defineProperty)try{Object.defineProperty(x,"__rowNum__",{value:r,enumerable:!1})}catch{x.__rowNum__=r}else x.__rowNum__=r;if(!l||e[r])for(var m=t.s.c;m<=t.e.c;++m){var b=l?e[r][m]:e[a[m]+d];if(b===void 0||b.t===void 0){if(u===void 0)continue;i[m]!=null&&(x[i[m]]=u);continue}var v=b.v;switch(b.t){case"z":if(v==null)break;continue;case"e":v=v==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+b.t)}if(i[m]!=null){if(v==null)if(b.t=="e"&&v===null)x[i[m]]=null;else if(u!==void 0)x[i[m]]=u;else if(f&&v===null)x[i[m]]=null;else continue;else x[i[m]]=f&&(b.t!=="n"||b.t==="n"&&o.rawNumbers!==!1)?v:No(b,v,o);v!=null&&(p=!1)}}return{row:x,isempty:p}}function Yg(e,t){if(e==null||e["!ref"]==null)return[];var r={t:"n",v:0},a=0,s=1,i=[],l=0,o="",d={s:{r:0,c:0},e:{r:0,c:0}},u=t||{},f=u.range!=null?u.range:e["!ref"];switch(u.header===1?a=1:u.header==="A"?a=2:Array.isArray(u.header)?a=3:u.header==null&&(a=0),typeof f){case"string":d=Kt(f);break;case"number":d=Kt(e["!ref"]),d.s.r=f;break;default:d=f}a>0&&(s=0);var p=pa(d.s.r),x=[],m=[],b=0,v=0,y=Array.isArray(e),k=d.s.r,_=0,C={};y&&!e[k]&&(e[k]=[]);var E=u.skipHidden&&e["!cols"]||[],T=u.skipHidden&&e["!rows"]||[];for(_=d.s.c;_<=d.e.c;++_)if(!(E[_]||{}).hidden)switch(x[_]=$r(_),r=y?e[k][_]:e[x[_]+p],a){case 1:i[_]=_-d.s.c;break;case 2:i[_]=x[_];break;case 3:i[_]=u.header[_-d.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),o=l=No(r,null,u),v=C[l]||0,!v)C[l]=1;else{do o=l+"_"+v++;while(C[o]);C[l]=v,C[o]=1}i[_]=o}for(k=d.s.r+s;k<=d.e.r;++k)if(!(T[k]||{}).hidden){var B=dEe(e,d,k,x,a,i,y,u);(B.isempty===!1||(a===1?u.blankrows!==!1:u.blankrows))&&(m[b++]=B.row)}return m.length=b,m}var fU=/"/g;function uEe(e,t,r,a,s,i,l,o){for(var d=!0,u=[],f="",p=pa(r),x=t.s.c;x<=t.e.c;++x)if(a[x]){var m=o.dense?(e[r]||[])[x]:e[a[x]+p];if(m==null)f="";else if(m.v!=null){d=!1,f=""+(o.rawNumbers&&m.t=="n"?m.v:No(m,null,o));for(var b=0,v=0;b!==f.length;++b)if((v=f.charCodeAt(b))===s||v===i||v===34||o.forceQuotes){f='"'+f.replace(fU,'""')+'"';break}f=="ID"&&(f='"ID"')}else m.f!=null&&!m.F?(d=!1,f="="+m.f,f.indexOf(",")>=0&&(f='"'+f.replace(fU,'""')+'"')):f="";u.push(f)}return o.blankrows===!1&&d?null:u.join(l)}function RE(e,t){var r=[],a=t??{};if(e==null||e["!ref"]==null)return"";var s=Kt(e["!ref"]),i=a.FS!==void 0?a.FS:",",l=i.charCodeAt(0),o=a.RS!==void 0?a.RS:`
`,d=o.charCodeAt(0),u=new RegExp((i=="|"?"\\|":i)+"+$"),f="",p=[];a.dense=Array.isArray(e);for(var x=a.skipHidden&&e["!cols"]||[],m=a.skipHidden&&e["!rows"]||[],b=s.s.c;b<=s.e.c;++b)(x[b]||{}).hidden||(p[b]=$r(b));for(var v=0,y=s.s.r;y<=s.e.r;++y)(m[y]||{}).hidden||(f=uEe(e,s,y,p,l,d,i,a),f!=null&&(a.strip&&(f=f.replace(u,"")),(f||a.blankrows!==!1)&&r.push((v++?o:"")+f)));return delete a.dense,r.join("")}function hH(e,t){t||(t={}),t.FS="	",t.RS=`
`;var r=RE(e,t);return r}function AEe(e){var t="",r,a="";if(e==null||e["!ref"]==null)return[];var s=Kt(e["!ref"]),i="",l=[],o,d=[],u=Array.isArray(e);for(o=s.s.c;o<=s.e.c;++o)l[o]=$r(o);for(var f=s.s.r;f<=s.e.r;++f)for(i=pa(f),o=s.s.c;o<=s.e.c;++o)if(t=l[o]+i,r=u?(e[f]||[])[o]:e[t],a="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;a=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)a=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)a=""+r.v;else if(r.t=="b")a=r.v?"TRUE":"FALSE";else if(r.w!==void 0)a="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?a="'"+r.v:a=""+r.v}}d[d.length]=t+"="+a}return d}function xH(e,t,r){var a=r||{},s=+!a.skipHeader,i=e||{},l=0,o=0;if(i&&a.origin!=null)if(typeof a.origin=="number")l=a.origin;else{var d=typeof a.origin=="string"?Vr(a.origin):a.origin;l=d.r,o=d.c}var u,f={s:{c:0,r:0},e:{c:o,r:l+t.length-1+s}};if(i["!ref"]){var p=Kt(i["!ref"]);f.e.c=Math.max(f.e.c,p.e.c),f.e.r=Math.max(f.e.r,p.e.r),l==-1&&(l=p.e.r+1,f.e.r=l+t.length-1+s)}else l==-1&&(l=0,f.e.r=t.length-1+s);var x=a.header||[],m=0;t.forEach(function(v,y){oa(v).forEach(function(k){(m=x.indexOf(k))==-1&&(x[m=x.length]=k);var _=v[k],C="z",E="",T=bt({c:o+m,r:l+y+s});u=kp(i,T),_&&typeof _=="object"&&!(_ instanceof Date)?i[T]=_:(typeof _=="number"?C="n":typeof _=="boolean"?C="b":typeof _=="string"?C="s":_ instanceof Date?(C="d",a.cellDates||(C="n",_=Qa(_)),E=a.dateNF||gt[14]):_===null&&a.nullError&&(C="e",_=0),u?(u.t=C,u.v=_,delete u.w,delete u.R,E&&(u.z=E)):i[T]=u={t:C,v:_},E&&(u.z=E))})}),f.e.c=Math.max(f.e.c,o+x.length-1);var b=pa(l);if(s)for(m=0;m<x.length;++m)i[$r(m+o)+b]={t:"s",v:x[m]};return i["!ref"]=St(f),i}function fEe(e,t){return xH(null,e,t)}function kp(e,t,r){if(typeof t=="string"){if(Array.isArray(e)){var a=Vr(t);return e[a.r]||(e[a.r]=[]),e[a.r][a.c]||(e[a.r][a.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return typeof t!="number"?kp(e,bt(t)):kp(e,bt({r:t,c:r||0}))}function pEe(e,t){if(typeof t=="number"){if(t>=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function OE(){return{SheetNames:[],Sheets:{}}}function PE(e,t,r,a){var s=1;if(!r)for(;s<=65535&&e.SheetNames.indexOf(r="Sheet"+s)!=-1;++s,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(a&&e.SheetNames.indexOf(r)>=0){var i=r.match(/(^.*?)(\d+)$/);s=i&&+i[2]||0;var l=i&&i[1]||r;for(++s;s<=65535&&e.SheetNames.indexOf(r=l+s)!=-1;++s);}if(Z9(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function hEe(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var a=pEe(e,t);switch(e.Workbook.Sheets[a]||(e.Workbook.Sheets[a]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[a].Hidden=r}function xEe(e,t){return e.z=t,e}function mH(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function mEe(e,t,r){return mH(e,"#"+t,r)}function gEe(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function bEe(e,t,r,a){for(var s=typeof t!="string"?t:Kt(t),i=typeof t=="string"?t:St(t),l=s.s.r;l<=s.e.r;++l)for(var o=s.s.c;o<=s.e.c;++o){var d=kp(e,l,o);d.t="n",d.F=i,delete d.v,l==s.s.r&&o==s.s.c&&(d.f=r,a&&(d.D=!0))}return e}var pi={encode_col:$r,encode_row:pa,encode_cell:bt,encode_range:St,decode_col:fE,decode_row:AE,split_cell:_ge,decode_cell:Vr,decode_range:xs,format_cell:No,sheet_add_aoa:$Q,sheet_add_json:xH,sheet_add_dom:lH,aoa_to_sheet:r0,json_to_sheet:fEe,table_to_sheet:oH,table_to_book:jje,sheet_to_csv:RE,sheet_to_txt:hH,sheet_to_json:Yg,sheet_to_html:iH,sheet_to_formulae:AEe,sheet_to_row_object_array:Yg,sheet_get_cell:kp,book_new:OE,book_append_sheet:PE,book_set_sheet_visibility:hEe,cell_set_number_format:xEe,cell_set_hyperlink:mH,cell_set_internal_link:mEe,cell_add_comment:gEe,sheet_set_array_formula:bEe,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const vEe=()=>{const{exchangeRateHistory:e,refreshData:t,loading:r}=ht(),[a,s]=j.useState(""),[i,l]=j.useState(""),[o,d]=j.useState(""),[u,f]=j.useState(Er()),[p,x]=j.useState(!1),[m,b]=j.useState(null),[v,y]=j.useState(new Date().getMonth()),[k,_]=j.useState(new Date().getFullYear()),[C,E]=j.useState(null),[T,B]=j.useState({}),I=j.useRef(null),M=(K,W)=>{let z=K.trim().replace(/"/g,""),Z=W.trim().replace(/"/g,"").replace(",",".");if(!z||!Z)return null;let Y="";const te=z.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/);if(te)Y=`${te[3]}-${te[2].padStart(2,"0")}-${te[1].padStart(2,"0")}`;else{const P=z.match(/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2,4})$/);if(P){let[q,H,J,ae]=P;ae.length===2&&(ae="20"+ae),Y=`${ae}-${J.padStart(2,"0")}-${H.padStart(2,"0")}`}else Y=z}const O=parseFloat(Z);return Y.length===10&&!isNaN(O)?{date:Y,val:O}:null},U=K=>{var Z;const W=(Z=K.target.files)==null?void 0:Z[0];if(!W)return;const z=new FileReader;z.onload=async Y=>{var te;try{const O=new Uint8Array((te=Y.target)==null?void 0:te.result),P=BC(O,{type:"array"}),q=P.SheetNames[0],H=P.Sheets[q],J=pi.sheet_to_json(H,{header:1});if(J.length<2){alert("El archivo parece estar vacío o no tiene la estructura correcta.");return}const ae=[],oe=J[0].map(X=>String(X).toLowerCase().trim()),ce=oe.findIndex(X=>X.includes("fec")||X.includes("date")),ne=oe.findIndex(X=>X.includes("am")||X.includes("mañana")),le=oe.findIndex(X=>X.includes("pm")||X.includes("tarde")||X.includes("último")||X.includes("last")||X.includes("close")),ge=oe.findIndex(X=>X.includes("paralel")||X.includes("blue"));for(let X=1;X<J.length;X++){const pe=J[X];if(!pe||pe.length<2)continue;const be=String(pe[ce!==-1?ce:0]),me=String(pe[ne!==-1?ne:1]),_e=String(pe[le!==-1?le:ne!==-1?ne+1:2]),Te=ge!==-1?String(pe[ge]):null,Xe=M(be,me);if(Xe){const At=parseFloat(me.replace(",",".")),kt=parseFloat(_e.replace(",",".")),Bt=Te?parseFloat(Te.replace(",",".")):kt;!isNaN(At)&&!isNaN(kt)&&ae.push({date:Xe.date,amValue:At,pmValue:kt,parallelValue:isNaN(Bt)?kt:Bt})}}ae.length>0?(x(!0),b(null),await we.saveExchangeRateBatch(ae),alert(`¡Importación Exitosa! ${ae.length} registros cargados.`),await t()):alert("No se encontraron tasas válidas en el archivo. Verifique que las columnas 'Fecha' y 'Tasa' existan.")}catch(O){b(`Error procesando Excel: ${O.message}`)}finally{x(!1),I.current&&(I.current.value="")}},z.readAsArrayBuffer(W)},D=()=>{if(e.length===0)return;const K=`Fecha,Tasa AM,Tasa PM,Tasa Paralela
`,W=e.map(te=>`${te.date},${Number(te.amValue).toFixed(2)},${Number(te.pmValue).toFixed(2)},${Number(te.parallelValue||te.pmValue).toFixed(2)}`).join(`
`),z=new Blob([K+W],{type:"text/csv;charset=utf-8;"}),Z=URL.createObjectURL(z),Y=document.createElement("a");Y.href=Z,Y.download="SAC_Historico_Tasas.csv",Y.click()},L=async()=>{x(!0),b(null);try{await we.syncLiveRate(),await t(),alert("Sincronización completada exitosamente.")}catch(K){b(K.message||"Error al sincronizar tasas.")}finally{x(!1)}},R=j.useMemo(()=>e.filter(K=>{const[W,z]=K.date.split("-").map(Number);return W===k&&z-1===v}).sort((K,W)=>W.date.localeCompare(K.date)),[e,v,k]),Q=async K=>{K.preventDefault();const W=parseFloat(a),z=parseFloat(i)||W,Z=parseFloat(o)||z;if(!(isNaN(W)||W<=0)){x(!0),b(null);try{const Y=u;await we.saveExchangeRate({date:Y,amValue:W,pmValue:z,parallelValue:Z});const[te,O]=Y.split("-").map(Number);y(O-1),_(te),s(""),l(""),d(""),await t(),alert("Tasas registradas correctamente.")}catch{b("Fallo al registrar tasa manual.")}finally{x(!1)}}},G=async()=>{var Z,Y,te;if(!C||!T.date)return;const K=parseFloat(((Z=T.amValue)==null?void 0:Z.toString().replace(",","."))||"0"),W=parseFloat(((Y=T.pmValue)==null?void 0:Y.toString().replace(",","."))||"0"),z=parseFloat(((te=T.parallelValue)==null?void 0:te.toString().replace(",","."))||W.toString());if(isNaN(K)||isNaN(W)||isNaN(z)){alert("Error: Valores numéricos inválidos.");return}x(!0);try{const P=await(await we.saveExchangeRate({...T,amValue:K,pmValue:W,parallelValue:z})).json();P.success?(E(null),await t()):alert(P.error||"Error al guardar edición.")}catch{alert("Error al guardar edición.")}finally{x(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[m&&n.jsxs("div",{className:"bg-red-50 border-l-4 border-red-500 p-6 rounded-2xl flex items-center gap-4 shadow-sm animate-in slide-in-from-top",children:[n.jsx(mK,{className:"text-red-500",size:24}),n.jsx("div",{className:"flex-1 text-red-700 text-sm font-medium",children:m}),n.jsx("button",{onClick:()=>b(null),className:"p-2 text-red-400 hover:bg-red-100 rounded-full",children:n.jsx(ft,{size:18})})]}),n.jsxs("div",{className:"bg-slate-900 text-white p-10 lg:p-14 rounded-[4rem] shadow-2xl relative overflow-hidden group border-b-8 border-blue-600/30",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex items-center gap-8",children:[n.jsx("div",{className:"w-24 h-24 bg-blue-600 rounded-[2.5rem] flex items-center justify-center shadow-2xl shadow-blue-500/40 group-hover:scale-110 transition-transform duration-500",children:n.jsx(La,{size:48})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[11px] font-black uppercase tracking-[0.5em] text-blue-400 mb-2 block",children:"Base de Datos Monetaria SAC"}),n.jsx("h2",{className:"text-5xl font-black tracking-tighter leading-none text-white",children:"Gestión de Divisas"}),n.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[n.jsx("div",{className:`w-3 h-3 rounded-full ${p?"bg-amber-500 animate-ping":"bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.5)]"}`}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:p?"Sincronizando...":"Historial Permanente Activo"})]})]})]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[n.jsx("input",{type:"file",ref:I,onChange:U,accept:".csv, .xlsx, .xls",className:"hidden"}),n.jsxs("button",{onClick:()=>{var K;return(K=I.current)==null?void 0:K.click()},className:"px-8 py-5 bg-emerald-600 hover:bg-emerald-700 rounded-2xl text-white flex items-center gap-3 font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all",children:[n.jsx(OA,{size:20})," Cargar Excel/CSV"]}),n.jsxs("button",{onClick:D,className:"px-8 py-5 bg-white text-slate-900 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl hover:bg-slate-100 transition-all flex items-center gap-3",children:[n.jsx(_a,{size:20})," Exportar Data"]}),n.jsxs("button",{onClick:L,disabled:p,className:"px-8 py-5 bg-blue-600 hover:bg-blue-700 text-white rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-500/20 active:scale-95 transition-all flex items-center gap-3 disabled:opacity-50",children:[p?n.jsx(ot,{size:20,className:"animate-spin"}):n.jsx(sa,{size:20}),"ACTUALIZAR DATA"]})]})]}),n.jsx(ha,{className:"absolute right-[-60px] top-[-60px] w-[500px] h-[500px] text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-4 gap-8",children:[n.jsxs("div",{className:"xl:col-span-1 space-y-8",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-800 mb-6 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(nk,{className:"text-blue-600",size:18})," Filtro de Periodo"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Mes"}),n.jsx("select",{value:v,onChange:K=>y(Number(K.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 mt-2 cursor-pointer",children:Ue.map((K,W)=>n.jsx("option",{value:W,children:K},W))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Año"}),n.jsx("input",{type:"number",value:k,onChange:K=>_(Number(K.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 mt-2"})]})]})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-800 mb-6 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(vl,{className:"text-blue-600",size:18})," Ajuste Diario"]}),n.jsxs("form",{onSubmit:Q,className:"space-y-6",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Fecha de la Tasa"}),n.jsx("input",{type:"date",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 mt-1",value:u,onChange:K=>f(K.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tasa BCV AM (Mañana)"}),n.jsxs("div",{className:"relative mt-1",children:[n.jsx("span",{className:"absolute left-5 top-1/2 -translate-y-1/2 font-black text-slate-300 text-lg",children:"Bs."}),n.jsx("input",{type:"number",step:"0.0001",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-14 py-4 text-2xl font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-600 transition-all font-mono",value:a,onChange:K=>s(K.target.value),placeholder:"00.00"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tasa BCV PM (Tarde)"}),n.jsxs("div",{className:"relative mt-1",children:[n.jsx("span",{className:"absolute left-5 top-1/2 -translate-y-1/2 font-black text-slate-300 text-lg",children:"Bs."}),n.jsx("input",{type:"number",step:"0.0001",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-14 py-4 text-2xl font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-600 transition-all font-mono",value:i,onChange:K=>l(K.target.value),placeholder:"Igual a AM"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tasa Paralela (Blue/Monitor)"}),n.jsxs("div",{className:"relative mt-1",children:[n.jsx("span",{className:"absolute left-5 top-1/2 -translate-y-1/2 font-black text-slate-300 text-lg",children:"Bs."}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-14 py-4 text-2xl font-black text-slate-900 outline-none focus:ring-2 focus:ring-indigo-600 transition-all font-mono",value:o,onChange:K=>d(K.target.value),placeholder:"Promedio"})]})]})]}),n.jsxs("button",{type:"submit",disabled:p||!a,className:"w-full bg-slate-900 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[n.jsx(qn,{size:18})," APLICAR TASAS DEL DÍA"]})]})]})]}),n.jsxs("div",{className:"xl:col-span-3 bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden flex flex-col min-h-[600px]",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50/50",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-blue-600 rounded-xl text-white shadow-lg shadow-blue-100",children:n.jsx(Lr,{size:20})}),n.jsxs("h3",{className:"text-xl font-black text-slate-800 tracking-tight",children:[Ue[v]," ",k]})]}),n.jsxs("button",{onClick:t,className:"text-xs font-black text-blue-600 uppercase tracking-widest hover:underline flex items-center gap-2",children:[n.jsx(ot,{size:14,className:r||p?"animate-spin":""})," Refrescar DB"]})]}),n.jsx("div",{className:"overflow-x-auto flex-1",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/30",children:[n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em]",children:"Fecha del Registro"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-center",children:"BCV (AM)"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-center",children:"BCV (PM)"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-center",children:"Paralela"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:R.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:4,className:"p-32 text-center text-slate-300 font-bold uppercase tracking-widest text-xs italic",children:"Sin datos para este periodo. Use los botones superiores para cargar historial."})}):R.map(K=>{const W=C===K.date;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-7",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400 font-black text-[10px]",children:K.date.split("-")[2]}),n.jsx("span",{className:"font-black text-slate-900 text-lg tracking-tighter",children:K.date})]})}),n.jsx("td",{className:"px-10 py-7 text-center",children:W?n.jsx("input",{type:"number",step:"0.01",className:"w-28 bg-white border-2 border-blue-500 rounded-xl px-3 py-2 text-center font-mono font-black text-blue-600 outline-none",value:T.amValue,onChange:z=>B({...T,amValue:parseFloat(z.target.value)})}):n.jsx("div",{className:`inline-flex items-center gap-3 px-6 py-2.5 rounded-2xl font-mono text-lg font-black transition-all ${Number(K.amValue)>0?"bg-blue-50 text-blue-600 border border-blue-100":"bg-slate-100 text-slate-300"}`,children:Number(K.amValue)>0?Number(K.amValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-center",children:W?n.jsx("input",{type:"number",step:"0.01",className:"w-28 bg-white border-2 border-indigo-500 rounded-xl px-3 py-2 text-center font-mono font-black text-indigo-600 outline-none",value:T.pmValue,onChange:z=>B({...T,pmValue:parseFloat(z.target.value)})}):n.jsx("div",{className:`inline-flex items-center gap-3 px-6 py-2.5 rounded-2xl font-mono text-lg font-black transition-all ${Number(K.pmValue)>0?"bg-indigo-50 text-indigo-600 border border-indigo-100":"bg-slate-100 text-slate-300"}`,children:Number(K.pmValue)>0?Number(K.pmValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-center",children:W?n.jsx("input",{type:"number",step:"0.01",className:"w-28 bg-white border-2 border-amber-500 rounded-xl px-3 py-2 text-center font-mono font-black text-amber-600 outline-none",value:T.parallelValue,onChange:z=>B({...T,parallelValue:parseFloat(z.target.value)})}):n.jsx("div",{className:`inline-flex items-center gap-3 px-6 py-2.5 rounded-2xl font-mono text-lg font-black transition-all ${Number(K.parallelValue)>0?"bg-amber-50 text-amber-600 border border-amber-100":"bg-slate-100 text-slate-300"}`,children:Number(K.parallelValue)>0?Number(K.parallelValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-right",children:n.jsx("div",{className:"flex justify-end gap-3",children:W?n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:G,className:"p-3 bg-emerald-600 text-white rounded-xl shadow-lg active:scale-90 transition-all",children:n.jsx(qn,{size:18})}),n.jsx("button",{onClick:()=>E(null),className:"p-3 bg-red-600 text-white rounded-xl shadow-lg active:scale-90 transition-all",children:n.jsx(ft,{size:18})})]}):n.jsx("button",{onClick:()=>{E(K.date),B(K)},className:"p-4 bg-slate-100 text-slate-400 rounded-2xl hover:bg-blue-600 hover:text-white transition-all opacity-0 group-hover:opacity-100 active:scale-95 shadow-sm",children:n.jsx(vl,{size:18})})})})]},K.date)})})]})})]})]})]})},yEe=({user:e})=>{const{residents:t,properties:r,fees:a,users:s}=ht(),[i,l]=j.useState(new Date().getMonth()),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState("fee"),[p,x]=j.useState(""),[m,b]=j.useState("Comunicado Importante SAC 2026"),[v,y]=j.useState(!1),[k,_]=j.useState([]),[C,E]=j.useState(0),[T,B]=j.useState(!1),M=(()=>{const R=a.find(Q=>Q.month===i&&Q.year===o);return t.filter(Q=>Q.isOwner).map(Q=>{const G=r.find(Y=>Y.id===Q.propertyId),K=s.find(Y=>Y.cedula===Q.cedula),W=Q.phone||(K==null?void 0:K.phone)||"";let z=0,Z="Pendiente";if(R){const Y=R.debts.find(te=>te.propertyId===Q.propertyId);Y&&(z=Number(Y.amountUsd),Z=Y.status)}return{id:Q.id,name:Q.fullName,phone:W,email:K==null?void 0:K.email,telegramId:K==null?void 0:K.telegramChatId,propName:G?`${G.type} ${G.number}`:"S/I",debtAmount:z,status:Z,isPaid:Z==="Pagado"}})})(),U=()=>{const R=M.filter(Q=>Q.phone.replace(/\D/g,"").length>=7);if(R.length===0){alert("SISTEMA: No hay propietarios con números de teléfono válidos.");return}_(R),E(0),B(!0)},D=()=>{const R=k[C];let Q="";u==="fee"?(Q=`🏢 *AVISO DE COBRO - SAC 2026*

`,Q+=`Estimado(a) *${R.name}*,

`,Q+=`Le saludamos desde la *Administración del Condominio El Tejar*. Le informamos que su recibo ya se encuentra disponible para gestión:

`,Q+=`📌 *Inmueble:* ${R.propName}
`,Q+=`📅 *Periodo:* ${Ue[i]} ${o}
`,Q+=`💰 *Monto a Pagar:* $${R.debtAmount.toFixed(2)} USD
`,Q+=`✅ *Estatus:* ${R.status}

`,Q+=`*¿Cómo reportar?*
`,Q+=`Ingrese a nuestra plataforma digital, cargue su comprobante y obtenga su recibo sellado de inmediato.

`,Q+=`🔗 *ACCEDER AL PORTAL:* ${la}

`,Q+="_¡Gracias por su puntual compromiso!_"):(Q=`📢 *COMUNICADO OFICIAL SAC 2026*

`,Q+=`Hola *${R.name}*,

`,Q+=`*Asunto:* ${m}

`,Q+=`${p}

`,Q+=`🔗 *ACCEDER AL PORTAL:* ${la}

`,Q+="_Atentamente, Junta de Condominio El Tejar_");let G=R.phone.trim(),K="";G.startsWith("+")?K=G.replace(/\D/g,""):G.startsWith("0")?K="58"+G.substring(1).replace(/\D/g,""):G.length===10?K="58"+G.replace(/\D/g,""):K=G.replace(/\D/g,"");const W=`https://wa.me/${K}?text=${encodeURIComponent(Q)}`;window.open(W,"_blank"),C<k.length-1?E(z=>z+1):(alert("¡Felicidades! Ha terminado de enviar toda la cola de WhatsApp."),B(!1))},L=async R=>{if(u==="custom"&&!p)return alert("Escriba un mensaje.");if(!confirm(`¿Enviar masivamente por ${R.toUpperCase()} a ${M.length} propietarios?`))return;y(!0);const Q={channel:R,subject:u==="fee"?`Aviso de Cobro SAC 2026 - ${Ue[i]} ${o}`:m,messageType:u,customMessage:p,recipients:M.map(G=>({name:G.name,email:G.email,telegramChatId:G.telegramId,amount:G.debtAmount.toFixed(2),status:G.status,propName:G.propName})),monthName:Ue[i],year:o};try{const G=await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)});if(!G.ok)throw new Error(`HTTP ${G.status}`);const K=await G.json();K.status==="success"?alert(`¡Proceso Completado!
Enviados con éxito: ${K.sent}
Fallidos: ${K.failed}`):alert("Error en el servidor de envío: "+(K.message||"Fallo desconocido."))}catch{alert("Error de conexión con el servidor o sesión expirada.")}finally{y(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Mensajería Masiva ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Difusión global multicanal para la comunidad."})]}),n.jsxs("div",{className:"bg-slate-900 text-white px-6 py-3 rounded-2xl flex items-center gap-4 shadow-xl",children:[n.jsx(Oi,{size:20,className:"text-blue-400"}),n.jsxs("span",{className:"text-sm font-black tracking-tight",children:[M.length," Destinatarios"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"flex gap-4 mb-8",children:[n.jsxs("button",{onClick:()=>f("fee"),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${u==="fee"?"bg-blue-600 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(gr,{size:18})," Aviso de Cobro"]}),n.jsxs("button",{onClick:()=>f("custom"),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${u==="custom"?"bg-indigo-600 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(sk,{size:18})," Comunicado Libre"]})]}),u==="fee"?n.jsxs("div",{className:"grid grid-cols-2 gap-4 animate-in slide-in-from-top",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Mes de Cobro"}),n.jsx("select",{value:i,onChange:R=>l(Number(R.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none",children:Ue.map((R,Q)=>n.jsx("option",{value:Q,children:R},Q))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Año"}),n.jsx("input",{type:"number",value:o,onChange:R=>d(Number(R.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none"})]})]}):n.jsxs("div",{className:"space-y-4 animate-in slide-in-from-bottom",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Asunto del Comunicado"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none",placeholder:"Asunto del Mensaje",value:m,onChange:R=>b(R.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Mensaje"}),n.jsx("textarea",{className:"w-full bg-slate-50 border border-slate-100 rounded-3xl px-5 py-4 font-medium text-slate-800 outline-none min-h-[200px]",placeholder:"Escriba su mensaje aquí...",value:p,onChange:R=>x(R.target.value)})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("button",{onClick:()=>L("email"),disabled:v,className:"p-8 rounded-[2.5rem] bg-blue-600 text-white flex flex-col items-center justify-center gap-4 shadow-xl shadow-blue-200 transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:[v?n.jsx(Qt,{className:"animate-spin",size:32}):n.jsx(Qr,{size:32}),n.jsxs("div",{className:"text-center",children:[n.jsx("span",{className:"block font-black uppercase text-[10px] tracking-widest",children:"Enviar Emails"}),n.jsx("span",{className:"text-2xl font-black",children:M.filter(R=>R.email).length})]})]}),n.jsxs("button",{onClick:()=>L("telegram"),disabled:v,className:"p-8 rounded-[2.5rem] bg-sky-500 text-white flex flex-col items-center justify-center gap-4 shadow-xl shadow-sky-200 transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:[v?n.jsx(Qt,{className:"animate-spin",size:32}):n.jsx(Sl,{size:32}),n.jsxs("div",{className:"text-center",children:[n.jsx("span",{className:"block font-black uppercase text-[10px] tracking-widest",children:"Telegram Bot"}),n.jsx("span",{className:"text-2xl font-black",children:M.filter(R=>R.telegramId).length})]})]}),n.jsxs("button",{onClick:U,className:"p-8 rounded-[2.5rem] bg-emerald-600 text-white flex flex-col items-center justify-center gap-4 shadow-xl shadow-emerald-200 transition-all hover:scale-105 active:scale-95",children:[n.jsx(vn,{size:32}),n.jsxs("div",{className:"text-center",children:[n.jsx("span",{className:"block font-black uppercase text-[10px] tracking-widest",children:"Cola WhatsApp"}),n.jsx("span",{className:"text-2xl font-black",children:M.filter(R=>R.phone&&R.phone.length>=7).length})]})]})]})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm h-fit",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-800 mb-6 flex items-center gap-3",children:[n.jsx(Wi,{className:"text-emerald-500",size:24})," Estado de Datos"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed",children:"El motor SAC 2026 garantiza la entrega mediante túneles certificados (Resend API)."}),n.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-100 rounded-2xl",children:[n.jsx("p",{className:"text-[10px] font-black text-emerald-700 uppercase tracking-widest mb-1",children:"Detección de Teléfono"}),n.jsx("p",{className:"text-[10px] text-emerald-600 leading-tight",children:"Para mejores resultados guarde los números con el signo +. (Ej: +58 412...)."})]})]})]})]}),T&&k.length>0&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/80 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("div",{className:"bg-emerald-100 text-emerald-600 p-3 rounded-2xl",children:n.jsx(vn,{size:24})}),n.jsx("button",{onClick:()=>B(!1),className:"text-slate-400 hover:text-red-500",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"text-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Procesando Cola"}),n.jsxs("p",{className:"text-slate-400 text-sm font-medium",children:["Unidad ",C+1," de ",k.length]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2rem] border border-slate-100 mb-8 relative group",children:[n.jsx("div",{className:"absolute -top-3 left-8 bg-emerald-600 text-white px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest shadow-lg",children:"Siguiente Envío"}),n.jsx("p",{className:"text-xl font-black text-slate-800 mb-1 uppercase",children:k[C].name}),n.jsxs("p",{className:"text-xs font-bold text-blue-600 flex items-center gap-2",children:[n.jsx(Bc,{size:12})," ",k[C].phone]}),n.jsxs("div",{className:"mt-8 pt-6 border-t border-slate-200",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Monto de Aviso:"}),n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$$",k[C].debtAmount.toFixed(2)]})]}),n.jsx("div",{className:"w-full bg-slate-200 h-1.5 rounded-full mt-8 overflow-hidden",children:n.jsx("div",{className:"bg-emerald-500 h-full transition-all duration-500",style:{width:`${(C+1)/k.length*100}%`}})})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("button",{onClick:D,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-2xl font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-emerald-200 transition-all flex items-center justify-center gap-3 active:scale-95",children:["LANZAR WHATSAPP ",n.jsx(yM,{size:18})]}),n.jsx("button",{onClick:()=>E(R=>Math.min(k.length-1,R+1)),className:"w-full py-4 text-slate-400 hover:text-slate-600 font-bold text-xs uppercase tracking-widest transition-colors",children:"Omitir Destinatario"})]})]})})]})},wEe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,markReceiptSent:i}=ht(),[l,o]=j.useState(new Date().getMonth()),[d,u]=j.useState(new Date().getFullYear()),[f,p]=j.useState(null),[x,m]=j.useState(""),[b,v]=j.useState("standard"),[y,k]=j.useState(`Estimado(a) [nombre], le saludamos desde el Condominio El Tejar. Le informamos que su unidad [unidad] presenta un estatus de pago: *[estatus]*. 

Puede consultar su balance detallado en nuestro portal SAC 2026:
🔗 *ACCEDER AL PORTAL:* ${la}`);if(!["programmer","admin","board"].includes(e.role))return n.jsxs("div",{className:"bg-red-50 border border-red-100 p-10 rounded-[3rem] text-center max-w-lg mx-auto shadow-xl",children:[n.jsx(hs,{className:"w-16 h-16 text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Denegado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Solo personal administrativo puede acceder a la mensajería."})]});const C=(D,L)=>{let R=D;return R=R.replace(/\[nombre\]/g,L.fullName||""),R=R.replace(/\[unidad\]/g,L.propCode||""),R=R.replace(/\[deuda\]/g,L.amount||"0.00"),R=R.replace(/\[estatus\]/g,L.status||"Al día"),R=R.replace(/\[mes\]/g,Ue[l]||""),R=R.replace(/\[telefono\]/g,L.phone||""),R},E=D=>{k(L=>L+`[${D}]`)},T=D=>{if(!D)return"";let L=D.trim();return L.startsWith("+")?L.replace(/\D/g,""):L.startsWith("0")?"58"+L.substring(1).replace(/\D/g,""):L.length===10?"58"+L.replace(/\D/g,""):L.replace(/\D/g,"")},B=t.find(D=>D.month===l&&D.year===d),I=j.useMemo(()=>a.filter(D=>D.isOwner).map(D=>{const L=r.find(G=>G.id===D.propertyId),R=s.find(G=>G.cedula===D.cedula),Q=B==null?void 0:B.debts.find(G=>G.propertyId===D.propertyId);return{id:D.id,fullName:D.fullName||"Propietario",email:(R==null?void 0:R.email)||"",telegramId:(R==null?void 0:R.telegramChatId)||"",phone:D.phone||(R==null?void 0:R.phone)||"",propId:L==null?void 0:L.id,propCode:(L==null?void 0:L.code)||"S/I",propName:L?`${L.type} ${L.number}`:"Unidad S/I",amount:Q?(Number(Q.amountUsd)-Number(Q.paidAmount)).toFixed(2):"0.00",status:Q?Q.status:"Sin Deuda",hasFee:!!Q,receiptSent:(Q==null?void 0:Q.receiptSent)||{}}}).filter(D=>{const L=x.toLowerCase();return D.fullName.toLowerCase().includes(L)||D.propCode.toLowerCase().includes(L)}).sort((D,L)=>D.propCode.localeCompare(L.propCode,void 0,{numeric:!0})),[a,r,s,B,x]),M=async D=>{if(!D.email)return alert("Sin correo registrado.");p(D.id);const L={channel:"email",messageType:b==="standard"?"fee":"custom",customMessage:b==="standard"?null:C(y,D),subject:b==="standard"?`Aviso de Cobro SAC 2026 - ${Ue[l]}`:"Comunicado Condominio El Tejar",recipients:[{name:D.fullName,email:D.email,amount:D.amount,status:D.status,propName:D.propName}],monthName:Ue[l],year:d};try{const Q=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).json();Q.status==="success"?(B&&await i(B.id,D.propId,"email"),alert("¡Éxito! Email entregado.")):alert("Error: "+Q.message)}catch{alert("Fallo de red.")}finally{p(null)}},U=async D=>{if(!D.telegramId)return alert("Sin ID de Telegram.");p(D.id);const L={channel:"telegram",messageType:b==="standard"?"fee":"custom",customMessage:b==="standard"?null:C(y,D),recipients:[{name:D.fullName,telegramChatId:D.telegramId,amount:D.amount,status:D.status,propName:D.propName}],monthName:Ue[l],year:d};try{const Q=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).json();Q.status==="success"?(B&&await i(B.id,D.propId,"telegram"),alert("¡Éxito! Telegram enviado.")):alert("Error: "+Q.message)}catch{alert("Fallo de red.")}finally{p(null)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Comunicación Individual ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Gestión personalizada por unidad inmobiliaria."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:l,onChange:D=>o(Number(D.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((D,L)=>n.jsx("option",{value:L,children:D},L))}),n.jsx("input",{type:"number",value:d,onChange:D=>u(Number(D.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"flex border-b border-slate-100",children:[n.jsxs("button",{onClick:()=>v("standard"),className:`flex-1 py-5 font-black text-[10px] uppercase tracking-[0.2em] transition-all flex items-center justify-center gap-3 ${b==="standard"?"bg-blue-600 text-white shadow-inner":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(sa,{size:16})," Plantilla Aviso de Cobro"]}),n.jsxs("button",{onClick:()=>v("custom"),className:`flex-1 py-5 font-black text-[10px] uppercase tracking-[0.2em] transition-all flex items-center justify-center gap-3 ${b==="custom"?"bg-indigo-600 text-white shadow-inner":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(sk,{size:16})," Mensaje Personalizado"]})]}),b==="custom"&&n.jsx("div",{className:"p-8 lg:p-10 bg-indigo-50/30 animate-in slide-in-from-top-2",children:n.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[n.jsxs("div",{className:"flex-1 space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-indigo-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(PG,{size:14})," Redactor de Plantilla"]}),n.jsx("textarea",{className:"w-full bg-white border border-indigo-100 rounded-[2rem] p-8 text-sm font-medium text-slate-700 outline-none focus:ring-4 focus:ring-indigo-500/10 min-h-[150px] shadow-sm",value:y,onChange:D=>k(D.target.value),placeholder:"..."})]}),n.jsxs("div",{className:"w-full lg:w-[350px] space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(_K,{size:14})," Etiquetas Dinámicas"]}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{t:"nombre",l:"Nombre"},{t:"unidad",l:"Unidad"},{t:"deuda",l:"Monto $"},{t:"estatus",l:"Estatus"},{t:"mes",l:"Mes"},{t:"telefono",l:"Teléfono"}].map(D=>n.jsxs("button",{onClick:()=>E(D.t),className:"py-3 bg-white border border-indigo-100 rounded-xl text-[10px] font-black text-indigo-600 uppercase tracking-tighter hover:bg-indigo-600 hover:text-white transition-all shadow-sm flex items-center justify-center gap-2 active:scale-95",children:[n.jsx(Cn,{size:12})," ",D.l]},D.t))})]})]})}),n.jsx("div",{className:"p-8 border-t border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6 bg-white",children:n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Filtrar por unidad o propietario...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none transition-all font-bold text-slate-800",value:x,onChange:D=>m(D.target.value)})]})}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Titular"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estado"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Canal"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:I.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"Búsqueda sin resultados"})}):I.map(D=>{const L=b==="standard"?`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${D.fullName}*,

Su recibo de *${Ue[l]} ${d}* para la unidad *${D.propName}* ya está disponible.

💵 *Total a Pagar:* $${D.amount} USD
📌 *Estado:* ${D.status}

Por favor, gestione su reporte de pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${la}

¡Muchas gracias!`:C(y,D),R=T(D.phone);return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:D.propCode}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-black text-slate-700 uppercase",children:D.fullName}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 tracking-widest uppercase",children:D.phone||"Sin Teléfono"})]}),n.jsxs("td",{className:"px-8 py-6 text-right font-mono font-black text-slate-900",children:["$",D.amount]}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[8px] font-black uppercase tracking-widest border ${D.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-red-50 text-red-600 border-red-100"}`,children:D.status})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex justify-center items-center gap-3",children:[R?n.jsx("a",{href:`https://wa.me/${R}?text=${encodeURIComponent(L)}`,target:"_blank",rel:"noreferrer",onClick:()=>B&&i(B.id,D.propId,"whatsapp"),className:"w-10 h-10 bg-emerald-500 hover:bg-emerald-600 text-white rounded-xl shadow-lg flex items-center justify-center transition-all active:scale-90",title:"Enviar WhatsApp",children:n.jsx(vn,{size:18})}):n.jsx("div",{className:"w-10 h-10 bg-slate-100 text-slate-200 rounded-xl flex items-center justify-center",children:n.jsx(ft,{size:14})}),n.jsx("button",{onClick:()=>U(D),disabled:!D.telegramId,className:`w-10 h-10 rounded-xl flex items-center justify-center text-white transition-all ${D.telegramId?"bg-sky-500 hover:bg-sky-600":"bg-slate-100 text-slate-200"}`,title:"Enviar Telegram",children:f===D.id?n.jsx(Qt,{size:16,className:"animate-spin"}):n.jsx(Sl,{size:18})}),n.jsx("button",{onClick:()=>M(D),disabled:!D.email,className:`w-10 h-10 rounded-xl flex items-center justify-center text-white transition-all ${D.email?"bg-indigo-600 hover:bg-indigo-700":"bg-slate-100 text-slate-200"}`,title:"Enviar Email",children:f===D.id?n.jsx(Qt,{size:16,className:"animate-spin"}):n.jsx(Qr,{size:18})})]})})]},D.id)})})]})})]})]})},gH=e=>{if(!e)return"S/F";const t=new Date(e.replace(" ","T"));return isNaN(t.getTime())?e:new Date(t.getTime()-14400*1e3).toLocaleString("es-VE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0})},NEe=({user:e,onActionComplete:t})=>{const{polls:r,addPoll:a,closePoll:s,deletePoll:i,submitVote:l,properties:o,residents:d,loading:u,refreshData:f}=ht(),[p,x]=j.useState(null),[m,b]=j.useState(!1),[v,y]=j.useState(""),[k,_]=j.useState(""),[C,E]=j.useState([{id:1,text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}]),T=["admin","programmer","board"].includes(e.role),B=o.length,I=()=>{C.length>=3||E([...C,{id:Date.now(),text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}])},M=Z=>{E(C.filter(Y=>Y.id!==Z))},U=(Z,Y,te)=>{E(C.map(O=>O.id===Z?{...O,[Y]:te}:O))},D=Z=>{E(C.map(Y=>Y.id===Z?{...Y,options:[...Y.options,{id:Date.now(),text:`Opción ${Y.options.length+1}`}]}:Y))},L=(Z,Y,te)=>{E(C.map(O=>O.id===Z?{...O,options:O.options.map(P=>P.id===Y?{...P,text:te}:P)}:O))},R=(Z,Y)=>{E(C.map(te=>te.id===Z?{...te,options:te.options.filter(O=>O.id!==Y)}:te))},Q=Z=>{Z.preventDefault();const Y={id:Date.now(),title:v,description:k,status:"Abierta",createdAt:new Date().toISOString(),questions:C,responses:[]};a(Y),b(!1),G()},G=()=>{y(""),_(""),E([{id:1,text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}])},K=async(Z,Y)=>{await l(Z,Y),t&&t(),f()},W=Z=>{const Y=Z.responses||[],te=B>0?(Y.length/B*100).toFixed(1):"0",O=window.open("","","width=900,height=800");if(!O)return;let P=Z.questions.map(q=>{const H=q.options.map(J=>{const ae=Y.filter(ce=>ce.answers&&Array.isArray(ce.answers)&&ce.answers.some(ne=>ne.questionId===q.id&&ne.selectedOptionIds&&ne.selectedOptionIds.includes(J.id))).length,oe=Y.length>0?(ae/Y.length*100).toFixed(1):"0";return`<tr><td style="padding:8px">${J.text}</td><td style="text-align:right"><b>${ae} votos</b></td><td style="text-align:right">${oe}%</td></tr>`}).join("");return`
        <div style="margin-bottom:30px; border-bottom:1px solid #eee; padding-bottom:10px">
          <h3>P: ${q.text}</h3>
          <table style="width:100%; border-collapse:collapse">${H}</table>
        </div>
      `}).join("");O.document.write(`
      <html>
        <head><title>Acta: ${Z.title}</title><style>body{font-family:sans-serif;padding:40px;color:#1e293b} h1{border-bottom:3px solid #6366f1;padding-bottom:10px}</style></head>
        <body>
          <div style="text-align:center;margin-bottom:40px">
            <h1>CARTA CONSULTA - RESULTADOS</h1>
            <p>CONJUNTO RESIDENCIAL EL TEJAR - SAC 2026</p>
          </div>
          <div style="background:#f8fafc;padding:20px;border-radius:10px;margin-bottom:30px">
            <h2>${Z.title}</h2>
            <p>${Z.description}</p>
            <p><b>Fecha Oficial (VET):</b> ${gH(Z.createdAt)}</p>
            <p><b>Participación:</b> ${Y.length} de ${B} Unidades Inmobiliarias (${te}%)</p>
          </div>
          ${P}
          <div style="margin-top:80px;display:flex;justify-content:space-around">
            <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Administración</div>
            <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Junta de Condominio</div>
          </div>
          <p style="text-align:center;font-size:10px;color:#94a3b8;margin-top:50px">Certificado Digital Auditado • Zona Horaria: America/Caracas (VET)</p>
        </body>
      </html>
    `),O.document.close(),O.print()},z=async Z=>{if(confirm("¿Está seguro de eliminar permanentemente esta consulta?"))try{await i(Z),f()}catch{alert("Error al intentar eliminar la consulta.")}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-indigo-50 w-fit px-4 py-1.5 rounded-full border border-indigo-100 flex items-center gap-2 mb-6",children:[n.jsx(Md,{size:14,className:"text-indigo-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-indigo-600",children:"Democracia Digital"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Cartas ",n.jsx("span",{className:"text-indigo-600 italic",children:"Consulta"})]}),n.jsxs("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:["Decisiones auditadas para sus ",B," unidades inmobiliarias."]})]}),n.jsxs("div",{className:"flex gap-3 relative z-10",children:[n.jsx("button",{onClick:f,className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ot,{size:24,className:u?"animate-spin":""})}),T&&n.jsxs("button",{onClick:()=>b(!0),className:"bg-indigo-600 hover:bg-indigo-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-indigo-100 transition-all active:scale-95 flex items-center gap-3",children:[n.jsx(Cn,{size:20})," Nueva Consulta"]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-indigo-50/50 rounded-full blur-[100px] pointer-events-none -translate-y-1/2 translate-x-1/3"})]}),n.jsx("div",{className:"grid grid-cols-1 gap-8",children:r.length===0?n.jsxs("div",{className:"bg-white p-24 text-center rounded-[3rem] border border-dashed border-slate-200",children:[n.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-3xl flex items-center justify-center mx-auto mb-6",children:n.jsx(Md,{size:40,className:"text-slate-300"})}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"No hay consultas activas."})]}):r.map(Z=>n.jsx(CEe,{poll:Z,user:e,totalUnits:B,isExpanded:p===Z.id,onExpand:()=>x(p===Z.id?null:Z.id),onPrint:()=>W(Z),onClose:()=>{confirm("¿Cerrar votación?")&&s(Z.id)},onDelete:()=>z(Z.id),onSubmitVote:Y=>K(Z.id,Y)},Z.id))}),m&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-3xl shadow-2xl overflow-y-auto max-h-[90vh] custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-12",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-16 h-16 bg-indigo-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl shadow-indigo-200",children:n.jsx(Xd,{size:32})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Nueva Carta Consulta"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Configure las opciones de votación para el Tejar."})]})]}),n.jsx("button",{onClick:()=>b(!1),className:"p-4 bg-slate-100 hover:bg-slate-200 rounded-full text-slate-500 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:Q,className:"space-y-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título de la Consulta"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-indigo-600 outline-none text-slate-900 font-bold",value:v,onChange:Z=>y(Z.target.value),placeholder:"..."})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción Detallada"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 focus:ring-2 focus:ring-indigo-600 outline-none text-slate-900 font-medium min-h-[100px]",value:k,onChange:Z=>_(Z.target.value),placeholder:"..."})]})]}),n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 pb-4",children:[n.jsxs("h4",{className:"font-black text-slate-800 text-sm uppercase tracking-tight flex items-center gap-2",children:[n.jsx(TV,{className:"text-indigo-600",size:18})," Preguntas"]}),C.length<3&&n.jsx("button",{type:"button",onClick:I,className:"text-indigo-600 font-black text-[10px] uppercase tracking-widest hover:underline",children:"+ Añadir"})]}),C.map((Z,Y)=>n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-200 space-y-6 relative",children:[C.length>1&&n.jsx("button",{type:"button",onClick:()=>M(Z.id),className:"absolute top-6 right-6 text-red-400 hover:text-red-600",children:n.jsx(Ta,{size:18})}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-3 text-sm font-bold outline-none",value:Z.text,onChange:te=>U(Z.id,"text",te.target.value),placeholder:`Enunciado de Pregunta ${Y+1}`}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[Z.options.map((te,O)=>n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{required:!0,type:"text",className:"flex-1 bg-white border border-slate-200 rounded-xl px-4 py-2 text-xs font-medium outline-none",value:te.text,onChange:P=>L(Z.id,te.id,P.target.value)}),Z.options.length>2&&n.jsx("button",{type:"button",onClick:()=>R(Z.id,te.id),className:"p-2 text-slate-300 hover:text-red-500",children:n.jsx(ft,{size:14})})]},te.id)),n.jsx("button",{type:"button",onClick:()=>D(Z.id),className:"flex items-center justify-center p-2 border border-dashed border-slate-300 rounded-xl text-[10px] font-bold text-slate-400 hover:text-indigo-600 transition-all uppercase",children:"+ Opción"})]})]},Z.id))]}),n.jsxs("div",{className:"flex gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>b(!1),className:"flex-1 py-5 text-slate-400 font-bold uppercase text-xs",children:"Cancelar"}),n.jsxs("button",{type:"submit",className:"flex-[2] bg-indigo-600 text-white py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(qn,{size:18})," PUBLICAR CONSULTA"]})]})]})]})})]})},CEe=({poll:e,user:t,totalUnits:r,isExpanded:a,onExpand:s,onPrint:i,onClose:l,onDelete:o,onSubmitVote:d})=>{var C,E;const u=["admin","programmer","board"].includes(t.role),f=t.role==="owner",p=(e==null?void 0:e.responses)||[],x=p.length,m=r>0?Math.round(x/r*100):0,b=p.some(T=>T.propertyId===(t==null?void 0:t.propertyId)),[v,y]=j.useState([]),k=async()=>{var T;if(v.length<(((T=e==null?void 0:e.questions)==null?void 0:T.length)||0))return alert("Responda todo el cuestionario.");await d(v),y([])},_=(T,B,I)=>{let M=[...v];const U=M.find(D=>D.questionId===T);U?I==="single"?U.selectedOptionIds=[B]:U.selectedOptionIds.includes(B)?U.selectedOptionIds=U.selectedOptionIds.filter(D=>D!==B):U.selectedOptionIds.push(B):M.push({questionId:T,selectedOptionIds:[B]}),y(M)};return n.jsxs("div",{className:`bg-white rounded-[3rem] border border-slate-200 overflow-hidden transition-all shadow-sm ${a?"ring-2 ring-indigo-500/20":""}`,children:[n.jsxs("div",{className:"p-8 lg:p-10 flex flex-col md:flex-row justify-between items-center gap-6 cursor-pointer",onClick:s,children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:`w-16 h-16 rounded-[1.5rem] flex items-center justify-center ${e.status==="Abierta"?"bg-indigo-50 text-indigo-600 shadow-lg":"bg-slate-100 text-slate-400"}`,children:n.jsx(Md,{size:28})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tighter",children:e.title}),n.jsx("span",{className:`px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest ${e.status==="Abierta"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-red-50 text-red-600 border-red-100"}`,children:e.status})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs font-bold text-slate-400 uppercase tracking-widest",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Oi,{size:14})," ",x," / ",r," Unidades"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(zt,{size:14})," ",m,"% Escrutado"]}),n.jsxs("span",{className:"text-slate-300",children:["Publicado: ",gH(e.createdAt)]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:T=>{T.stopPropagation(),i()},className:"p-3 bg-slate-50 hover:bg-blue-50 text-slate-400 hover:text-blue-600 rounded-xl transition-all shadow-sm",children:n.jsx(yt,{size:18})}),e.status==="Abierta"&&n.jsx("button",{onClick:T=>{T.stopPropagation(),l()},className:"p-3 bg-slate-50 hover:bg-amber-50 text-slate-400 hover:text-amber-600 rounded-xl shadow-sm",children:n.jsx(Rd,{size:18})}),n.jsx("button",{onClick:T=>{T.stopPropagation(),o()},className:"p-3 bg-slate-100 text-slate-400 hover:bg-red-600 hover:text-white rounded-xl shadow-sm",children:n.jsx(Ta,{size:18})})]}),n.jsx("div",{className:`ml-2 p-3 rounded-xl transition-all ${a?"bg-indigo-600 text-white shadow-lg":"bg-slate-100 text-slate-600"}`,children:a?n.jsx(rk,{size:20}):n.jsx(tk,{size:20})})]})]}),a&&n.jsx("div",{className:"border-t border-slate-100 bg-slate-50/50 p-8 lg:p-12 animate-in slide-in-from-top-4 duration-300",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[n.jsxs("div",{className:"lg:col-span-2 space-y-10",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-3 flex items-center gap-2",children:[n.jsx(Nn,{size:14})," Motivo"]}),n.jsx("p",{className:"text-slate-600 font-medium",children:e.description})]}),f&&!b&&e.status==="Abierta"?n.jsxs("div",{className:"space-y-8",children:[(C=e.questions)==null?void 0:C.map((T,B)=>{var I;return n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm space-y-6",children:[n.jsxs("h5",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-4",children:[n.jsx("span",{className:"w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center text-xs",children:B+1}),T.text]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(I=T.options)==null?void 0:I.map(M=>{var D,L;const U=(L=(D=v.find(R=>R.questionId===T.id))==null?void 0:D.selectedOptionIds)==null?void 0:L.includes(M.id);return n.jsxs("button",{onClick:()=>_(T.id,M.id,T.type),className:`p-6 rounded-2xl border text-left transition-all flex items-center justify-between ${U?"bg-indigo-600 border-indigo-600 text-white shadow-xl":"bg-slate-50 border-slate-100 text-slate-600 hover:bg-white hover:border-indigo-300"}`,children:[n.jsx("span",{className:"font-bold text-sm",children:M.text}),n.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${U?"bg-white border-white":"border-slate-300"}`,children:U&&n.jsx("div",{className:"w-2.5 h-2.5 bg-indigo-600 rounded-full"})})]},M.id)})})]},T.id)}),n.jsx("button",{onClick:k,className:"w-full bg-indigo-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-2xl active:scale-95 transition-all",children:"ENVIAR MI VOTO (ZONA VET)"})]}):n.jsx("div",{className:"space-y-8",children:(E=e.questions)==null?void 0:E.map(T=>{var B;return n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm space-y-6",children:[n.jsx("h5",{className:"text-lg font-black text-slate-800 tracking-tight",children:T.text}),n.jsx("div",{className:"space-y-4",children:(B=T.options)==null?void 0:B.map(I=>{const M=p.filter(D=>D.answers&&Array.isArray(D.answers)&&D.answers.some(L=>L.questionId===T.id&&L.selectedOptionIds&&L.selectedOptionIds.includes(I.id))).length,U=p.length>0?Math.round(M/p.length*100):0;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-xs font-black uppercase tracking-widest text-slate-500",children:[n.jsx("span",{children:I.text}),n.jsxs("span",{className:"text-indigo-600",children:[U,"% (",M," votos)"]})]}),n.jsx("div",{className:"w-full h-3 bg-slate-100 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-indigo-600",style:{width:`${U}%`}})})]},I.id)})})]},T.id)})})]}),n.jsx("div",{className:"space-y-8",children:n.jsxs("div",{className:"bg-indigo-600 p-8 rounded-[3rem] text-white shadow-2xl relative overflow-hidden",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Quórum Nominal"}),n.jsxs("h4",{className:"text-5xl font-black tracking-tighter mt-2",children:[m,"%"]}),n.jsxs("p",{className:"text-indigo-100 text-xs font-bold mt-4 uppercase tracking-widest",children:[x," de ",r," Unidades"]})]})})]})})]})},bH=e=>{if(!e)return"S/F";const t=new Date(e.replace(" ","T"));return isNaN(t.getTime())?e:new Date(t.getTime()-14400*1e3).toLocaleString("es-VE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0})},kEe=({user:e,onActionComplete:t})=>{const{dataForms:r,addDataForm:a,deleteDataForm:s,toggleDataFormStatus:i,submitDataForm:l,properties:o,residents:d,users:u,loading:f,refreshData:p}=ht(),[x,m]=j.useState(!1),[b,v]=j.useState(null),[y,k]=j.useState(null),[_,C]=j.useState(null),[E,T]=j.useState(""),[B,I]=j.useState(""),[M,U]=j.useState([{id:"f1",label:"",type:"text",required:!0}]),D=["admin","programmer","board"].includes(e.role.toLowerCase()),L=o.length||90;j.useEffect(()=>{const Z=e.propertyId;if(!Z)return;const Y=r.find(te=>te.status==="Activo"&&!(te.responses||[]).some(O=>O.propertyId===Z));Y&&!D&&(k(Y.id),v(Y.id))},[r,e.propertyId,D]);const R=()=>{M.length>=20||U([...M,{id:`f${Date.now()}`,label:"",type:"text",required:!0}])},Q=(Z,Y,te)=>{U(M.map(O=>O.id===Z?{...O,[Y]:te}:O))},G=Z=>{U(M.filter(Y=>Y.id!==Z))},K=async Z=>{if(Z.preventDefault(),!E||M.some(te=>!te.label)){alert("Complete el título y las etiquetas de todos los campos.");return}const Y={title:E,description:B,fields:M};try{await a(Y),m(!1),W()}catch{alert("Error al publicar censo. Verifique sus permisos.")}},W=()=>{T(""),I(""),U([{id:"f1",label:"",type:"text",required:!0}])},z=async Z=>{try{await l(y,Z),k(null),t&&t()}catch{alert("Error al enviar respuesta.")}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-50 w-fit px-4 py-1.5 rounded-full border border-blue-100 flex items-center gap-2 mb-6",children:[n.jsx(Xd,{size:14,className:"text-blue-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-600",children:"Censos SAC 2026"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Gestión de ",n.jsx("span",{className:"text-blue-600 italic",children:"Datos"})]}),n.jsxs("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:["Estandarización nominal para las ",L," unidades inmobiliarias."]})]}),n.jsxs("div",{className:"flex gap-3 relative z-10",children:[n.jsx("button",{onClick:()=>p(),className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ot,{size:24,className:f?"animate-spin":""})}),D&&n.jsxs("button",{onClick:()=>m(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(Cn,{size:20})," Crear Censo"]})]})]}),n.jsx("div",{className:"grid grid-cols-1 gap-8",children:r.length===0?n.jsxs("div",{className:"bg-white p-24 text-center rounded-[3rem] border border-dashed border-slate-200",children:[n.jsx(sk,{size:40,className:"text-slate-300 mx-auto mb-6"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"Sin formularios activos."})]}):r.map(Z=>n.jsx(jEe,{form:Z,user:e,totalUnits:L,isExpanded:b===Z.id,onExpand:()=>v(b===Z.id?null:Z.id),onFill:()=>k(Z.id),onViewResponses:()=>C(Z.id),onToggleStatus:()=>i(Z.id),onDelete:()=>{confirm("¿Eliminar?")&&s(Z.id)}},Z.id))}),x&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 lg:p-14 w-full max-w-4xl shadow-2xl overflow-y-auto max-h-[90vh] custom-scrollbar animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-12",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl shadow-blue-200",children:n.jsx(Cn,{size:32})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Diseño de Censo"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Configure los campos requeridos para la consulta."})]})]}),n.jsx("button",{onClick:()=>m(!1),className:"p-4 bg-slate-100 hover:bg-slate-200 rounded-full text-slate-500 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:K,className:"space-y-12",children:[n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título del Censo"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:E,onChange:Z=>T(Z.target.value.toUpperCase()),placeholder:"EJ: REGISTRO DE VEHÍCULOS 2026"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción / Justificación"}),n.jsx("textarea",{className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-medium min-h-[120px]",value:B,onChange:Z=>I(Z.target.value),placeholder:"Indique a los vecinos el propósito de esta recolección..."})]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[3rem] border border-slate-200 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-slate-200 pb-4",children:[n.jsxs("h4",{className:"text-sm font-black text-slate-800 uppercase flex items-center gap-2",children:[n.jsx(Nn,{size:16,className:"text-blue-600"})," Definición de Campos"]}),n.jsx("button",{type:"button",onClick:R,className:"text-blue-600 font-black text-[10px] uppercase tracking-widest hover:underline",children:"+ Añadir Campo"})]}),n.jsx("div",{className:"space-y-4 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar",children:M.map((Z,Y)=>n.jsxs("div",{className:"bg-white p-5 rounded-2xl border border-slate-200 shadow-sm space-y-4 relative group animate-in slide-in-from-right-4",children:[n.jsxs("div",{className:"flex gap-3",children:[n.jsx("div",{className:"flex-1",children:n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-2 text-xs font-bold outline-none focus:bg-white",value:Z.label,onChange:te=>Q(Z.id,"label",te.target.value),placeholder:`Etiqueta del Campo ${Y+1}`})}),n.jsxs("select",{className:"bg-slate-900 text-white text-[10px] font-black rounded-xl px-3 outline-none",value:Z.type,onChange:te=>Q(Z.id,"type",te.target.value),children:[n.jsx("option",{value:"text",children:"Texto"}),n.jsx("option",{value:"number",children:"Número"}),n.jsx("option",{value:"date",children:"Fecha"}),n.jsx("option",{value:"boolean",children:"Si/No"})]}),M.length>1&&n.jsx("button",{type:"button",onClick:()=>G(Z.id),className:"text-red-400 hover:text-red-600 p-1",children:n.jsx(Ta,{size:16})})]}),n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx("input",{type:"checkbox",id:`req-${Z.id}`,checked:Z.required,onChange:te=>Q(Z.id,"required",te.target.checked),className:"rounded text-blue-600"}),n.jsx("label",{htmlFor:`req-${Z.id}`,className:"text-[9px] font-black text-slate-400 uppercase",children:"Respuesta Obligatoria"})]})]},Z.id))})]})]}),n.jsxs("div",{className:"flex gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>m(!1),className:"flex-1 py-5 text-slate-400 font-black uppercase text-xs tracking-widest",children:"Descartar"}),n.jsxs("button",{type:"submit",className:"flex-[2] bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(qn,{size:18})," PUBLICAR CENSO EN CARTELERA"]})]})]})]})}),y&&n.jsx(SEe,{formId:y,user:e,onClose:()=>k(null),onSubmit:z}),_&&n.jsx(EEe,{formId:_,user:e,properties:o,onClose:()=>C(null)})]})},jEe=({form:e,user:t,totalUnits:r,isExpanded:a,onExpand:s,onFill:i,onViewResponses:l,onToggleStatus:o,onDelete:d})=>{const u=["admin","programmer","board"].includes(t.role.toLowerCase()),f=(e.responses||[]).length,p=r>0?Math.round(f/r*100):0,x=(e.responses||[]).some(m=>m.propertyId===t.propertyId);return n.jsxs("div",{className:`bg-white rounded-[3rem] border border-slate-200 overflow-hidden transition-all shadow-sm ${a?"ring-2 ring-blue-500/20":""}`,children:[n.jsxs("div",{className:"p-8 lg:p-10 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:`w-16 h-16 rounded-[1.5rem] flex items-center justify-center ${e.status==="Activo"?"bg-blue-50 text-blue-600 shadow-lg":"bg-slate-100 text-slate-400"}`,children:n.jsx(Xd,{size:28})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tighter",children:e.title}),n.jsx("span",{className:`px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest ${e.status==="Activo"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-red-50 text-red-600 border-red-100"}`,children:e.status})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs font-bold text-slate-400 uppercase tracking-widest",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Oi,{size:14})," ",f," / ",r," Unidades"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(zt,{size:14})," ",p,"% Escrutado"]}),n.jsxs("span",{className:"text-slate-300",children:["Emisión: ",bH(e.createdAt)]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u?n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:l,className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(_c,{size:18})}),n.jsx("button",{onClick:o,className:"p-3 rounded-xl bg-slate-50 text-slate-500",children:e.status==="Activo"?n.jsx(Rd,{size:18}):n.jsx(NM,{size:18})}),n.jsx("button",{onClick:d,className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ta,{size:18})})]}):!x&&e.status==="Activo"&&n.jsxs("button",{onClick:i,className:"bg-blue-600 text-white px-8 py-3 rounded-xl font-black text-[10px] uppercase shadow-xl transition-all flex items-center gap-2 active:scale-95",children:["LLENAR AHORA ",n.jsx(Bc,{size:14})]}),x&&!u&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-emerald-50 text-emerald-600 rounded-xl border border-emerald-100",children:[n.jsx(zt,{size:16}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Enviado"})]}),n.jsx("button",{onClick:s,className:`ml-2 p-3 rounded-xl transition-all ${a?"bg-blue-600 text-white":"bg-slate-100 text-slate-600"}`,children:a?n.jsx(rk,{size:20}):n.jsx(tk,{size:20})})]})]}),a&&e.description&&n.jsx("div",{className:"px-8 pb-8 lg:px-10 lg:pb-10 border-t border-slate-100 pt-6 animate-in slide-in-from-top-2",children:n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2 flex items-center gap-2",children:[n.jsx(Nn,{size:12,className:"text-blue-600"})," Descripción / Justificación"]}),n.jsx("p",{className:"text-slate-600 text-sm font-medium leading-relaxed whitespace-pre-wrap",children:e.description})]})})]})},EEe=({formId:e,user:t,properties:r,onClose:a})=>{const{dataForms:s}=ht(),i=s.find(l=>l.id===e);return i?n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[400] p-4 no-print",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] w-full max-w-6xl h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95",children:[n.jsxs("div",{className:"p-8 border-b flex justify-between items-center bg-white z-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white",children:n.jsx(po,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Bitácora de Censo (VET)"}),n.jsx("p",{className:"text-blue-600 font-black text-[10px] uppercase tracking-[0.2em]",children:i.title})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-50 border rounded-xl",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:a,className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-10 bg-slate-50 custom-scrollbar",children:n.jsx("div",{className:"bg-white rounded-[2.5rem] border overflow-hidden",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Envío (VET)"}),i.fields.map(l=>n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:l.label},l.id))]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:(i.responses||[]).map((l,o)=>{const d=r.find(u=>u.id===l.propertyId);return n.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:(d==null?void 0:d.code)||"N/A"}),n.jsx("td",{className:"px-8 py-6 text-[11px] font-bold text-slate-400",children:bH(l.submittedAt)}),i.fields.map(u=>{const f=l.data&&l.data[u.id]!==void 0?l.data[u.id]:"-";return n.jsx("td",{className:"px-8 py-6 text-sm font-medium text-slate-600",children:typeof f=="string"&&(f.toUpperCase()==="SI"||f==="true")?n.jsx("span",{className:"text-emerald-600 font-black",children:"SÍ"}):typeof f=="string"&&(f.toUpperCase()==="NO"||f==="false")?n.jsx("span",{className:"text-rose-600 font-black",children:"NO"}):f||"-"},u.id)})]},o)})})]})})})]})}):null},SEe=({formId:e,user:t,onClose:r,onSubmit:a})=>{const{dataForms:s}=ht(),i=s.find(p=>p.id===e),[l,o]=j.useState({}),[d,u]=j.useState(!1);if(!i)return null;const f=async p=>{if(p.preventDefault(),u(!0),!t.propertyId)return alert("Error: Unidad no vinculada.");const x={propertyId:t.propertyId,userId:t.id,submittedAt:new Date().toISOString(),data:l};await a(x),u(!1)};return n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-3xl shadow-2xl animate-in zoom-in-95 h-full sm:h-auto overflow-y-auto",children:[n.jsxs("div",{className:"flex justify-between items-start mb-10",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:i.title}),n.jsxs("p",{className:"text-slate-400 mt-1 font-medium italic",children:["Unidad Registrante: ",t.propertyCode]})]}),n.jsx("button",{onClick:r,className:"p-3 bg-slate-100 rounded-full hover:text-red-500 transition-all",children:n.jsx(ft,{size:24})})]}),i.description&&n.jsxs("div",{className:"mb-10 bg-blue-50/50 p-8 rounded-[2rem] border border-blue-100",children:[n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mb-3 flex items-center gap-2",children:[n.jsx(Nn,{size:14})," Instrucciones / Justificación"]}),n.jsx("p",{className:"text-slate-700 text-sm font-medium leading-relaxed whitespace-pre-wrap",children:i.description})]}),n.jsxs("form",{onSubmit:f,className:"space-y-6",children:[n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.fields.map(p=>n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200",children:[n.jsxs("label",{className:"block text-sm font-black text-slate-800 mb-4 ml-1",children:[p.label," ",p.required&&"*"]}),p.type==="boolean"?n.jsxs("div",{className:"flex gap-4",children:[n.jsx("button",{type:"button",onClick:()=>o({...l,[p.id]:"Si"}),className:`flex-1 py-4 rounded-xl font-black text-xs transition-all border ${l[p.id]==="Si"?"bg-emerald-600 text-white":"bg-white text-slate-400"}`,children:"SÍ"}),n.jsx("button",{type:"button",onClick:()=>o({...l,[p.id]:"No"}),className:`flex-1 py-4 rounded-xl font-black text-xs transition-all border ${l[p.id]==="No"?"bg-red-600 text-white":"bg-white text-slate-400"}`,children:"NO"})]}):n.jsx("input",{required:p.required,type:p.type,className:"w-full bg-white border border-slate-200 rounded-2xl px-6 py-4 font-black focus:ring-2 focus:ring-blue-600 outline-none",value:l[p.id]||"",onChange:x=>o({...l,[p.id]:x.target.value})})]},p.id))}),n.jsx("button",{disabled:d,type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-2xl active:scale-95 transition-all",children:d?"ENVIANDO...":"REPORTE SEGURO VET"})]})]})})},R2=e=>{if(!e)return"S/F";const t=new Date(e.replace(" ","T"));return isNaN(t.getTime())?e:new Date(t.getTime()-14400*1e3).toLocaleString("es-VE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0})},LE=e=>{const t=e.responses||[],r={};return e.options.forEach(a=>r[a.id]=0),t.forEach(a=>{r[a.optionId]!==void 0&&r[a.optionId]++}),{total:t.length,counts:r}},BEe=({user:e,onActionComplete:t})=>{const{liveVotes:r,addLiveVote:a,updateLiveVoteStatus:s,castLiveVote:i,deleteLiveVote:l,refreshData:o,properties:d,residents:u,users:f,loading:p}=ht(),[x,m]=j.useState(!1),[b,v]=j.useState(!1),[y,k]=j.useState(null),[_,C]=j.useState(""),[E,T]=j.useState(["A favor","En contra","Abstención"]),B=["admin","programmer","board"].includes(e.role),I=r.find(K=>K.status==="Activa"),M=d.length;j.useEffect(()=>{let K;return I?(v(!0),K=setInterval(()=>{o()},4e3)):v(!1),()=>clearInterval(K)},[I,o]);const U=()=>{E.length<5&&T([...E,`Opción ${E.length+1}`])},D=K=>{E.length>2&&T(E.filter((W,z)=>z!==K))},L=async K=>{K.preventDefault();const W={question:_,options:E.map((z,Z)=>({id:Z+1,text:z})),status:"Borrador"};await a(W),m(!1),R(),o()},R=()=>{C(""),T(["A favor","En contra","Abstención"])},Q=async K=>{if(confirm("¿Borrar esta votación?"))try{await l(K),o()}catch(W){alert(W.message)}},G=K=>{const W=LE(K),z=window.open("","","width=850,height=900");if(!z)return;const Z=K.responses||[],Y=M>0?Math.round(Z.length/M*100):0;let te=Z.map(O=>{const P=f.find(ae=>ae.id===O.userId),q=K.options.find(ae=>ae.id===O.optionId),H=u.find(ae=>ae.cedula===(P==null?void 0:P.cedula)),J=d.find(ae=>ae.id===(H==null?void 0:H.propertyId));return{usr:P,opt:q,prop:J,date:O.date}}).sort((O,P)=>{var q,H;return(((q=O.prop)==null?void 0:q.code)||"").localeCompare(((H=P.prop)==null?void 0:H.code)||"",void 0,{numeric:!0,sensitivity:"base"})}).map(O=>{var P,q;return`<tr>
            <td style="border:1px solid #e2e8f0;padding:10px">${O.prop?`${O.prop.type} ${O.prop.number} (${O.prop.code})`:"N/A"}</td>
            <td style="border:1px solid #e2e8f0;padding:10px">${(P=O.usr)==null?void 0:P.fullName}</td>
            <td style="border:1px solid #e2e8f0;padding:10px;text-align:center"><b>${(q=O.opt)==null?void 0:q.text}</b></td>
            <td style="border:1px solid #e2e8f0;padding:10px;text-align:right;font-size:8pt">${R2(O.date)}</td>
          </tr>`}).join("");z.document.write(`
          <html><head><title>Acta: ${K.question}</title>
          <style>body{font-family:sans-serif;padding:50px;color:#1e293b} h1{color:#2563eb;border-bottom:2px solid #2563eb;padding-bottom:10px} .box{background:#f8fafc;padding:20px;border-radius:10px;margin-bottom:30px} table{width:100%;border-collapse:collapse}</style>
          </head><body>
              <div style="text-align:center">
                <h1>ACTA DE ASAMBLEA DIGITAL (VET)</h1>
                <p><b>Condominio El Tejar - SAC 2026</b></p>
              </div>
              <div class="box">
                <p><b>Pregunta:</b> ${K.question}</p>
                <p><b>Inicio de Sesión (VET):</b> ${R2(K.createdAt)}</p>
                <p><b>Quórum:</b> ${Z.length} de ${M} Unidades (${Y}%)</p>
              </div>
              <h3>RESULTADO DEL ESCRUTINIO:</h3>
              <ul>${K.options.map(O=>{const P=W.counts[O.id]||0,q=W.total>0?Math.round(P/W.total*100):0;return`<li><b>${O.text}:</b> ${P} votos (${q}%)</li>`}).join("")}</ul>
              <hr style="margin:40px 0"/>
              <h3>AUDITORÍA NOMINAL DE EMISIÓN:</h3>
              <table style="font-size:10pt"><thead><tr style="background:#f1f5f9"><th>Inmueble</th><th>Titular</th><th>Estatus Voto</th><th>Timestamp (VET)</th></tr></thead><tbody>${te}</tbody></table>
              <div style="margin-top:100px;display:flex;justify-content:space-around">
                <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Administración</div>
                <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Junta de Condominio</div>
              </div>
              <p style="text-align:center;font-size:9px;color:#94a3b8;margin-top:50px">Generado mediante protocolo seguro de asamblea SAC 2026</p>
          </body></html>
      `),z.document.close(),z.print()};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-red-50 w-fit px-4 py-1.5 rounded-full border border-red-100 flex items-center gap-2 mb-6",children:[n.jsx(Kf,{size:14,className:b?"text-red-600 animate-pulse":"text-slate-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-red-600",children:"Sala Live VET"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Asamblea ",n.jsx("span",{className:"text-blue-600 italic",children:"En Vivo"})]}),n.jsxs("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:["Escrutinio inmediato para las ",M," unidades del Tejar."]})]}),n.jsxs("div",{className:"flex gap-3 relative z-10",children:[n.jsx("button",{onClick:()=>o(),className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ot,{size:24,className:p?"animate-spin":""})}),B&&n.jsxs("button",{onClick:()=>m(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(Cn,{size:20})," Iniciar Asamblea"]})]})]}),I?n.jsx(_Ee,{vote:I,user:e,properties:d,totalUnits:M,onCast:async K=>{await i(I.id,K),t&&t()},onClose:()=>{confirm("¿Cerrar?")&&s(I.id,"Finalizada")}}):n.jsx("div",{className:"grid grid-cols-1 gap-6",children:r.filter(K=>K.status!=="Activa").map(K=>n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-14 h-14 bg-slate-50 text-slate-400 rounded-2xl flex items-center justify-center",children:n.jsx(Kf,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-800",children:K.question}),n.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[n.jsx("span",{className:`px-3 py-0.5 rounded-full text-[9px] font-black uppercase tracking-widest ${K.status==="Finalizada"?"bg-slate-100":"bg-amber-50 text-amber-600"}`,children:K.status}),n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:["Iniciada: ",R2(K.createdAt)]})]})]})]}),n.jsxs("div",{className:"flex gap-2",children:[B&&K.status==="Borrador"&&n.jsxs("button",{onClick:()=>s(K.id,"Activa"),className:"px-6 py-3 bg-emerald-600 text-white rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(SV,{size:16})," Activar"]}),n.jsx("button",{onClick:()=>k(K.id),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(_c,{size:18})}),n.jsx("button",{onClick:()=>G(K),className:"p-3 bg-slate-100 text-slate-500 rounded-xl hover:bg-slate-200 transition-all",children:n.jsx(yt,{size:18})}),B&&n.jsx("button",{onClick:()=>Q(K.id),className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ta,{size:18})})]})]},K.id))}),x&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-xl shadow-2xl animate-in zoom-in-95 h-full sm:h-auto overflow-y-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Nueva Sesión Live"}),n.jsx("button",{onClick:()=>m(!1),className:"p-3 bg-slate-100 rounded-full hover:text-red-500 transition-all",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:L,className:"space-y-8",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Punto a Tratar"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-2 focus:ring-blue-600",value:_,onChange:K=>C(K.target.value)})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest",children:"Opciones de Respuesta"}),n.jsx("button",{type:"button",onClick:U,className:"text-blue-600 font-black text-[10px] uppercase",children:"+ Añadir"})]}),n.jsx("div",{className:"space-y-2",children:E.map((K,W)=>n.jsxs("div",{className:"flex gap-2 group",children:[n.jsx("input",{required:!0,className:"flex-1 bg-slate-50 border border-slate-200 rounded-xl px-4 py-2 text-sm font-bold outline-none focus:bg-white",value:K,onChange:z=>{const Z=[...E];Z[W]=z.target.value,T(Z)}}),E.length>2&&n.jsx("button",{type:"button",onClick:()=>D(W),className:"p-2 text-slate-300 hover:text-red-500",children:n.jsx(ft,{size:16})})]},W))})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all",children:"ABRIR SALA DE ASAMBLEA"})]})]})}),y&&n.jsx(TEe,{vote:r.find(K=>K.id===y),properties:d,onClose:()=>k(null)})]})},_Ee=({vote:e,user:t,properties:r,totalUnits:a,onCast:s,onClose:i})=>{const l=j.useMemo(()=>LE(e),[e]),o=["admin","programmer","board"].includes(t.role),d=t.role==="owner",u=(e.responses||[]).some(x=>x.propertyId===t.propertyId),f=a>0?Math.round(l.total/a*100):0,p=j.useMemo(()=>[...r].sort((x,m)=>x.code.localeCompare(m.code,void 0,{numeric:!0,sensitivity:"base"})),[r]);return n.jsx("div",{className:"space-y-10 animate-in slide-in-from-bottom-4",children:n.jsx("div",{className:"bg-white p-10 lg:p-14 rounded-[4rem] border-2 border-red-100 shadow-2xl relative overflow-hidden",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 relative z-10",children:[n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{children:[n.jsx("span",{className:"bg-red-600 text-white px-4 py-1 rounded-full text-[10px] font-black uppercase tracking-widest animate-pulse",children:"En Vivo - Zona VET"}),n.jsx("h2",{className:"text-4xl font-black text-slate-900 tracking-tighter mt-6 leading-tight",children:e.question})]}),n.jsx("div",{className:"space-y-4",children:e.options.map(x=>{const m=l.total>0?Math.round(l.counts[x.id]/l.total*100):0;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-sm font-black text-slate-700 uppercase",children:x.text}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:[l.counts[x.id]," Votos (",m,"%)"]})]}),n.jsx("div",{className:"w-full bg-slate-100 h-4 rounded-full overflow-hidden border",children:n.jsx("div",{className:"h-full bg-blue-600 transition-all duration-1000",style:{width:`${m}%`}})})]},x.id)})}),d&&!u?n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[3rem] border border-slate-200 mt-10",children:[n.jsx("h4",{className:"text-center text-[10px] font-black uppercase tracking-widest text-slate-400 mb-8",children:"Ejerza su derecho al voto"}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:e.options.map(x=>n.jsx("button",{onClick:()=>{confirm(`¿Confirmar voto: ${x.text}?`)&&s(x.id)},className:"bg-white border-2 border-slate-200 hover:border-blue-600 p-6 rounded-2xl text-center font-black text-xs uppercase text-slate-600 hover:text-blue-600 transition-all active:scale-95 shadow-sm",children:x.text},x.id))})]}):u&&d&&n.jsxs("div",{className:"bg-emerald-50 border-emerald-100 p-8 rounded-[3rem] flex items-center gap-6 text-emerald-700 mt-10 shadow-lg shadow-emerald-100/50",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-600 text-white rounded-[1.5rem] flex items-center justify-center shadow-lg",children:n.jsx(zt,{size:32})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-lg font-black tracking-tight",children:"Voto Registrado"}),n.jsx("p",{className:"text-sm font-medium opacity-80 uppercase tracking-widest",children:"Gracias por participar."})]})]}),o&&n.jsxs("div",{className:"bg-slate-900 p-8 rounded-[3rem] text-white mt-10 shadow-2xl relative group overflow-hidden",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-60 mb-2",children:"Administración de Asamblea"}),n.jsx("button",{onClick:i,className:"bg-red-600 hover:bg-red-700 text-white px-10 py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl transition-all",children:"FINALIZAR Y CERRAR SALA"})]}),n.jsx(Kf,{size:120,className:"absolute right-[-20px] bottom-[-20px] text-white/5"})]})]}),n.jsx("div",{className:"space-y-8",children:n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-100 shadow-xl",children:[n.jsx("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-6",children:"Monitor de Presencia Live"}),n.jsx("div",{className:"grid grid-cols-5 sm:grid-cols-8 md:grid-cols-10 gap-2 max-h-[400px] overflow-y-auto custom-scrollbar pr-2",children:p.map(x=>{const m=(e.responses||[]).some(b=>b.propertyId===x.id);return n.jsx("div",{title:x.code,className:`h-8 flex items-center justify-center rounded-lg text-[9px] font-black border transition-all ${m?"bg-emerald-50 border-emerald-600 text-white shadow-lg":"bg-slate-50 border-slate-100 text-slate-300"}`,children:x.code.split("-")[1]||x.code},x.id)})}),n.jsxs("div",{className:"mt-10 border-t border-slate-100 pt-8 flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"text-3xl font-black text-slate-800 tracking-tighter",children:[f,"%"]}),n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Quórum Alcanzado"})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-3xl font-black text-blue-600 tracking-tighter",children:l.total}),n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Unidades en Sala"})]})]})]})})]})})})},TEe=({vote:e,properties:t,onClose:r})=>{const a=LE(e),s=[...t].sort((i,l)=>i.code.localeCompare(l.code,void 0,{numeric:!0,sensitivity:"base"}));return n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] w-full max-w-4xl h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95",children:[n.jsxs("div",{className:"p-10 border-b border-slate-100 flex justify-between items-center bg-white z-10",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl",children:n.jsx(Md,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:e.question}),n.jsx("p",{className:"text-blue-600 font-black text-[10px] uppercase tracking-widest",children:"Resultados Auditados - Zona VET"})]})]}),n.jsx("button",{onClick:r,className:"p-3 bg-slate-100 rounded-full",children:n.jsx(ft,{})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-10 bg-slate-50 custom-scrollbar",children:n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest border-b pb-2",children:"Escrutinio Global"}),e.options.map(i=>{const l=a.total>0?Math.round(a.counts[i.id]/a.total*100):0;return n.jsxs("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-200 shadow-sm space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"font-black text-slate-800",children:i.text}),n.jsxs("span",{className:"text-2xl font-black text-blue-600",children:[l,"%"]})]}),n.jsx("div",{className:"w-full bg-slate-100 h-3 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500",style:{width:`${l}%`}})}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 text-right uppercase tracking-widest",children:[a.counts[i.id]," Votos"]})]},i.id)})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest border-b pb-2",children:"Listado de Transparencia"}),n.jsx("div",{className:"bg-white rounded-[2rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50",children:[n.jsx("th",{className:"px-6 py-4 text-[9px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad"}),n.jsx("th",{className:"px-6 py-4 text-[9px] font-black uppercase text-slate-500 tracking-widest",children:"Estatus"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:s.map(i=>{const l=(e.responses||[]).find(d=>d.propertyId===i.id),o=l?e.options.find(d=>d.id===l.optionId):null;return n.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[n.jsx("td",{className:"px-6 py-3 font-black text-slate-700 text-xs",children:i.code}),n.jsx("td",{className:"px-6 py-3",children:o?n.jsx("span",{className:"px-3 py-1 bg-emerald-50 text-emerald-600 rounded-full text-[9px] font-black uppercase tracking-widest border border-emerald-100",children:o.text}):n.jsx("span",{className:"text-[9px] font-bold text-slate-300 uppercase tracking-widest",children:"Inasistencia"})})]},i.id)})})]})})]})]})})]})})},FEe=()=>{const{exchangeRateHistory:e}=ht(),[t,r]=j.useState(!0),[a,s]=j.useState(""),[i,l]=j.useState([]),[o,d]=j.useState([]),[u,f]=j.useState(!1),[p,x]=j.useState(!1),[m,b]=j.useState(""),v=j.useRef(null),y=j.useMemo(()=>{if(!e||e.length===0)return 45;const D=e[0];return(Number(D.pmValue)>0?Number(D.pmValue):Number(D.amValue))||45},[e]);j.useEffect(()=>{const D=setTimeout(()=>r(!1),600),L=localStorage.getItem("sac_calc_vars");return L&&d(JSON.parse(L)),()=>clearTimeout(D)},[]),j.useEffect(()=>{v.current&&v.current.scrollIntoView({behavior:"smooth"})},[i,a]);const k=D=>{s(a==="Error"?D:L=>L+D)},_=()=>s(""),C=()=>s(D=>D.length>0?D.slice(0,-1):""),E=()=>{if(a)try{let D=a.replace(/x/g,"*").replace(/÷/g,"/").replace(/%/g,"/100");const L=new Function("return "+D)();if(L===void 0||isNaN(L))throw new Error;const R=String(Number(L.toFixed(4)));l([...i,`${a} = ${R}`]),s(R)}catch{s("Error"),setTimeout(()=>s(""),1e3)}},T=()=>{const D=parseFloat(a);if(isNaN(D))return;const R=(D*1.16).toFixed(2);l([...i,`${a} + 16% IVA = ${R}`]),s(R)},B=()=>{const D=parseFloat(a);if(isNaN(D))return;const R=(D*y).toFixed(2);l([...i,`$${a} @ ${y} = Bs.${R}`]),s(R)},I=()=>{const D=prompt("Ingrese % Alícuota:");if(!D||isNaN(Number(D))||!a)return;const R=(Number(a)*Number(D)/100).toFixed(2);l([...i,`${a} * ${D}% = ${R}`]),s(R)},M=()=>{!a||a==="Error"||(b(""),x(!0))},U=D=>{if(D.preventDefault(),!m.trim())return;const L=[...o,{id:Date.now(),name:m.toUpperCase().substring(0,15),value:a}];d(L),localStorage.setItem("sac_calc_vars",JSON.stringify(L)),x(!1)};return t?n.jsx("div",{className:"flex items-center justify-center min-h-[60vh] bg-white rounded-[3rem] border border-slate-200 shadow-sm animate-in zoom-in duration-300",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-2xl flex items-center justify-center mx-auto mb-4 shadow-xl shadow-blue-100 animate-pulse",children:n.jsx(mi,{size:32,className:"text-white"})}),n.jsxs("h1",{className:"text-2xl font-black text-slate-900 tracking-tighter uppercase",children:["TecnoMath ",n.jsx("span",{className:"text-blue-600",children:"Calc 2026"})]}),n.jsx("p",{className:"text-slate-400 font-bold tracking-[0.2em] text-[8px] uppercase",children:"By Andres Mathison"})]})}):n.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 h-[calc(100dvh-160px)] max-h-[850px] animate-in fade-in duration-500 overflow-hidden",children:[n.jsxs("div",{className:"flex-1 bg-white p-4 sm:p-6 rounded-[2.5rem] shadow-xl border border-slate-200 flex flex-col h-full overflow-hidden",children:[n.jsxs("div",{className:"flex justify-between items-center mb-3 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-7 h-7 bg-blue-600 rounded-lg flex items-center justify-center text-white",children:n.jsx(ha,{size:14})}),n.jsx("span",{className:"text-slate-900 font-black tracking-widest text-[8px] uppercase",children:"Engine v4.0 • By Andres Mathison"})]}),n.jsx("button",{onClick:()=>f(!u),className:`p-2 rounded-lg transition-all ${u?"bg-blue-600 text-white shadow-md":"bg-slate-50 text-slate-400"}`,children:n.jsx($_,{size:16})})]}),n.jsxs("div",{className:"bg-slate-50 rounded-[1.5rem] p-4 mb-4 flex-1 flex flex-col justify-end overflow-hidden border border-slate-100 shadow-inner relative min-h-[100px]",children:[n.jsx("div",{className:"absolute top-3 left-4 text-[7px] font-black text-slate-300 uppercase tracking-widest",children:"Financial Display"}),n.jsxs("div",{className:"overflow-y-auto flex-1 flex flex-col justify-end scrollbar-hide",children:[i.slice(-3).map((D,L)=>n.jsx("div",{className:"text-right text-slate-400 text-[10px] mb-0.5 font-bold truncate opacity-60 italic",children:D},L)),n.jsx("div",{className:"text-right text-4xl sm:text-5xl text-slate-900 font-black tracking-tighter break-all leading-tight",children:a||"0"}),n.jsx("div",{ref:v})]})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-1.5 sm:gap-2 shrink-0",children:[n.jsx("button",{onClick:B,className:"bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-emerald-100 active:scale-90 uppercase tracking-widest",children:"BCV"}),n.jsx("button",{onClick:I,className:"bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-blue-100 active:scale-90 uppercase tracking-widest",children:"Aliq"}),n.jsx("button",{onClick:T,className:"bg-indigo-50 text-indigo-600 hover:bg-indigo-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-indigo-100 active:scale-90 uppercase tracking-widest",children:"IVA"}),n.jsx("button",{onClick:_,className:"bg-red-50 text-red-600 hover:bg-red-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-red-100 active:scale-90 uppercase tracking-widest",children:"AC"}),[7,8,9,"÷",4,5,6,"x",1,2,3,"-",0,".","DEL","+"].map((D,L)=>{const R=typeof D=="string"&&["÷","x","-","+"].includes(D),Q=D==="DEL";return n.jsx("button",{onClick:()=>{Q?C():k(String(D))},className:`
                                    ${R?"bg-slate-900 text-white shadow-md":Q?"bg-slate-200 text-slate-600":"bg-slate-50 text-slate-900 border border-slate-100 shadow-sm"}
                                    p-3 sm:p-4 rounded-xl font-black text-xl transition-all active:scale-90 flex items-center justify-center
                                `,children:Q?n.jsxs("div",{className:"flex flex-col items-center leading-none",children:[n.jsx(GV,{size:14}),n.jsx("span",{className:"text-[8px] mt-0.5",children:"BORRAR"})]}):D},L)})]}),n.jsxs("div",{className:"mt-3 flex gap-2 shrink-0",children:[n.jsxs("button",{onClick:M,className:"flex-1 bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white py-3.5 rounded-xl font-black text-[9px] uppercase tracking-widest border border-blue-100 active:scale-95 transition-all flex items-center justify-center gap-2",children:[n.jsx(qn,{size:14})," MEMORIZAR"]}),n.jsx("button",{onClick:E,className:"flex-[1.5] bg-blue-600 hover:bg-blue-700 text-white py-3.5 rounded-xl font-black text-2xl shadow-lg shadow-blue-100 active:scale-95 transition-all",children:"="})]})]}),n.jsxs("div",{className:`w-full lg:w-[300px] flex flex-col gap-4 transition-all duration-300 ${u?"fixed inset-0 z-[200] bg-white p-6 lg:relative lg:p-0":"lg:flex hidden"}`,children:[u&&n.jsx("button",{onClick:()=>f(!1),className:"lg:hidden absolute top-4 right-4 p-3 bg-slate-100 rounded-full text-slate-500",children:n.jsx(ft,{})}),n.jsxs("div",{className:"bg-white rounded-[2rem] shadow-lg border border-slate-200 shadow-sm flex flex-col h-full overflow-hidden",children:[n.jsx("div",{className:"p-5 bg-slate-50 border-b border-slate-100 flex justify-between items-center",children:n.jsxs("h3",{className:"font-black text-[9px] uppercase tracking-widest flex items-center gap-2 text-slate-500",children:[n.jsx($_,{size:14,className:"text-blue-600"})," Memoria Local"]})}),n.jsx("div",{className:"p-4 flex-1 overflow-y-auto custom-scrollbar space-y-2",children:o.length===0?n.jsxs("div",{className:"text-center py-10 opacity-20",children:[n.jsx(NG,{size:32,className:"mx-auto mb-2"}),n.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest",children:"Memoria vacía"})]}):o.map(D=>n.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100 flex justify-between items-center group hover:border-blue-300 transition-all",children:[n.jsxs("div",{className:"overflow-hidden",children:[n.jsx("div",{className:"font-black text-blue-600 text-[8px] truncate uppercase mb-0.5",children:D.name}),n.jsx("div",{className:"text-slate-800 font-mono text-xs font-black",children:D.value})]}),n.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-all",children:[n.jsx("button",{onClick:()=>k(D.value),className:"p-1.5 bg-blue-600 text-white rounded-md shadow-sm",children:n.jsx(JG,{size:10,fill:"currentColor"})}),n.jsx("button",{onClick:()=>{const L=o.filter(R=>R.id!==D.id);d(L),localStorage.setItem("sac_calc_vars",JSON.stringify(L))},className:"p-1.5 bg-white text-red-500 rounded-md border border-red-50",children:n.jsx(Ta,{size:10})})]})]},D.id))})]})]}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[2.5rem] p-8 w-full max-w-xs shadow-2xl animate-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex justify-between items-center mb-6",children:[n.jsx("h3",{className:"text-lg font-black text-slate-900 tracking-tight",children:"Etiquetar"}),n.jsx("button",{onClick:()=>x(!1),className:"p-1 text-slate-300",children:n.jsx(ft,{size:20})})]}),n.jsxs("form",{onSubmit:U,children:[n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-[8px] font-black text-slate-400 uppercase tracking-widest mb-2 ml-1",children:"Valor"}),n.jsx("div",{className:"text-xl font-black text-blue-600 bg-slate-50 border border-slate-100 p-3 rounded-xl text-center",children:a})]}),n.jsxs("div",{className:"mb-6",children:[n.jsx("label",{className:"block text-[8px] font-black text-slate-400 uppercase tracking-widest mb-2 ml-1",children:"Nombre"}),n.jsx("input",{autoFocus:!0,type:"text",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 outline-none font-black text-slate-800 uppercase text-xs",placeholder:"EJ: TOTAL_MARZO",value:m,onChange:D=>b(D.target.value.replace(/\s+/g,"_"))})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-4 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg shadow-blue-100 active:scale-95 transition-all",children:"GUARDAR"})]})]})})]})},IEe=()=>{const{fees:e,financialTotals:t,exchangeRateHistory:r}=ht(),[a,s]=j.useState(!1);j.useEffect(()=>{const o=setTimeout(()=>s(!0),300);return()=>clearTimeout(o)},[]);const i=j.useMemo(()=>{if(!r||r.length===0)return 45.5;const o=r[0];return Number(o==null?void 0:o.pmValue)>0?Number(o==null?void 0:o.pmValue):Number(o==null?void 0:o.amValue)||45.5},[r]),l=j.useMemo(()=>{const d=((t==null?void 0:t.cashBalanceBs)||0)/i,u=(t==null?void 0:t.initialCashUsd)||0,f=d+u,p=(t==null?void 0:t.accountsPayableUsd)||0,x=(t==null?void 0:t.receivablesUsd)||0,m=(t==null?void 0:t.totalBilledUsd)||0,b=(t==null?void 0:t.totalCollectedUsd)||0,v=f+x-p,k=[...e||[]].sort((D,L)=>L.year*12+L.month-(D.year*12+D.month)).slice(0,6).reverse().map(D=>{var Q,G;const L=D.globalStats?D.globalStats.totalBilled:((Q=D.debts)==null?void 0:Q.reduce((K,W)=>K+Number(W.amountUsd||0),0))||0,R=D.globalStats?D.globalStats.totalCollected:((G=D.debts)==null?void 0:G.reduce((K,W)=>K+Number(W.paidAmount||0),0))||0;return{name:Ue[D.month].substring(0,3),proyectado:L,cobrado:R}}),_=k.length>0?k.reduce((D,L)=>D+L.cobrado,0)/k.length:1e3,E=x*i*.0033,T=E*30,B=m>0?b/m*100:0,I=x/(m||1)*100,M=p>0?f/p*100:100,U=f/(m||1)*100;return{receivablesUsd:x,cashUsd:f,payablesUsd:p,netPosition:v,historyData:k,lossTodayBs:E,lossMonthBs:T,collectionIndex:B,debtIndex:I,solvencyIndex:M,reserveIndex:U,avgCollection:_}},[e,t,i]);return n.jsxs("div",{className:"space-y-8 sm:space-y-12 animate-in fade-in duration-1000 pb-24 w-full overflow-x-hidden px-1",children:[n.jsx("div",{className:"bg-slate-900 border-y border-slate-800 h-12 sm:h-14 flex items-center overflow-hidden relative shadow-2xl rounded-xl sm:rounded-2xl mx-1",children:n.jsxs("div",{className:"flex items-center gap-8 sm:gap-20 whitespace-nowrap animate-marquee font-mono text-xs sm:text-sm lg:text-base font-bold text-white",children:[n.jsx(Xu,{label:"NAV (VALOR NETO)",value:`$${l.netPosition.toLocaleString(void 0,{minimumFractionDigits:2})}`,trend:l.netPosition>=0?"up":"down"}),n.jsx(Xu,{label:"TASA SELLO",value:`${i.toFixed(2)} VES`,color:"text-blue-400"}),n.jsx(Xu,{label:"CASH TOTAL (BANCO+CASH)",value:`$${l.cashUsd.toLocaleString()}`}),n.jsx(Xu,{label:"ÍNDICE RECAUDACIÓN",value:`${l.collectionIndex.toFixed(1)}%`,trend:"up"}),n.jsx(Xu,{label:"MOROSIDAD ACUMULADA",value:`$${l.receivablesUsd.toLocaleString()}`,color:"text-rose-400"}),n.jsx(Xu,{label:"ESTADO SISTEMA",value:"K. V4.0.80 ONLINE",color:"text-emerald-400"})]})}),n.jsxs("div",{className:"text-left px-2 sm:px-4",children:[n.jsxs("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter uppercase leading-none",children:["TERMINAL ",n.jsx("span",{className:"text-blue-600",children:"FINANCIERO PRO"})]}),n.jsx("p",{className:"text-[9px] sm:text-xs lg:text-sm font-black text-slate-400 uppercase tracking-[0.3em] mt-3 sm:mt-4",children:"INTELIGENCIA DE DATOS SAC 2026 • RENDIMIENTO MULTIPLATAFORMA"})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-8 lg:gap-10 px-1",children:[n.jsx(Wx,{label:"CARTERA POR COBRAR",valUsd:l.receivablesUsd,sub:"Total Morosidad Global",icon:ha,color:"emerald"}),n.jsx(Wx,{label:"EGRESOS PENDIENTES",valUsd:l.payablesUsd,sub:"Compromisos Cuentas Pagar",icon:db,color:"rose"}),n.jsx(Wx,{label:"LIQUIDEZ TOTAL",valUsd:l.cashUsd,sub:"Suma Banco + Cash USD",icon:La,color:"blue"}),n.jsx(Wx,{label:"POSICIÓN NETA",valUsd:l.netPosition,sub:"Patrimonio Común Activo",icon:Fp,color:"amber"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 sm:gap-10 lg:gap-12 w-full px-1",children:[n.jsxs("div",{className:"w-full lg:flex-[2] bg-white p-6 sm:p-10 lg:p-14 rounded-[2rem] sm:rounded-[4rem] border border-slate-200 shadow-sm flex flex-col",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-10 lg:mb-14 gap-6",children:[n.jsxs("h3",{className:"text-sm sm:text-xl lg:text-2xl font-black text-slate-800 flex items-center gap-4 uppercase tracking-tight",children:[n.jsx(po,{className:"text-blue-600",size:24})," HISTORIAL DE CONVERGENCIA (6M)"]}),n.jsxs("div",{className:"flex gap-6 text-[10px] sm:text-xs lg:text-sm font-black uppercase text-slate-400",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 bg-slate-200 rounded-full"})," Facturación"]}),n.jsxs("span",{className:"flex items-center gap-2 text-blue-600",children:[n.jsx("div",{className:"w-2 h-2 bg-blue-600 rounded-full"})," Recaudación"]})]})]}),n.jsx("div",{className:"h-[300px] sm:h-[400px] lg:h-[500px] w-full min-h-[300px]",children:a&&n.jsx(jk,{width:"100%",height:"100%",minWidth:0,children:n.jsxs(Qj,{data:l.historyData,margin:{top:10,right:10,left:-20,bottom:0},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"c",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.1}),n.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]})}),n.jsx(Xb,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(Jb,{dataKey:"name",fontSize:12,fontWeight:"bold",axisLine:!1,tickLine:!1,dy:10}),n.jsx(Zb,{fontSize:12,fontWeight:"bold",axisLine:!1,tickLine:!1}),n.jsx(Bj,{contentStyle:{borderRadius:"16px",border:"none",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1)",fontSize:"14px",fontWeight:"bold"}}),n.jsx(FA,{type:"monotone",dataKey:"proyectado",stroke:"#cbd5e1",strokeWidth:1,fill:"transparent",strokeDasharray:"5 5"}),n.jsx(FA,{type:"monotone",dataKey:"cobrado",stroke:"#2563eb",strokeWidth:4,fill:"url(#c)"})]})})})]}),n.jsxs("div",{className:"w-full lg:flex-1 bg-white p-6 sm:p-10 lg:p-14 rounded-[2rem] sm:rounded-[4rem] border border-slate-200 shadow-sm flex flex-col",children:[n.jsxs("h3",{className:"text-sm sm:text-xl lg:text-2xl font-black text-slate-800 flex items-center gap-4 mb-10 lg:mb-14 uppercase tracking-tight",children:[n.jsx(ja,{className:"text-amber-500",size:24})," PROYECCIÓN TEMPORAL"]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-4 sm:gap-6 lg:gap-8 overflow-y-auto pr-1",children:[30,90,180].map(o=>n.jsxs("div",{className:"bg-slate-50 p-6 sm:p-8 lg:p-10 rounded-[2rem] sm:rounded-[3rem] border border-slate-100 space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center text-[10px] sm:text-xs lg:text-sm font-black text-amber-500 uppercase tracking-widest",children:[n.jsxs("span",{children:["Horizonte ",o," Días"]}),n.jsx(ZC,{size:16,className:"text-slate-200"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[8px] sm:text-[10px] lg:text-xs font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Deuda Residual Proyectada"}),n.jsxs("p",{className:"text-xl sm:text-3xl lg:text-4xl font-black text-slate-900 tracking-tighter leading-none font-mono",children:["$",Math.max(0,Math.round(l.receivablesUsd-l.avgCollection*(o/30))).toLocaleString()]})]}),n.jsx("p",{className:"text-[8px] sm:text-[9px] font-bold text-slate-400 uppercase",children:"Basado en promedio móvil de recaudación"})]},o))}),n.jsxs("div",{className:"mt-8 lg:mt-12 p-6 sm:p-8 bg-blue-50 border border-blue-100 rounded-[2rem] flex gap-5 items-center",children:[n.jsx(hs,{className:"text-blue-600 shrink-0",size:24}),n.jsx("p",{className:"text-[8px] sm:text-xs text-blue-800 font-bold uppercase leading-relaxed tracking-tight italic",children:"Algoritmo predictivo Kernel V4.0.80."})]})]})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 sm:gap-10 lg:gap-12 px-1",children:[n.jsxs("div",{className:"w-full lg:flex-1 bg-slate-900 p-10 sm:p-16 lg:p-20 rounded-[2.5rem] sm:rounded-[4rem] text-white shadow-2xl overflow-hidden relative min-h-[450px]",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("div",{className:"w-16 h-16 sm:w-20 sm:h-20 bg-blue-600 rounded-3xl flex items-center justify-center text-white shadow-xl mb-10 lg:mb-14 border border-blue-400/30",children:n.jsx(sa,{size:32})}),n.jsxs("h3",{className:"text-2xl sm:text-4xl lg:text-5xl font-black tracking-tighter uppercase leading-none",children:["Laboratorio de ",n.jsx("br",{})," ",n.jsx("span",{className:"text-blue-500",children:"Pérdida Cambiaria"})]}),n.jsx("p",{className:"text-[10px] sm:text-sm lg:text-base font-black text-red-500 uppercase tracking-widest mt-6",children:"Erosión del capital por morosidad acumulada"}),n.jsxs("div",{className:"mt-12 sm:mt-16 space-y-10 lg:space-y-14",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] sm:text-xs font-black text-slate-500 uppercase tracking-widest block mb-2",children:"Erosión Diaria Estimada"}),n.jsxs("p",{className:"text-3xl sm:text-5xl lg:text-6xl font-black text-red-500 tracking-tighter leading-none font-mono italic",children:["Bs. ",l.lossTodayBs.toLocaleString(void 0,{minimumFractionDigits:2})]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] sm:text-xs font-black text-slate-500 uppercase tracking-widest block mb-2",children:"Erosión Mensual Proyectada"}),n.jsxs("p",{className:"text-3xl sm:text-5xl lg:text-6xl font-black text-red-600 tracking-tighter leading-none font-mono",children:["Bs. ",l.lossMonthBs.toLocaleString(void 0,{minimumFractionDigits:2})]})]})]})]}),n.jsx(xr,{className:"absolute bottom-[-50px] right-[-50px] w-80 h-80 lg:w-[450px] lg:h-[450px] text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"w-full lg:flex-1 bg-white p-10 sm:p-16 lg:p-20 rounded-[2.5rem] sm:rounded-[4rem] border border-slate-200 shadow-sm flex flex-col items-center",children:[n.jsxs("h3",{className:"text-xl sm:text-2xl lg:text-3xl font-black text-slate-900 tracking-tighter uppercase mb-12 sm:mb-16 flex items-center gap-6",children:[n.jsx(lk,{className:"text-blue-600",size:32})," Índices de Liquidez"]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:gap-6 lg:gap-8 mb-12 sm:mb-16 w-full",children:[n.jsx(Yx,{label:"COBRANZA",val:`${l.collectionIndex.toFixed(1)}%`,color:"emerald"}),n.jsx(Yx,{label:"DEUDA",val:`${l.debtIndex.toFixed(1)}%`,color:"rose"}),n.jsx(Yx,{label:"SOLVENCIA",val:`${l.solvencyIndex.toFixed(0)}%`,color:"blue"}),n.jsx(Yx,{label:"RESERVA",val:`${l.reserveIndex.toFixed(1)}%`,color:"indigo"})]}),n.jsxs("div",{className:"w-full max-w-[450px] aspect-square bg-slate-900 rounded-[3rem] sm:rounded-[5rem] p-10 lg:p-14 flex flex-col items-center justify-center text-center shadow-2xl relative overflow-hidden group",children:[n.jsx("div",{className:"w-16 h-16 sm:w-20 sm:h-20 bg-blue-600 rounded-3xl flex items-center justify-center text-white mb-8 shadow-2xl relative z-10",children:n.jsx(Md,{size:32,className:"lg:w-10 lg:h-10"})}),n.jsx("h4",{className:"text-white text-lg sm:text-xl font-black tracking-widest mb-3 relative z-10 uppercase",children:"Net Asset Value (NAV)"}),n.jsxs("div",{className:"text-5xl sm:text-7xl lg:text-8xl font-black text-blue-500 drop-shadow-[0_0_30px_rgba(59,130,246,0.5)] relative z-10 tracking-tighter font-mono italic",children:["$",Math.round(l.netPosition).toLocaleString()]}),n.jsx(ja,{className:"absolute right-[-40px] bottom-[-40px] w-80 h-80 lg:w-[500px] lg:h-[500px] text-white/5 pointer-events-none group-hover:scale-110 transition-transform duration-[10s]"})]})]})]}),n.jsx("div",{className:"pt-14 sm:pt-20 text-center",children:n.jsx("p",{className:"text-[8px] sm:text-xs lg:text-sm font-black text-slate-300 uppercase tracking-[0.4em] leading-relaxed px-6 sm:px-12 italic",children:"TECNOMATH FINANCIAL ANALYTICS • KERNEL V4.0.80 • AUDITORÍA DE DATOS VERIFICADA • PROCESAMIENTO DISTRIBUIDO"})}),n.jsx("style",{children:`
          @keyframes marquee {
              0% { transform: translateX(0); }
              100% { transform: translateX(-50%); }
          }
          .animate-marquee {
              display: inline-block;
              padding-left: 100%;
              animation: marquee 40s linear infinite;
          }
      `})]})},Xu=({label:e,value:t,trend:r,color:a})=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-slate-500 uppercase tracking-widest text-[9px] font-black",children:[e,":"]}),n.jsx("span",{className:`${a||"text-white"} font-black font-mono`,children:t}),r&&n.jsx("div",{className:`p-1 rounded-full ${r==="up"?"bg-emerald-500/20 text-emerald-400":"bg-rose-500/20 text-rose-400"}`,children:r==="up"?n.jsx(ZC,{size:10}):n.jsx(J7,{size:10})})]}),Wx=({label:e,valUsd:t,sub:r,icon:a,color:s})=>{const i={emerald:"bg-emerald-50 text-emerald-600 border-emerald-100 shadow-emerald-50",rose:"bg-rose-50 text-rose-600 border-rose-100 shadow-rose-50",blue:"bg-blue-50 text-blue-600 border-blue-100 shadow-blue-50",amber:"bg-amber-50 text-amber-600 border-amber-100 shadow-amber-50"},l={emerald:"text-emerald-600",rose:"text-rose-600",blue:"text-blue-600",amber:"text-amber-600"},o=i[s],d=l[s];return n.jsxs("div",{className:"w-full bg-white p-6 sm:p-10 lg:p-12 rounded-[2rem] sm:rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col overflow-hidden group hover:border-blue-400 transition-all cursor-default",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsx("div",{className:`w-12 h-12 sm:w-16 sm:h-16 lg:w-20 lg:h-20 rounded-2xl sm:rounded-3xl flex items-center justify-center flex-shrink-0 border shadow-lg ${o} group-hover:scale-110 transition-transform`,children:n.jsx(a,{size:24})}),n.jsx("span",{className:"text-[8px] sm:text-xs lg:text-sm font-black text-slate-400 uppercase tracking-widest text-right leading-none mt-2 max-w-[80px] sm:max-w-none",children:e})]}),n.jsxs("div",{className:"mt-10 sm:mt-16 lg:mt-20",children:[n.jsxs("h4",{className:`text-xl sm:text-3xl lg:text-4xl xl:text-5xl font-black ${d} tracking-tighter leading-none font-mono italic`,children:["$",t.toLocaleString(void 0,{minimumFractionDigits:2})]}),n.jsx("p",{className:"text-[8px] sm:text-xs lg:text-sm font-bold text-slate-400 uppercase mt-6 tracking-tighter truncate opacity-70",children:r})]})]})},Yx=({label:e,val:t,color:r})=>{const a=r==="emerald"?"text-emerald-600":r==="rose"?"text-rose-600":r==="indigo"?"text-indigo-600":"text-blue-600",s=r==="emerald"?"bg-emerald-50":r==="rose"?"bg-rose-50":r==="indigo"?"bg-indigo-50":"bg-blue-50",i=r==="emerald"?"border-emerald-100":r==="rose"?"border-rose-100":r==="indigo"?"border-indigo-100":"border-blue-100";return n.jsxs("div",{className:`${s} ${i} border rounded-2xl sm:rounded-3xl flex flex-col items-center justify-center text-center p-4 sm:p-8 lg:p-10 transition-transform hover:scale-105 shadow-sm`,children:[n.jsx("span",{className:"text-[7px] sm:text-[10px] lg:text-xs font-black text-slate-400 uppercase tracking-widest mb-3 sm:mb-4",children:e}),n.jsx("span",{className:`text-[10px] sm:text-lg lg:text-xl xl:text-2xl font-black leading-none ${a} font-mono`,children:t})]})},DEe=({user:e})=>{const{reservations:t,addReservation:r,updateReservationStatus:a,deleteReservation:s,isPoolEnabled:i,togglePoolAvailability:l,properties:o,residents:d,loading:u,refreshData:f}=ht(),[p,x]=j.useState(!1),[m,b]=j.useState({facility:"Caney",whatsapp:e.phone||""}),v=e.role==="programmer",y=["admin","board","programmer"].includes(e.role),k=e.propertyCode||"S/I",_=e.propertyId,C=j.useMemo(()=>{const B=["Caney","Piñatero","Salón de Fiesta","Salón Extra"];return i&&B.push("Piscina"),B},[i]),E=async B=>{B.preventDefault();const I=y?m.propertyId:_;if(!I)return alert("ERROR: Su cuenta no tiene una unidad inmobiliaria asignada. Contacte a soporte.");const M={facility:m.facility,date:m.date,propertyId:I,residentName:e.fullName,whatsapp:m.whatsapp,status:y?"Aprobada":"Pendiente"};try{await r(M),x(!1),b({facility:"Caney",whatsapp:e.phone||""})}catch{alert("Error al procesar reserva.")}},T=async B=>{confirm("¿Eliminar reserva permanentemente de la pizarra?")&&await s(B)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[v&&n.jsxs("div",{className:"bg-slate-900 p-6 rounded-[2rem] border border-slate-800 shadow-xl flex items-center justify-between group overflow-hidden relative",children:[n.jsx("div",{className:"relative z-10",children:n.jsxs("h4",{className:"text-white font-black text-xs uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Rd,{className:"text-blue-500",size:14})," Facility Master Switch"]})}),n.jsxs("button",{onClick:()=>l(!i),className:`relative z-10 px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all flex items-center gap-3 ${i?"bg-emerald-600 text-white":"bg-red-600 text-white"}`,children:[i?n.jsx(W_,{size:16}):n.jsx(ft,{size:16})," Piscina: ",i?"DISPONIBLE":"BLOQUEADA"]}),n.jsx(W_,{className:"absolute right-[-20px] bottom-[-20px] w-32 h-32 text-blue-500/5 pointer-events-none group-hover:scale-110 transition-transform"})]}),y&&t.filter(B=>B.status==="Pendiente").length>0&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-8 rounded-[3rem] shadow-sm animate-in slide-in-from-top",children:[n.jsxs("h3",{className:"text-xl font-black text-amber-800 flex items-center gap-3 mb-6",children:[n.jsx(Ea,{size:24})," Solicitudes Entrantes (",t.filter(B=>B.status==="Pendiente").length,")"]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.filter(B=>B.status==="Pendiente").map(B=>n.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-amber-200 shadow-sm space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsx("span",{className:"bg-blue-50 text-blue-600 px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest",children:B.facility}),n.jsx("span",{className:"text-xs font-black text-slate-900",children:B.date})]}),n.jsxs("p",{className:"font-black text-slate-800 text-sm uppercase tracking-tight truncate",children:[B.propertyCode||"N/A"," - ",B.residentName]}),n.jsxs("div",{className:"flex gap-2 pt-2",children:[n.jsx("button",{onClick:()=>a(B.id,"Aprobada"),className:"flex-1 bg-emerald-600 text-white py-2.5 rounded-xl font-black text-[10px] uppercase",children:"Aprobar"}),n.jsx("button",{onClick:()=>a(B.id,"Rechazada"),className:"flex-1 bg-red-50 text-red-600 py-2.5 rounded-xl font-black text-[10px] uppercase",children:"Rechazar"})]})]},B.id))})]}),n.jsxs("div",{className:"bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-6 mb-12",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-3xl flex items-center justify-center text-white shadow-xl shadow-blue-500/20",children:n.jsx(G_,{size:32})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Agenda de Áreas Comunes"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Cronograma global de uso de instalaciones."})]})]}),n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsx("button",{onClick:()=>f(),className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ot,{size:24,className:u?"animate-spin":""})}),n.jsxs("button",{onClick:()=>x(!0),className:"flex-1 md:flex-none bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 transition-all flex items-center justify-center gap-3 active:scale-95",children:[n.jsx(Cn,{size:20})," Reservar"]})]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.length===0?n.jsxs("div",{className:"col-span-full py-24 text-center border border-dashed border-slate-200 rounded-[3rem]",children:[n.jsx(G_,{size:48,className:"mx-auto mb-4 text-slate-200"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"Sin eventos registrados"})]}):[...t].sort((B,I)=>new Date(B.date).getTime()-new Date(I.date).getTime()).map(B=>n.jsxs("div",{className:`p-8 rounded-[2.5rem] border relative overflow-hidden transition-all group ${B.status==="Rechazada"?"opacity-40 grayscale":"hover:border-blue-400 hover:shadow-xl"}`,children:[n.jsxs("div",{className:"flex justify-between items-start mb-6",children:[n.jsx("div",{className:"p-3 rounded-2xl bg-slate-50 text-slate-400 group-hover:bg-blue-600 group-hover:text-white transition-all",children:n.jsx(Gr,{size:24})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${B.status==="Aprobada"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:B.status}),y&&n.jsx("button",{onClick:()=>T(B.id),className:"p-1.5 bg-red-50 text-red-600 rounded-lg opacity-0 group-hover:opacity-100 transition-all hover:bg-red-600 hover:text-white shadow-sm",children:n.jsx(Ta,{size:14})})]})]}),n.jsx("h3",{className:"text-xl font-black text-slate-900 mb-1",children:B.facility}),n.jsxs("p",{className:"text-blue-600 font-black text-sm mb-6 flex items-center gap-2",children:[n.jsx(CM,{size:14})," ",B.date]}),n.jsxs("div",{className:"pt-5 border-t border-slate-100 space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Residente Titular:"}),n.jsx("span",{className:"text-[10px] font-black text-blue-600 bg-blue-50 px-2 py-0.5 rounded-full",children:B.propertyCode||"UN-X"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-100 flex items-center justify-center text-[10px] font-black text-slate-600 uppercase",children:(B.residentName||"?")[0]}),n.jsx("span",{className:"text-xs font-black text-slate-800 uppercase truncate",children:B.residentName})]})]})]},B.id))})]}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center text-white",children:n.jsx(Cn,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Nueva Reserva"})]}),n.jsx("button",{onClick:()=>x(!1),className:"p-3 bg-slate-100 rounded-full hover:bg-slate-200 transition-colors",children:n.jsx(ft,{})})]}),n.jsxs("form",{onSubmit:E,className:"space-y-6",children:[y?n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Vincular a Unidad"}),n.jsxs("select",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:m.propertyId,onChange:B=>b({...m,propertyId:Number(B.target.value)}),children:[n.jsx("option",{value:"",children:"-- Seleccione Unidad --"}),o.map(B=>{const I=d.find(M=>M.propertyId===B.id&&M.isOwner);return n.jsxs("option",{value:B.id,children:[B.code," - ",(I==null?void 0:I.fullName)||"Sin Propietario"]},B.id)})]})]}):n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-6 rounded-[2rem] space-y-2",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest",children:"Solicitante"}),n.jsxs("p",{className:"font-black text-blue-900 text-lg uppercase tracking-tighter",children:[k," - ",e.fullName]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Instalación Destino"}),n.jsx("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:m.facility,onChange:B=>b({...m,facility:B.target.value}),children:C.map(B=>n.jsx("option",{value:B,children:B},B))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Fecha"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:m.date,onChange:B=>b({...m,date:B.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"WhatsApp"}),n.jsx("input",{required:!0,type:"tel",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none",value:m.whatsapp,onChange:B=>b({...m,whatsapp:B.target.value}),placeholder:"Ej: 04120000000"})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl active:scale-95 transition-all",children:y?"CONFIRMAR REGISTRO":"ENVIAR SOLICITUD"})]})]})})]})},UEe=({user:e})=>{const{announcements:t,addAnnouncement:r,updateAnnouncementStatus:a,deleteAnnouncement:s,refreshData:i,loading:l}=ht(),[o,d]=j.useState(""),[u,f]=j.useState(""),[p,x]=j.useState("Media"),m=["admin","programmer","board"].includes(e.role),b=e.role==="family";j.useEffect(()=>{i()},[]);const v=async C=>{C.preventDefault();const E={title:o,content:u,priority:p,authorId:e.id,status:m?"Publicado":"Pendiente"};try{await r(E),d(""),f(""),await i(),alert(m?"Comunicado publicado exitosamente.":"Comunicado enviado a moderación.")}catch{alert("Error al guardar comunicado.")}},y=async C=>{confirm("¿ELIMINAR PERMANENTEMENTE? Esta acción borrará el registro de la base de datos de forma irreversible.")&&await s(C)},k=t.filter(C=>C.status==="Publicado"),_=t.filter(C=>C.status==="Pendiente");return n.jsxs("div",{className:"space-y-10 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-3xl font-black text-slate-800 tracking-tight",children:"Comunicados"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Gestión de la cartelera informativa oficial."})]}),n.jsx("button",{onClick:()=>i(),disabled:l,className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-slate-50 transition-all shadow-sm active:scale-95",children:n.jsx(ot,{size:20,className:l?"animate-spin":""})})]}),m&&_.length>0&&n.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 p-8 rounded-[3rem] shadow-sm animate-in slide-in-from-top duration-500",children:[n.jsxs("h3",{className:"text-xl font-black text-indigo-800 flex items-center gap-3 mb-8",children:[n.jsx(ho,{size:24})," Pendientes de Aprobación (",_.length,")"]}),n.jsx("div",{className:"grid grid-cols-1 gap-4",children:_.map(C=>n.jsxs("div",{className:"bg-white p-8 rounded-[2rem] border border-indigo-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("h4",{className:"text-lg font-black text-slate-800",children:C.title}),n.jsx("span",{className:"bg-slate-100 text-slate-400 px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest",children:C.date})]}),n.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed",children:C.content}),n.jsxs("p",{className:"text-[10px] font-black text-indigo-600 mt-4 uppercase tracking-widest",children:["Autor original: ",C.author]})]}),n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>a(C.id,"Publicado"),className:"flex-1 lg:flex-none px-8 py-3 bg-emerald-600 text-white rounded-xl font-black text-[10px] uppercase shadow-lg shadow-emerald-200 active:scale-95 transition-all",children:"Aprobar"}),n.jsx("button",{onClick:()=>y(C.id),className:"flex-1 lg:flex-none px-8 py-3 bg-red-50 text-red-600 rounded-xl font-black text-[10px] uppercase hover:bg-red-600 hover:text-white transition-all",children:"Eliminar"})]})]},C.id))})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[4rem] p-8 lg:p-14 shadow-2xl relative overflow-hidden group border-b-8 border-slate-800",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"flex items-center gap-6 mb-12",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(Gf,{size:32,className:k.length>0?"animate-pulse":""})}),n.jsxs("h2",{className:"text-4xl font-black text-white tracking-tighter",children:["Cartelera ",n.jsx("span",{className:"text-blue-500",children:"Digital"})]})]}),n.jsx("div",{className:"space-y-8 max-h-[600px] overflow-y-auto custom-scrollbar pr-4",children:k.length===0?n.jsxs("div",{className:"py-32 text-center text-slate-600",children:[n.jsx(Nn,{size:48,className:"mx-auto mb-4 opacity-20"}),n.jsx("p",{className:"font-black uppercase tracking-widest text-sm italic",children:"Sin comunicados publicados recientemente"})]}):k.map(C=>n.jsxs("div",{className:"bg-white/5 border border-white/5 p-10 rounded-[3rem] hover:bg-white/[0.08] transition-all relative overflow-hidden group",children:[n.jsxs("div",{className:"flex justify-between items-start mb-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("span",{className:"text-[10px] font-black text-blue-500 uppercase tracking-widest",children:["[",C.date,"]"]}),n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:C.author})]}),C.priority==="Alta"&&n.jsx(Lc,{size:16,className:"text-amber-400 fill-amber-400 animate-flicker"})]}),n.jsxs("h3",{className:"text-2xl font-black text-blue-100 tracking-tight mb-4",children:["» ",C.title]}),n.jsx("p",{className:"text-slate-300 text-lg leading-relaxed font-medium",children:C.content}),m&&n.jsx("button",{onClick:()=>y(C.id),className:"absolute top-8 right-8 p-3 bg-red-500/10 text-red-500 rounded-xl opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-500 hover:text-white",children:n.jsx(Ta,{size:18})})]},C.id))})]}),n.jsx(Gf,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/5 pointer-events-none"})]}),!b&&n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[4rem] border border-slate-200 shadow-sm relative overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-10",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-900 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx(Gi,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Emitir Nuevo Comunicado"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Redacte la información para la comunidad."})]})]}),n.jsxs("form",{onSubmit:v,className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título del Comunicado"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 transition-all",value:o,onChange:C=>d(C.target.value),placeholder:"Ej: Mantenimiento de Ascensores"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Prioridad Visual"}),n.jsx("div",{className:"flex gap-3",children:["Baja","Media","Alta"].map(C=>n.jsx("button",{type:"button",onClick:()=>x(C),className:`flex-1 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest border transition-all ${p===C?"bg-slate-900 text-white border-slate-900 shadow-lg":"bg-white text-slate-400 border-slate-200 hover:bg-slate-50"}`,children:C},C))})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Mensaje Completo"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 font-medium text-slate-800 outline-none min-h-[160px] focus:ring-2 focus:ring-blue-600 transition-all",value:u,onChange:C=>f(C.target.value),placeholder:"Escriba aquí los detalles..."})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 flex items-center justify-center gap-3 active:scale-95 transition-all",children:m?"PUBLICAR GLOBALMENTE":"ENVIAR A REVISIÓN"})]})]})]})]})},MEe=({user:e})=>{const{maintenance:t,addMaintenance:r,updateMaintenanceStatus:a,deleteMaintenance:s,properties:i,residents:l}=ht(),[o,d]=j.useState(!1),[u,f]=j.useState({type:"Servicio",description:""}),p=["admin","programmer","board"].includes(e.role),x=e.role==="family",m=e.propertyCode||"S/I",b=e.propertyId,v=async C=>{C.preventDefault();const E=p?u.propertyId:b,T={type:u.type,description:u.description,propertyId:E,requestedById:e.id,requestDate:new Date().toISOString().split("T")[0],status:p?"Pendiente":"Por Aprobar"};try{await r(T),d(!1),f({type:"Servicio",description:""})}catch{alert("Error al registrar reporte.")}},y=async C=>{confirm("¿Borrar ticket de falla permanentemente del historial?")&&await s(C)},k=t.filter(C=>C.status==="Por Aprobar"),_=t.filter(C=>C.status!=="Por Aprobar"&&C.status!=="Rechazada");return n.jsxs("div",{className:"space-y-10 animate-in fade-in duration-500 pb-20",children:[p&&k.length>0&&n.jsxs("div",{className:"bg-orange-50 border border-orange-100 p-8 rounded-[3rem] shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-orange-800 flex items-center gap-3 mb-8",children:[n.jsx(Ea,{size:24})," Validación de Tickets (",k.length,")"]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:k.map(C=>n.jsxs("div",{className:"bg-white p-8 rounded-[2rem] border border-orange-200 shadow-sm space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"text-xl font-black text-slate-800",children:C.type}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx(Gr,{size:12,className:"text-orange-500"}),n.jsxs("span",{className:"text-[10px] font-black text-orange-600 uppercase tracking-widest",children:["Unidad: ",C.propertyCode||"General"]})]})]}),n.jsx("span",{className:"bg-orange-100 text-orange-600 px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest",children:"Por Validar"})]}),n.jsx("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100",children:n.jsxs("p",{className:"text-slate-500 text-sm font-medium leading-relaxed italic",children:['"',C.description,'"']})}),n.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-50",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-full bg-slate-200 flex items-center justify-center text-[8px] font-black uppercase",children:(C.requestedBy||"?")[0]}),n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-tight",children:["Reportado por: ",C.requestedBy]})]}),n.jsx("span",{className:"text-[9px] font-black text-slate-300 uppercase",children:C.requestDate})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>a(C.id,"Pendiente"),className:"flex-1 bg-emerald-600 text-white py-3 rounded-xl font-black text-[10px] uppercase shadow-lg shadow-emerald-200 transition-all active:scale-95",children:"Aceptar"}),n.jsx("button",{onClick:()=>a(C.id,"Rechazada"),className:"flex-1 bg-red-50 text-red-600 py-3 rounded-xl font-black text-[10px] uppercase hover:bg-red-600 hover:text-white transition-all",children:"Denegar"})]})]},C.id))})]}),n.jsxs("div",{className:"bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-6 mb-12",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-900 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(qf,{size:32})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Centro de Servicios"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Control de averías y mantenimiento preventivo."})]})]}),!x&&n.jsxs("button",{onClick:()=>d(!0),className:"w-full md:w-auto bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(Cn,{size:20})," Reportar Incidencia"]})]}),n.jsx("div",{className:"space-y-4",children:_.length===0?n.jsxs("div",{className:"py-24 text-center border border-dashed border-slate-200 rounded-[3rem]",children:[n.jsx(La,{size:48,className:"mx-auto mb-4 text-slate-200 opacity-20"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm italic",children:"Sin reportes de averías activos"})]}):_.map(C=>n.jsxs("div",{className:"bg-slate-50 border border-slate-200 p-8 rounded-[2.5rem] flex flex-col lg:flex-row justify-between items-center gap-8 hover:bg-white hover:border-blue-300 transition-all group shadow-sm",children:[n.jsxs("div",{className:"flex items-center gap-6 flex-1",children:[n.jsx("div",{className:"w-14 h-14 bg-white border border-slate-200 rounded-2xl flex items-center justify-center text-slate-400 group-hover:bg-blue-600 group-hover:text-white transition-all shadow-sm",children:n.jsx(qf,{size:24})}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("h4",{className:"text-xl font-black text-slate-800",children:C.type}),n.jsx("span",{className:`px-4 py-1 rounded-full text-[9px] font-black uppercase tracking-widest border ${C.status==="Completado"?"bg-emerald-50 text-emerald-600 border-emerald-100":C.status==="En Proceso"?"bg-blue-50 text-blue-600 border-blue-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:C.status}),n.jsxs("span",{className:"text-[9px] font-black text-blue-600 bg-blue-50 px-2.5 py-1 rounded-lg uppercase tracking-tighter",children:["UNIDAD: ",C.propertyCode||"GRAL"]}),p&&n.jsx("button",{onClick:()=>y(C.id),className:"p-1.5 bg-red-50 text-red-600 rounded-lg opacity-0 group-hover:opacity-100 transition-all hover:bg-red-600 hover:text-white shadow-sm",children:n.jsx(Ta,{size:14})})]}),n.jsx("p",{className:"text-slate-500 font-medium leading-relaxed max-w-2xl",children:C.description}),n.jsxs("div",{className:"flex flex-wrap items-center gap-y-2 gap-x-4 pt-4 mt-2 border-t border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-2 h-2 rounded-full bg-slate-300"}),n.jsxs("span",{className:"text-[9px] font-black text-slate-400 uppercase",children:["Solicitud: ",C.requestDate]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(eu,{size:10,className:"text-slate-300"}),n.jsxs("span",{className:"text-[9px] font-black text-slate-400 uppercase",children:["Emisor: ",C.requestedBy]})]}),C.attendedAt&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Bc,{size:10,className:"text-blue-300"}),n.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500"}),n.jsxs("span",{className:"text-[9px] font-black text-blue-500 uppercase tracking-tighter",children:["Atención: ",C.attendedAt]})]}),C.closedAt&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Bc,{size:10,className:"text-emerald-300"}),n.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),n.jsxs("span",{className:"text-[9px] font-black text-emerald-600 uppercase tracking-tighter",children:["Cierre: ",C.closedAt]})]})]})]})]}),p&&C.status!=="Completado"&&n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[C.status==="Pendiente"&&n.jsx("button",{onClick:()=>a(C.id,"En Proceso"),className:"flex-1 lg:flex-none px-8 py-3 bg-blue-600 text-white rounded-xl font-black text-[10px] uppercase shadow-lg shadow-blue-200 transition-all",children:"Atender"}),n.jsx("button",{onClick:()=>a(C.id,"Completado"),className:"flex-1 lg:flex-none px-8 py-3 bg-slate-900 text-white rounded-xl font-black text-[10px] uppercase transition-all",children:"Cerrar Ticket"})]}),C.status==="Completado"&&n.jsx("div",{className:"p-4 bg-emerald-50 text-emerald-600 rounded-full border border-emerald-100",children:n.jsx(Wi,{size:28})})]},C.id))})]}),o&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-xl shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Ticket de Falla"}),n.jsx("button",{onClick:()=>d(!1),className:"p-3 bg-slate-100 rounded-full",children:n.jsx(ft,{})})]}),n.jsxs("form",{onSubmit:v,className:"space-y-8",children:[p?n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Vincular Unidad"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:u.propertyId,onChange:C=>f({...u,propertyId:Number(C.target.value)}),children:[n.jsx("option",{value:"",children:"-- Mantenimiento General --"}),i.map(C=>n.jsx("option",{value:C.id,children:C.code},C.id))]})]}):n.jsxs("div",{className:"p-4 bg-blue-50 rounded-2xl text-[10px] font-black text-blue-600 uppercase tracking-widest",children:["Reporte desde unidad: ",m]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Categoría"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:u.type,onChange:C=>f({...u,type:C.target.value}),children:[n.jsx("option",{value:"Servicio",children:"Servicio General"}),n.jsx("option",{value:"Daño",children:"Reporte de Daño"}),n.jsx("option",{value:"Jardinería",children:"Jardinería"}),n.jsx("option",{value:"Piscina",children:"Piscina"}),n.jsx("option",{value:"Otro",children:"Otro"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-[2.5rem] px-6 py-4 font-medium text-slate-900 outline-none min-h-[160px]",value:u.description,onChange:C=>f({...u,description:C.target.value}),placeholder:"Detalle el problema..."})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl active:scale-95 transition-all",children:"EMITIR TICKET"})]})]})})]})},REe=({user:e})=>{const{assemblies:t,addAssembly:r,deleteAssembly:a,properties:s,refreshData:i}=ht(),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(!1),[x,m]=j.useState(!1),[b,v]=j.useState(""),[y,k]=j.useState(""),[_,C]=j.useState(""),[E,T]=j.useState([]),[B,I]=j.useState(null),[M,U]=j.useState(""),D=["programmer","admin","board"].includes(e.role);j.useEffect(()=>{(async()=>{const te=await we.getSystemSettings();v(te.next_assembly_date||"")})()},[]);const L=async()=>{try{await we.updateSystemSetting("next_assembly_date",b),alert("Fecha actualizada. Se reflejará en el Dashboard principal."),m(!1),i()}catch{alert("Error al actualizar configuración.")}},R=t.filter(Y=>Y.year===l&&Y.month===d),Q=s.length,G=async Y=>{if(Y.preventDefault(),!y||!_)return;const te=Q>0?Math.round(E.length/Q*100):0,O={title:y,content:_,date:Er(),month:d,year:l,attendancePropertyIds:E,quorumPercent:te};try{await r(O),p(!1),K(),alert("Acta guardada exitosamente en el Libro de Asambleas.")}catch{alert("Error al guardar el acta.")}},K=()=>{k(""),C(""),T([]),U("")},W=Y=>{T(te=>te.includes(Y)?te.filter(O=>O!==Y):[...te,Y])},z=(Y,te)=>{Y.stopPropagation();const O=window.open("","","width=900,height=900");if(!O)return;const P=s.filter(q=>te.attendancePropertyIds.includes(q.id));O.document.write(`
          <html>
          <head>
              <title>Acta de Asamblea: ${te.title}</title>
              <style>
                  body { font-family: 'Times New Roman', Times, serif; padding: 60px; font-size: 12pt; line-height: 1.7; color: #000; }
                  .header { text-align: center; border-bottom: 2px solid #000; margin-bottom: 30px; padding-bottom: 10px; }
                  h1 { text-transform: uppercase; font-size: 18pt; margin: 0; }
                  .meta { text-align: center; margin-bottom: 40px; font-style: italic; border-bottom: 1px solid #eee; padding-bottom: 20px; }
                  .content { text-align: justify; white-space: pre-wrap; margin-bottom: 50px; }
                  .attendance-box { background: #fdfdfd; border: 1px solid #eee; padding: 20px; margin-top: 40px; }
                  .attendance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; font-size: 10pt; }
                  .footer { margin-top: 100px; display: flex; justify-content: space-around; }
                  .sign-line { width: 35%; border-top: 1px solid black; text-align: center; padding-top: 10px; font-weight: bold; }
              </style>
          </head>
          <body>
              <div class="header">
                  <h1>Libro de Actas de Asamblea</h1>
                  <p>Condominio Residencial SAC 2025</p>
              </div>
              
              <div class="meta">
                  <b>Sesión:</b> ${te.title} <br>
                  <b>Fecha:</b> ${te.date} | <b>Periodo:</b> ${Ue[te.month]} ${te.year} <br>
                  <b>Quórum Registrado:</b> ${te.quorumPercent}% (${te.attendancePropertyIds.length} de ${Q} Unidades)
              </div>
              
              <div class="content">${te.content}</div>

              <div class="attendance-box">
                  <h3 style="text-decoration: underline">ANEXO: REGISTRO DE ASISTENCIA NOMINAL</h3>
                  <div class="attendance-grid">
                      ${P.map(q=>`<span>[x] Unidad: ${q.code}</span>`).join("")}
                  </div>
              </div>

              <div class="footer">
                  <div class="sign-line">Firma Presidente Junta</div>
                  <div class="sign-line">Firma Secretario / Adm.</div>
              </div>
          </body>
          </html>
      `),O.document.close(),O.print()},Z=s.filter(Y=>Y.code.toLowerCase().includes(M.toLowerCase())||Y.number.toLowerCase().includes(M.toLowerCase()));return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-50 w-fit px-4 py-1.5 rounded-full border border-blue-100 flex items-center gap-2 mb-6",children:[n.jsx(gr,{size:14,className:"text-blue-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-600",children:"Registros Jurídicos"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Libro de ",n.jsx("span",{className:"text-blue-600 italic",children:"Asambleas"})]}),n.jsx("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:"Historial formal y legal de todas las decisiones comunitarias."})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-4 relative z-10",children:[n.jsxs("div",{className:"bg-slate-100 p-2 rounded-2xl flex gap-2 border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:Y=>u(Number(Y.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((Y,te)=>n.jsx("option",{value:te,children:Y},te))}),n.jsx("input",{type:"number",value:l,onChange:Y=>o(Number(Y.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20"})]}),D&&n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>m(!0),className:"p-5 bg-white border border-slate-200 rounded-3xl text-slate-500 hover:bg-slate-50 shadow-sm transition-all",title:"Configurar Próxima Asamblea",children:n.jsx(ob,{size:24})}),n.jsxs("button",{onClick:()=>p(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 transition-all active:scale-95 flex items-center gap-3",children:[n.jsx(Cn,{size:20})," Registrar Acta"]})]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-blue-50/50 rounded-full blur-[100px] pointer-events-none -translate-y-1/2 translate-x-1/3"})]}),n.jsx("div",{className:"space-y-4",children:R.length===0?n.jsxs("div",{className:"text-center text-slate-400 py-24 bg-white rounded-[3rem] border border-dashed border-slate-200",children:[n.jsx(Lr,{className:"w-16 h-16 mx-auto mb-4 opacity-20"}),n.jsx("p",{className:"font-black uppercase tracking-widest text-sm",children:"Sin asambleas registradas en este periodo."})]}):R.map(Y=>n.jsxs("div",{className:`bg-white rounded-[2.5rem] border border-slate-200 overflow-hidden transition-all duration-300 shadow-sm ${B===Y.id?"ring-2 ring-blue-500/20 shadow-lg":""}`,children:[n.jsxs("div",{className:"p-8 flex flex-col md:flex-row justify-between items-center cursor-pointer hover:bg-slate-50/50 transition-colors",onClick:()=>I(B===Y.id?null:Y.id),children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"bg-blue-50 w-16 h-16 rounded-2xl flex items-center justify-center text-blue-600 shadow-lg shadow-blue-100/50",children:n.jsx(gr,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-black text-xl text-slate-800 tracking-tight",children:Y.title}),n.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:Y.date}),n.jsx("span",{className:"w-1 h-1 rounded-full bg-slate-300"}),n.jsxs("span",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-1.5",children:[n.jsx($K,{size:12})," Quórum: ",Y.quorumPercent,"%"]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 mt-6 md:mt-0",children:[n.jsx("button",{onClick:te=>z(te,Y),className:"p-3 bg-slate-100 text-slate-500 hover:bg-blue-600 hover:text-white rounded-xl transition-all shadow-sm",title:"Imprimir Acta Oficial",children:n.jsx(yt,{size:20})}),D&&n.jsx("button",{onClick:te=>{te.stopPropagation(),confirm("¿Eliminar este acta permanentemente?")&&a(Y.id)},className:"p-3 bg-red-50 text-red-500 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ta,{size:20})}),n.jsx("div",{className:"ml-4 p-2 text-slate-300",children:B===Y.id?n.jsx(rk,{size:24}):n.jsx(tk,{size:24})})]})]}),B===Y.id&&n.jsx("div",{className:"p-10 border-t border-slate-100 bg-slate-50/50 animate-in slide-in-from-top-4 duration-300",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-10 rounded-[3rem] shadow-sm border border-slate-200",children:[n.jsxs("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(Nn,{size:14})," Transcripción Legal de Acta"]}),n.jsx("div",{className:"prose prose-slate max-w-none text-slate-700 whitespace-pre-wrap font-serif leading-relaxed text-lg border-l-4 border-slate-100 pl-8",children:Y.content})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-slate-900 p-8 rounded-[3rem] text-white shadow-xl relative overflow-hidden",children:[n.jsx(Oi,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/5 pointer-events-none"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.4em] opacity-60",children:"Control de Asistencia"}),n.jsx("h4",{className:"text-5xl font-black tracking-tighter mt-2",children:Y.attendancePropertyIds.length}),n.jsxs("p",{className:"text-xs font-bold text-slate-400 mt-4 uppercase tracking-widest",children:["Unidades de ",Q," totales"]}),n.jsx("div",{className:"mt-8 h-2 w-full bg-slate-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500 shadow-lg shadow-blue-500/40 transition-all duration-1000",style:{width:`${Y.quorumPercent}%`}})})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsx("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-6",children:"Listado de Presencia Nominal"}),n.jsx("div",{className:"grid grid-cols-3 gap-2",children:s.filter(te=>Y.attendancePropertyIds.includes(te.id)).map(te=>n.jsx("div",{className:"text-[10px] font-black bg-blue-50 text-blue-600 py-2 rounded-lg text-center border border-blue-100",children:te.code},te.id))})]})]})]})})]},Y.id))}),x&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[2.5rem] p-10 w-full max-w-sm shadow-2xl animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-6",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900",children:"Agenda de Asamblea"}),n.jsx("button",{onClick:()=>m(!1),children:n.jsx(ft,{})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Fecha de Próxima Sesión"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-bold text-slate-900 focus:ring-2 focus:ring-blue-600 outline-none",value:b,onChange:Y=>v(Y.target.value),placeholder:"Ej: 15 Jun / Por Definir"})]}),n.jsx("button",{onClick:L,className:"w-full bg-blue-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 active:scale-95 transition-all",children:"Sellar Fecha en Dashboard"})]})]})}),f&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 lg:p-14 w-full max-w-6xl shadow-2xl overflow-y-auto h-[90vh] custom-scrollbar animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-12",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(Cn,{size:32})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Registro de Asamblea"}),n.jsxs("p",{className:"text-slate-400 font-medium",children:["Asigne el periodo: ",Ue[d]," ",l]})]})]}),n.jsx("button",{onClick:()=>p(!1),className:"p-4 bg-slate-100 rounded-full hover:bg-slate-200 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:G,className:"space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título / Carácter de la Sesión"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 text-slate-900 font-bold focus:ring-2 focus:ring-blue-600 outline-none",value:y,onChange:Y=>k(Y.target.value),placeholder:"Ej: Asamblea Extraordinaria - Renovación de Pintura"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Puntos Tratados y Resoluciones (Transcripción)"}),n.jsx("textarea",{required:!0,rows:15,className:"w-full bg-slate-50 border border-slate-200 rounded-[2.5rem] p-8 font-serif text-slate-800 text-lg leading-relaxed focus:ring-2 focus:ring-blue-600 outline-none custom-scrollbar",value:_,onChange:Y=>C(Y.target.value),placeholder:"Redacte aquí el acta completa de la sesión..."}),n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-blue-50 border border-blue-100 rounded-2xl mt-4",children:[n.jsx(Nn,{size:18,className:"text-blue-600"}),n.jsx("p",{className:"text-[9px] text-blue-800 font-black uppercase tracking-widest",children:"Sugerencia: El sistema soporta transcripciones extensas. Puede pegar el borrador directamente."})]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 lg:p-10 rounded-[3rem] border border-slate-200 flex flex-col h-full",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-8",children:[n.jsxs("div",{children:[n.jsxs("h4",{className:"text-xl font-black text-slate-800 tracking-tight flex items-center gap-3",children:[n.jsx(Oi,{className:"text-blue-600"})," Lista de Participación"]}),n.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-1",children:"Marque las unidades presentes en sala"})]}),n.jsxs("div",{className:"relative w-full sm:w-auto",children:[n.jsx(Xt,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:14}),n.jsx("input",{type:"text",placeholder:"Filtrar unidad...",className:"bg-white border border-slate-200 rounded-xl pl-9 pr-4 py-2.5 text-xs font-bold w-full outline-none focus:border-blue-400",value:M,onChange:Y=>U(Y.target.value)})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto bg-white rounded-[2.5rem] p-6 border border-slate-200 space-y-2 custom-scrollbar min-h-[400px]",children:n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:Z.map(Y=>n.jsxs("button",{type:"button",onClick:()=>W(Y.id),className:`flex items-center justify-between p-4 rounded-2xl border transition-all text-left ${E.includes(Y.id)?"bg-blue-600 border-blue-600 text-white shadow-lg shadow-blue-200 scale-[1.02]":"bg-slate-50 border-slate-100 text-slate-500 hover:bg-white hover:border-blue-200"}`,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Gr,{size:12,className:E.includes(Y.id)?"text-blue-200":"text-slate-300"}),n.jsx("span",{className:"text-[11px] font-black uppercase tracking-tighter",children:Y.code})]}),E.includes(Y.id)?n.jsx(zt,{size:16}):n.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-slate-300"})]},Y.id))})}),n.jsxs("div",{className:"mt-8 p-8 bg-slate-900 rounded-[2.5rem] text-white flex justify-between items-center shadow-2xl relative overflow-hidden",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-[0.3em] text-blue-400",children:"Quórum Nominal"}),n.jsxs("div",{className:"flex items-baseline gap-1 mt-1",children:[n.jsx("span",{className:"text-4xl font-black",children:E.length}),n.jsxs("span",{className:"text-slate-500 text-xs font-bold uppercase",children:["/ ",Q," Unidades"]})]})]}),n.jsxs("div",{className:"text-right relative z-10",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-[0.3em] text-emerald-400",children:"Porcentaje de Sesión"}),n.jsxs("p",{className:"text-4xl font-black text-emerald-400",children:[Q>0?Math.round(E.length/Q*100):0,"%"]})]}),n.jsx(Oi,{className:"absolute right-[-20px] bottom-[-20px] w-32 h-32 text-white/5 pointer-events-none"})]})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-6 border-t border-slate-100",children:[n.jsx("button",{type:"button",onClick:()=>p(!1),className:"flex-1 py-6 bg-slate-100 text-slate-500 font-black rounded-2xl uppercase tracking-widest text-xs hover:bg-slate-200 transition-all",children:"Descartar Registro"}),n.jsxs("button",{type:"submit",className:"flex-[2] bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl shadow-blue-100 flex items-center justify-center gap-4 transition-all active:scale-95",children:[n.jsx(qn,{size:20})," SELLAR Y GUARDAR EN LIBRO DIGITAL"]})]})]})]})})]})},OEe=({user:e})=>{const{refreshData:t}=ht(),[r,a]=j.useState("db"),[s,i]=j.useState(!1),[l,o]=j.useState(null),[d,u]=j.useState("andresmathison@gmail.com"),[f,p]=j.useState([]),[x,m]=j.useState(""),[b,v]=j.useState(""),[y,k]=j.useState(""),[_,C]=j.useState(""),[E,T]=j.useState(""),[B,I]=j.useState(""),[M,U]=j.useState(""),[D,L]=j.useState(""),[R,Q]=j.useState(""),[G,K]=j.useState(""),[W,z]=j.useState("0"),[Z,Y]=j.useState("0"),[te,O]=j.useState(!1);if(j.useEffect(()=>{(async()=>{const oe=await we.getSystemSettings();L(oe.board_president||""),Q(oe.board_secretary||""),K(oe.board_treasurer||""),z(oe.initial_reserve_bs||"0"),Y(oe.initial_cash_usd||"0"),O(oe.system_maintenance_mode==="true"),m(oe.payment_bank_name||""),v(oe.payment_account_type||""),k(oe.payment_account_number||""),C(oe.payment_rif||""),T(oe.payment_mobile_phone||""),I(oe.payment_emails||""),U(oe.payment_whatsapp||"")})()},[]),e.role!=="programmer"&&e.role!=="admin")return n.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh]",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] text-center border border-red-100 shadow-xl max-w-lg",children:[n.jsx(hs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight mb-2",children:"Acceso Restringido"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Solo administradores y programadores pueden realizar mantenimiento."})]})});const P=()=>{confirm("¿Generar respaldo SQL completo?")&&we.exportDatabaseSQL()},q=async()=>{i(!0);try{const oe=await(await fetch(`${ye}/test_mail.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:d})})).json();alert(oe.message)}catch{alert("Error al conectar con el servidor de correos.")}finally{i(!1)}},H=async()=>{i(!0),p(["[SYSTEM] Iniciando secuencia de pulso de base de datos...","[KERNEL] Contactando MariaDB Engine..."]);try{const ae=await we.runDiagnostics("db_pulse");o(ae),p(oe=>[...oe,"[DB] Prueba de Escritura: OK","[DB] Prueba de Lectura: OK (Handshake Verificado)",`[CORE] Latencia de transacción: ${ae.latency_ms}ms`,`[CORE] Entorno: ${ae.os} / PHP ${ae.php_version}`,"[SYSTEM] DIAGNÓSTICO FINALIZADO CON ÉXITO."])}catch{p(oe=>[...oe,"[ERROR] Fallo crítico de integridad o latencia excedida."])}finally{i(!1)}},J=async()=>{i(!0);try{await we.updateSystemSetting("board_president",D),await we.updateSystemSetting("board_secretary",R),await we.updateSystemSetting("board_treasurer",G),await we.updateSystemSetting("initial_reserve_bs",W),await we.updateSystemSetting("initial_cash_usd",Z),await we.updateSystemSetting("payment_bank_name",x),await we.updateSystemSetting("payment_account_type",b),await we.updateSystemSetting("payment_account_number",y),await we.updateSystemSetting("payment_rif",_),await we.updateSystemSetting("payment_mobile_phone",E),await we.updateSystemSetting("payment_emails",B),await we.updateSystemSetting("payment_whatsapp",M),alert("Estructura de junta, parámetros fiscales y datos de pago actualizados."),await t()}catch{alert("Error al guardar.")}finally{i(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600/20",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-600/20 w-fit px-4 py-1.5 rounded-full border border-blue-600/30 flex items-center gap-2 mb-6",children:[n.jsx(Oy,{size:16,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-400",children:"Kernel V4.2.01 MC/MB"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Mantenimiento ",n.jsx("span",{className:"text-blue-500 italic",children:"Global"})]}),n.jsx("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md italic",children:"Optimización de bajo nivel y auditoría de Kernel V4.2.01."})]}),n.jsx(ok,{size:220,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"flex flex-wrap p-2 bg-slate-100 rounded-[2rem] w-fit gap-2 shadow-inner",children:[n.jsx("button",{onClick:()=>a("db"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="db"?"bg-white text-blue-600 shadow-lg":"text-slate-500 hover:bg-slate-200"}`,children:"Base de Datos"}),n.jsx("button",{onClick:()=>a("junta"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="junta"?"bg-white text-indigo-600 shadow-lg":"text-slate-500 hover:bg-slate-200"}`,children:"Junta & Pagos"}),n.jsx("button",{onClick:()=>a("mail"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="mail"?"bg-white text-emerald-600 shadow-lg":"text-slate-500 hover:bg-slate-200"}`,children:"Canales"}),n.jsx("button",{onClick:()=>a("system"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="system"?"bg-slate-900 text-white shadow-xl":"text-slate-500 hover:bg-slate-200"}`,children:"SISTEMA CORE"})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[r==="db"&&n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-10 animate-in slide-in-from-left",children:[n.jsxs("div",{className:"flex items-center gap-4 border-b border-slate-100 pb-6",children:[n.jsx("div",{className:"w-14 h-14 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:n.jsx(ko,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Respaldos Críticos"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Exportación estructurada de toda la inteligencia de datos."})]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-100 space-y-4",children:[n.jsxs("h4",{className:"font-black text-slate-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(Yi,{size:16})," Volcado SQL Completo"]}),n.jsx("p",{className:"text-slate-500 text-sm max-w-lg",children:"Genera un script de recuperación total incluyendo esquemas de tablas, triggers y registros de auditoría."}),n.jsx("button",{onClick:P,className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-xl font-black text-[10px] uppercase shadow-lg active:scale-95 transition-all",children:"INICIAR DESCARGA SEGURA"})]})]}),r==="mail"&&n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-10 animate-in zoom-in",children:[n.jsxs("div",{className:"flex items-center gap-4 border-b border-slate-100 pb-6",children:[n.jsx("div",{className:"w-14 h-14 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:n.jsx(Qr,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Diagnóstico de Salida"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Verifique la capacidad de entrega de notificaciones."})]})]}),n.jsxs("div",{className:"max-w-md space-y-6",children:[n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-2xl flex items-start gap-4",children:[n.jsx(Nn,{size:20,className:"text-blue-500 mt-1"}),n.jsx("p",{className:"text-[11px] text-blue-800 font-bold uppercase tracking-tight leading-relaxed",children:"Prueba de conexión con el Relay SMTP local del servidor."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Email Destino para Test"}),n.jsx("input",{type:"email",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold",value:d,onChange:ae=>u(ae.target.value)})]}),n.jsxs("button",{disabled:s,onClick:q,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 active:scale-95 transition-all",children:[s?n.jsx(Oy,{className:"animate-spin"}):n.jsx(Gi,{size:18}),"EJECUTAR TEST DE ENTREGA"]})]})]}),r==="junta"&&n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-12 animate-in slide-in-from-bottom",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[n.jsx("div",{className:"w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm",children:n.jsx(Oi,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900",children:"Configuración de Junta y Pagos"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Presidente"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-indigo-500 outline-none",value:D,onChange:ae=>L(ae.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Secretario(a)"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-indigo-500 outline-none",value:R,onChange:ae=>Q(ae.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tesorero(a)"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-indigo-500 outline-none",value:G,onChange:ae=>K(ae.target.value)})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-50 text-blue-600 rounded-xl flex items-center justify-center shadow-sm",children:n.jsx(xr,{size:20})}),n.jsx("h4",{className:"text-lg font-black text-slate-800",children:"Datos para Recepción de Pagos"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Banco"}),n.jsx("input",{type:"text",placeholder:"Ej: BanPlus",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:x,onChange:ae=>m(ae.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tipo de Cuenta"}),n.jsx("input",{type:"text",placeholder:"Ej: Cta Cte",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:b,onChange:ae=>v(ae.target.value)})]}),n.jsxs("div",{className:"lg:col-span-2 space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Número de Cuenta"}),n.jsx("input",{type:"text",placeholder:"0000-0000-00-0000000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:y,onChange:ae=>k(ae.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"RIF"}),n.jsx("input",{type:"text",placeholder:"J-000000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:_,onChange:ae=>C(ae.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Teléfono Pago Móvil"}),n.jsx("input",{type:"text",placeholder:"0424-0000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:E,onChange:ae=>T(ae.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"WhatsApp de Contacto"}),n.jsx("input",{type:"text",placeholder:"0412-0000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:M,onChange:ae=>U(ae.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Correos (Separados por coma)"}),n.jsx("input",{type:"text",placeholder:"correo1@mail.com, correo2@mail.com",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:B,onChange:ae=>I(ae.target.value)})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 pt-8",children:[n.jsxs("div",{className:"bg-emerald-50 p-8 rounded-[2.5rem] border border-emerald-100 flex flex-col md:flex-row items-center gap-8 shadow-inner",children:[n.jsxs("div",{className:"flex-1 space-y-2",children:[n.jsxs("h4",{className:"font-black text-emerald-900 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(xr,{size:20})," Saldo Inicial Fondo Reserva"]}),n.jsx("p",{className:"text-emerald-800/70 text-[10px] font-bold leading-relaxed uppercase",children:"DECLARE EL MONTO EN DÓLARES QUE EL CONDOMINIO POSEE EN RESERVA AL INICIAR GESTIÓN."})]}),n.jsxs("div",{className:"w-full md:w-48 space-y-2",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-emerald-400 ml-1",children:"Capital Inicial (USD)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 font-black text-emerald-300",children:"$"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-emerald-200 rounded-2xl pl-12 pr-4 py-4 font-black text-emerald-600 outline-none focus:ring-2 focus:ring-emerald-500",value:W,onChange:ae=>z(ae.target.value)})]})]})]}),n.jsxs("div",{className:"bg-blue-50 p-8 rounded-[2.5rem] border border-blue-100 flex flex-col md:flex-row items-center gap-8 shadow-inner",children:[n.jsxs("div",{className:"flex-1 space-y-2",children:[n.jsxs("h4",{className:"font-black text-blue-900 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(wn,{size:20})," Efectivo Inicial Gestión"]}),n.jsx("p",{className:"text-blue-800/70 text-[10px] font-bold leading-relaxed uppercase",children:"DECLARE LA CANTIDAD DE DÓLARES DISPONIBLES EN EFECTIVO PARA EL INICIO DE LA GESTIÓN."})]}),n.jsxs("div",{className:"w-full md:w-48 space-y-2",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-blue-400 ml-1",children:"Efectivo (USD)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 font-black text-blue-300",children:"$"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-blue-200 rounded-2xl pl-12 pr-4 py-4 font-black text-blue-600 outline-none focus:ring-2 focus:ring-blue-500",value:Z,onChange:ae=>Y(ae.target.value)})]})]})]})]}),n.jsx("button",{onClick:J,className:"bg-indigo-600 text-white px-10 py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-indigo-100 active:scale-95 transition-all",children:"Sellar Configuración Kernel V4.1.61"})]}),r==="system"&&n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-8 animate-in zoom-in-95 duration-500",children:[n.jsxs("div",{className:"bg-slate-900 rounded-[3.5rem] p-10 text-white shadow-2xl relative overflow-hidden flex flex-col border border-slate-800",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-600 rounded-3xl flex items-center justify-center mb-8 shadow-xl shadow-blue-500/20",children:n.jsx(OV,{size:40})}),n.jsx("h3",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.4em] mb-2",children:"Lead Systems Architect"}),n.jsx("h2",{className:"text-3xl font-black tracking-tight mb-6",children:"Andres Mathison"}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"p-6 bg-red-600/10 border border-red-500/20 rounded-[2rem] space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("h4",{className:"text-[10px] font-black text-red-500 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(hs,{size:14})," MODO MANTENIMIENTO"]}),n.jsxs("button",{onClick:async()=>{if(confirm("¿Activar/Desactivar bloqueo global?")){const ae=!te;await we.toggleMaintenanceMode(ae),O(ae),alert("Estado de mantenimiento actualizado."),window.location.reload()}},className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none ${te?"bg-red-600":"bg-slate-700"}`,children:[n.jsx("span",{className:"sr-only",children:"Toggle Maintenance Mode"}),n.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${te?"translate-x-6":"translate-x-1"}`})]})]}),n.jsx("p",{className:"text-[9px] text-slate-500 uppercase font-black leading-tight italic",children:"Bloquea el acceso a todos los niveles de usuario (Excepto Programador)."})]}),n.jsx("p",{className:"text-slate-400 text-sm font-medium leading-relaxed italic",children:'"Ingeniería aplicada a la resolución de problemas complejos. Especialista en arquitecturas híbridas que integran computación de alto nivel con entornos físicos."'}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(zG,{size:18,className:"text-amber-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"IoT / Hardware"})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(Oy,{size:18,className:"text-emerald-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"Micro-Robotics"})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(DV,{size:18,className:"text-indigo-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"Digital Electronics"})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(YV,{size:18,className:"text-blue-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"Fullstack Pro"})]})]})]}),n.jsxs("div",{className:"mt-12 pt-8 border-t border-white/10",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Corporación de Desarrollo"}),n.jsx("a",{href:"https://tecnomath.com",target:"_blank",className:"text-xl font-black text-blue-400 hover:text-white transition-colors tracking-tight",children:"TecnoMath.com"})]})]}),n.jsx(sa,{className:"absolute right-[-40px] bottom-[-40px] w-80 h-80 text-blue-600/5 pointer-events-none"})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 border border-slate-200 shadow-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-10",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-100 rounded-2xl flex items-center justify-center text-slate-900",children:n.jsx(bK,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Infraestructura"})]}),n.jsxs("div",{className:"space-y-6 flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"OS Distribution"}),n.jsx("span",{className:"text-xs font-black text-slate-800",children:"Ubuntu Server 24.04 LTS"})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Control Console"}),n.jsx("span",{className:"text-xs font-black text-slate-800",children:"aaPanel (VET PRO)"})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Data Engine"}),n.jsx("span",{className:"text-xs font-black text-slate-800",children:"MariaDB 10.11 / PHP 8.3"})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"System Build"}),n.jsx("span",{className:"text-xs font-black text-blue-600 uppercase",children:"Kernel V4.1.61 MC/MB"})]})]}),n.jsxs("div",{className:"mt-8 p-6 bg-blue-50 border border-blue-100 rounded-3xl flex items-start gap-4",children:[n.jsx(uG,{className:"text-blue-600 shrink-0",size:20}),n.jsx("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-relaxed tracking-tight",children:"El sistema opera bajo un cluster de alta disponibilidad con backups incrementales automáticos cada 24 horas."})]})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 border border-slate-200 shadow-sm flex flex-col",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center",children:n.jsx(La,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Diagnostics"})]})}),n.jsx("div",{className:"bg-slate-950 rounded-2xl p-6 font-mono text-[10px] flex-1 mb-6 border border-slate-800 shadow-inner overflow-y-auto max-h-[250px] custom-scrollbar",children:f.length===0?n.jsx("p",{className:"text-slate-600 italic",children:"// Esperando orden de ejecución..."}):f.map((ae,oe)=>n.jsx("p",{className:`mb-1 ${ae.includes("ERROR")?"text-red-400":ae.includes("OK")?"text-emerald-400":"text-blue-400"}`,children:ae},oe))}),n.jsx("div",{className:"space-y-4",children:n.jsxs("button",{disabled:s,onClick:H,className:"w-full bg-slate-900 hover:bg-black text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all flex items-center justify-center gap-3",children:[s?n.jsx(ot,{className:"animate-spin",size:18}):n.jsx(sa,{size:18}),"DATABASE PULSE TEST"]})})]})]})]})]})},PEe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState({size_kb:0,count:0}),[i,l]=j.useState(!0),[o,d]=j.useState(null),[u,f]=j.useState(""),[p,x]=j.useState(null),m=async()=>{l(!0),d(null);try{const E=await we.getAuditLogs();r(E.logs||[]),s(E.stats||{size_kb:0,count:0})}catch(E){console.error("Error en telemetría:",E),d(E.message||"No se pudo conectar con el motor de auditoría.")}finally{l(!1)}};j.useEffect(()=>{e.role==="programmer"&&m()},[e.role]);const b=j.useMemo(()=>t.filter(E=>{var T,B,I;return(((T=E.username)==null?void 0:T.toLowerCase())||"").includes(u.toLowerCase())||(((B=E.action)==null?void 0:B.toLowerCase())||"").includes(u.toLowerCase())||(E.ip_address||"").includes(u)||(((I=E.module)==null?void 0:I.toLowerCase())||"").includes(u.toLowerCase())}),[t,u]),v=()=>{if(b.length===0)return;const E=["ID","Fecha/Hora","Usuario","Rol","Accion","Modulo","IP Origen","Payload (Data)","User Agent"],T=b.map(R=>[R.id,`"${R.created_at}"`,`"${R.username}"`,`"${R.user_role}"`,`"${R.action}"`,`"${R.module}"`,`"${R.ip_address}"`,`"${(R.payload||"").replace(/"/g,'""')}"`,`"${(R.user_agent||"").replace(/"/g,'""')}"`]),B=[E.join(","),...T.map(R=>R.join(","))].join(`
`),I="\uFEFF",M=new Blob([I+B],{type:"text/csv;charset=utf-8;"}),U=URL.createObjectURL(M),D=document.createElement("a"),L=new Date().toISOString().split("T")[0];D.setAttribute("href",U),D.setAttribute("download",`SAC_DataLogger_Export_${L}.csv`),document.body.appendChild(D),D.click(),document.body.removeChild(D)},y=async()=>{if(confirm("ATENCIÓN: Se vaciará la tabla de auditoría. Esto liberará espacio en la base de datos pero perderá el rastro histórico. ¿Proceder?"))try{await we.clearAuditLogs(),m()}catch(E){alert("Error al limpiar: "+E.message)}},k=(a.size_kb/1024).toFixed(2),_=200,C=Math.min(100,parseFloat(k)/_*100);return e.role!=="programmer"&&e.role!=="admin"?n.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] border border-red-100 text-center max-w-lg shadow-2xl",children:[n.jsx(hs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Denegado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Este módulo de ciberseguridad es exclusivo para el arquitecto del sistema."})]})}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600/30",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-600 rounded-3xl flex items-center justify-center shadow-xl shadow-blue-500/20",children:n.jsx(ok,{size:40,className:"text-white"})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Data ",n.jsx("span",{className:"text-blue-500 italic",children:"Logger"})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-4 text-blue-400",children:[n.jsx(ja,{size:16}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em]",children:"Monitoreo de Tráfico Global VET (GMT-4)"})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 rounded-[2.5rem] backdrop-blur-md",children:[n.jsxs("div",{className:"flex justify-between items-center mb-3",children:[n.jsx(ko,{size:18,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase",children:"Almacenamiento"})]}),n.jsxs("div",{className:"text-3xl font-black",children:[k," ",n.jsx("span",{className:"text-sm font-bold text-slate-500",children:"MB"})]}),n.jsx("div",{className:"mt-4 w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full transition-all duration-1000 ${C>80?"bg-red-500":"bg-blue-500"}`,style:{width:`${C}%`}})}),n.jsxs("p",{className:"text-[8px] font-bold text-slate-500 uppercase mt-2",children:["Límite de Alerta: ",_," MB"]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 rounded-[2.5rem] backdrop-blur-md",children:[n.jsxs("div",{className:"flex justify-between items-center mb-3",children:[n.jsx(La,{size:18,className:"text-emerald-400"}),n.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase",children:"Total Movimientos"})]}),n.jsx("div",{className:"text-3xl font-black",children:a.count.toLocaleString()}),n.jsx("p",{className:"text-[8px] font-bold text-emerald-400 uppercase mt-2",children:"Logs en tiempo real"})]})]})]}),n.jsx(La,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/5 pointer-events-none"})]}),o&&n.jsxs("div",{className:"bg-red-50 border border-red-200 p-8 rounded-[2.5rem] flex items-center gap-6 shadow-xl animate-in slide-in-from-top",children:[n.jsx("div",{className:"w-12 h-12 bg-red-100 rounded-2xl flex items-center justify-center text-red-600",children:n.jsx(na,{size:24})}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-black text-red-800 uppercase text-xs tracking-widest",children:"Error de Sincronización"}),n.jsx("p",{className:"text-red-600 font-medium text-sm",children:o})]}),n.jsx("button",{onClick:m,className:"ml-auto px-6 py-3 bg-red-600 text-white rounded-xl font-black text-[10px] uppercase tracking-widest active:scale-95 transition-all",children:"Reintentar"})]}),C>80&&n.jsxs("div",{className:"bg-red-600 text-white p-6 rounded-[2.5rem] flex items-center justify-between shadow-xl animate-pulse",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(na,{size:32}),n.jsxs("div",{children:[n.jsxs("p",{className:"font-black uppercase text-sm tracking-widest",children:["Alerta de Almacenamiento Crítico (",k,"MB)"]}),n.jsx("p",{className:"text-xs font-medium opacity-80",children:"La base de datos está superando el 80% de los 200MB permitidos. Descargue el backup y vacíe los logs."})]})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-white/20 px-4 py-2 rounded-xl",children:[n.jsx(Qr,{size:16}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"andresmathison@gmail.com"})]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Filtrar por IP, Usuario, Módulo o Acción...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-blue-500",value:u,onChange:E=>f(E.target.value)})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsx("button",{onClick:m,className:"p-4 bg-slate-100 text-slate-500 rounded-2xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(ot,{size:24,className:i?"animate-spin":""})}),n.jsxs("button",{onClick:v,className:"px-8 py-4 bg-emerald-50 text-emerald-600 rounded-2xl font-black text-[10px] uppercase tracking-widest border border-emerald-100 transition-all hover:bg-emerald-600 hover:text-white active:scale-95 flex items-center gap-2 shadow-sm",title:"Exportar registros a CSV (UTF-8)",children:[n.jsx(Yi,{size:18})," Exportar Data"]}),n.jsxs("button",{onClick:y,className:"px-8 py-4 bg-red-50 text-red-600 rounded-2xl font-black text-[10px] uppercase tracking-widest border border-red-100 transition-all hover:bg-red-600 hover:text-white active:scale-95 flex items-center gap-2 shadow-sm",children:[n.jsx(Ta,{size:18})," Vaciar Log"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha/Hora"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Actor"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Acción"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Módulo"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"IP Origen"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Detalle"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:b.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-20 text-center",children:i?n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx(ot,{size:32,className:"text-blue-500 animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Cargando bitácora..."})]}):n.jsxs("div",{className:"flex flex-col items-center gap-3 opacity-20",children:[n.jsx(zV,{size:48}),n.jsx("p",{className:"text-slate-900 font-black uppercase tracking-widest text-xs",children:"Sin registros que mostrar"})]})})}):b.map(E=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex items-center gap-2 text-slate-400",children:[n.jsx(Oc,{size:12}),n.jsx("span",{className:"text-[11px] font-black tracking-tight",children:E.created_at})]})}),n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"font-black text-slate-800 text-sm",children:E.username||"N/A"}),n.jsx("span",{className:`text-[9px] font-black uppercase ${E.user_role==="programmer"?"text-blue-500":E.user_role==="admin"?"text-emerald-500":"text-slate-400"}`,children:E.user_role||"guest"})]})}),n.jsx("td",{className:"px-8 py-5",children:n.jsx("span",{className:"text-xs font-bold text-slate-700",children:E.action||"Movimiento Pasivo"})}),n.jsx("td",{className:"px-8 py-5",children:n.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 rounded-full text-[9px] font-black uppercase tracking-widest",children:E.module||"System"})}),n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ja,{size:12,className:"text-slate-300"}),n.jsx("span",{className:"text-[11px] font-mono text-slate-500",children:E.ip_address})]})}),n.jsx("td",{className:"px-8 py-5 text-right",children:n.jsx("button",{onClick:()=>x(E),className:"p-2.5 bg-slate-100 text-slate-400 hover:bg-slate-900 hover:text-white rounded-xl transition-all shadow-sm opacity-0 group-hover:opacity-100",children:n.jsx(_c,{size:16})})})]},E.id))})]})})}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 overflow-hidden flex flex-col max-h-[80vh]",children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-slate-100 flex justify-between items-center bg-white",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-900 text-white rounded-2xl flex items-center justify-center shadow-xl",children:n.jsx(Ea,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tight",children:"Análisis de Movimiento"}),n.jsxs("p",{className:"text-[10px] text-blue-600 font-black uppercase tracking-widest",children:["ID Registro: ",p.id," • IP: ",p.ip_address]})]})]}),n.jsx("button",{onClick:()=>x(null),className:"p-3 bg-slate-100 text-slate-500 rounded-full hover:bg-red-50 hover:text-red-500 transition-all",children:n.jsx(ft,{size:20})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-10 bg-slate-50 custom-scrollbar",children:n.jsxs("div",{className:"bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-inner",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Payload Inyectado / Metadatos:"}),n.jsx("div",{className:"bg-slate-50 p-4 rounded-xl border border-slate-100",children:n.jsx("pre",{className:"font-mono text-xs text-slate-700 whitespace-pre-wrap break-all leading-relaxed",children:(()=>{if(!p.payload)return"// Navegación pasiva o consulta GET sin envío de datos.";try{const E=JSON.parse(p.payload);return JSON.stringify(E,null,4)}catch{return p.payload}})()})}),n.jsxs("div",{className:"mt-8 pt-8 border-t border-slate-100",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2",children:"User Agent:"}),n.jsx("p",{className:"text-[10px] font-medium text-slate-500 italic",children:p.user_agent||"Desconocido"})]})]})}),n.jsx("div",{className:"p-6 bg-slate-50 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.4em]",children:"Audit Trail Senior SAC 2025"})})]})})]})},LEe=e=>{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const r=new t,a=r.currentTime,s=(i,l,o,d,u)=>{const f=r.createOscillator(),p=r.createGain();f.type=l,f.frequency.setValueAtTime(i,o),p.gain.setValueAtTime(0,o),p.gain.linearRampToValueAtTime(u,o+.05),p.gain.exponentialRampToValueAtTime(.001,o+d),f.connect(p),p.connect(r.destination),f.start(o),f.stop(o+d)};e==="notification"?(s(800,"sine",a,.6,.1),s(1200,"sine",a+.05,.4,.05)):e==="doorbell"?(s(600,"triangle",a,.8,.1),s(450,"triangle",a+.6,1.2,.1)):e==="coin"?(s(1500,"sine",a,.1,.05),s(2e3,"square",a+.05,.2,.03),s(2500,"sine",a+.1,.4,.05)):e==="alert"?(s(300,"sawtooth",a,.3,.1),s(300,"sawtooth",a+.4,.3,.1)):e==="mechanic"?(s(150,"square",a,.1,.2),s(100,"sawtooth",a+.1,.2,.1)):e==="severe"&&[0,.3,.6].forEach(i=>{s(800,"sawtooth",a+i,.2,.2),s(600,"square",a+i,.2,.2)})},QEe=({user:e})=>{const{fees:t,announcements:r,reservations:a,assemblies:s,maintenance:i}=ht(),[l,o]=j.useState([]),d=j.useRef(r.length),u=j.useRef(t.length),f=j.useRef(a.length),p=j.useRef(s.length),x=j.useRef(i.length),m=j.useRef(!0),b=(v,y,k,_)=>{const C=Date.now();o(E=>[...E,{id:C,title:v,message:y,type:k}]),LEe(_),setTimeout(()=>o(E=>E.filter(T=>T.id!==C)),8e3)};return j.useEffect(()=>{if(m.current){m.current=!1,d.current=r.length,u.current=t.length,f.current=a.length,p.current=s.length,x.current=i.length;return}if(r.length>d.current){const v=r[0];v&&v.status==="Publicado"&&b("Nuevo Comunicado",v.title,"info","notification")}if(s.length>p.current&&b("Nueva Asamblea","Se ha publicado una nueva acta.","info","doorbell"),e.role==="owner"){if(t.length>u.current&&b("Nueva Cuota","Recibo del mes disponible.","money","coin"),i.length>x.current){const v=i[i.length-1];v&&v.requestedById===e.id&&b("Solicitud Recibida","Tu reporte de servicio fue registrado.","success","mechanic")}if(a.length>f.current){const v=a[a.length-1];v&&v.residentName===e.fullName&&v.status==="Aprobada"&&b("Reserva Aprobada",`Tu reserva para ${v.facility} está lista.`,"success","doorbell")}}d.current=r.length,u.current=t.length,f.current=a.length,p.current=s.length,x.current=i.length},[t,r,a,s,i,e.role,e.fullName,e.id]),n.jsx("div",{className:"fixed top-20 right-4 z-[500] flex flex-col gap-3 pointer-events-none",children:l.map(v=>n.jsxs("div",{className:`pointer-events-auto w-80 bg-white rounded-lg shadow-2xl border-l-4 p-4 transform transition-all duration-500 hover:scale-105 cursor-pointer animate-in slide-in-from-right-10 flex items-start ${v.type==="alert"?"border-red-500":v.type==="warning"?"border-orange-500":v.type==="success"?"border-green-500":v.type==="money"?"border-yellow-500":"border-blue-500"}`,children:[n.jsxs("div",{className:"mr-3 mt-1",children:[v.type==="alert"&&n.jsx(na,{className:"w-5 h-5 text-red-500 animate-bounce"}),v.type==="warning"&&n.jsx(na,{className:"w-5 h-5 text-orange-500"}),v.type==="success"&&n.jsx(Wi,{className:"w-5 h-5 text-green-500"}),v.type==="money"&&n.jsx(_p,{className:"w-5 h-5 text-yellow-600"}),v.type==="info"&&n.jsx(Gf,{className:"w-5 h-5 text-blue-500"})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"font-bold text-gray-800 text-sm",children:v.title}),n.jsx("p",{className:"text-xs text-gray-600 mt-1",children:v.message})]}),n.jsx("button",{onClick:()=>o(y=>y.filter(k=>k.id!==v.id)),className:"ml-2 text-gray-400 hover:text-gray-600",children:n.jsx(ft,{className:"w-4 h-4"})})]},v.id))})},HEe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(""),[o,d]=j.useState(null),u=async()=>{s(!0);try{const x=await we.getUsers();r(x)}catch(x){console.error(x)}finally{s(!1)}};j.useEffect(()=>{e.role==="programmer"&&u()},[e.role]);const f=async x=>{if(!x.cedula)return alert("Este usuario no tiene cédula registrada.");if(confirm(`¿Resetear la clave de ${x.fullName} a su cédula (${x.cedula}) en formato HASH?`)){d(x.id);try{(await fetch(`${ye}/save_user.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...x,password:x.cedula,status:x.status==="Activo"||x.status==="active"?"active":"inactive"})})).ok?(alert("¡Clave actualizada y hasheada correctamente!"),u()):alert("Error al procesar el cambio en el servidor.")}catch{alert("Error de red.")}finally{d(null)}}},p=t.filter(x=>x.fullName.toLowerCase().includes(i.toLowerCase())||(x.cedula||"").toLowerCase().includes(i.toLowerCase()));return e.role!=="programmer"?n.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] border border-red-100 text-center max-w-lg shadow-2xl",children:[n.jsx(hs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Bloqueado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Solo el desarrollador maestro puede gestionar hashes de seguridad."})]})}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-slate-900 p-8 lg:p-10 rounded-[3rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-emerald-500/20",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-emerald-500/20 w-fit px-4 py-1.5 rounded-full border border-emerald-500/30 flex items-center gap-2 mb-4",children:[n.jsx(nG,{size:14,className:"text-emerald-400"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-emerald-400",children:"Security Core v6.0"})]}),n.jsxs("h1",{className:"text-3xl lg:text-4xl font-black tracking-tighter",children:["Control Maestro de ",n.jsx("span",{className:"text-emerald-500 italic",children:"Hashes"})]}),n.jsx("p",{className:"text-slate-400 mt-2 font-medium text-sm max-w-md",children:"Gestión centralizada de credenciales irreversibles (BCRYPT)."})]}),n.jsx(jA,{size:150,className:"absolute right-[-20px] top-[-20px] text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-5 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col md:flex-row items-center gap-4",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por nombre o cédula...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold outline-none focus:ring-2 focus:ring-emerald-500 transition-all",value:i,onChange:x=>l(x.target.value)})]}),n.jsx("button",{onClick:u,className:"p-4 bg-slate-100 text-slate-500 rounded-2xl hover:bg-emerald-600 hover:text-white transition-all shadow-sm",children:n.jsx(ot,{size:24,className:a?"animate-spin":""})})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Usuario / Propietario"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Documento (Login)"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Rol"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estado"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción Crítica"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?Array(5).fill(0).map((x,m)=>n.jsx("tr",{className:"animate-pulse",children:n.jsx("td",{colSpan:5,className:"px-8 py-6",children:n.jsx("div",{className:"h-4 bg-slate-100 rounded-full w-full"})})},m)):p.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"px-8 py-20 text-center text-slate-400 font-bold uppercase tracking-widest text-xs italic",children:"No se encontraron usuarios"})}):p.map(x=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-100 flex items-center justify-center text-slate-400 group-hover:bg-emerald-50 group-hover:text-emerald-600 transition-all font-black text-xs",children:x.fullName[0]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-sm uppercase leading-tight",children:x.fullName}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mt-0.5",children:x.email||"Sin Email"})]})]})}),n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"font-mono font-black text-slate-600 text-xs",children:x.cedula||x.username}),n.jsx("span",{className:"text-[8px] font-black text-blue-500 uppercase tracking-tighter",children:"Validación de Identidad"})]})}),n.jsx("td",{className:"px-8 py-5 text-center",children:n.jsx("span",{className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest border ${x.role==="programmer"?"bg-blue-50 text-blue-600 border-blue-100":"bg-slate-100 text-slate-500 border-slate-200"}`,children:x.role})}),n.jsx("td",{className:"px-8 py-5 text-center",children:n.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${x.status==="Activo"||x.status==="active"?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),n.jsx("span",{className:"text-[10px] font-black text-slate-600 uppercase",children:x.status==="active"?"Activo":x.status})]})}),n.jsx("td",{className:"px-8 py-5 text-right",children:n.jsxs("button",{disabled:o===x.id||!x.cedula,onClick:()=>f(x),className:"inline-flex items-center gap-2 px-6 py-2.5 bg-slate-900 hover:bg-emerald-600 text-white rounded-xl font-black text-[9px] uppercase tracking-widest shadow-lg transition-all active:scale-95 disabled:opacity-30",children:[o===x.id?n.jsx(Vi,{className:"animate-spin",size:12}):n.jsx(ot,{size:12}),"Reset a Cédula"]})})]},x.id))})]})})}),n.jsxs("div",{className:"p-8 bg-blue-50 border border-blue-100 rounded-[3rem] flex items-start gap-6 shadow-sm",children:[n.jsx(hs,{className:"text-blue-600 shrink-0",size:32}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-black text-blue-900 uppercase text-xs tracking-widest",children:"Información de Seguridad Maestra"}),n.jsx("p",{className:"text-blue-800/70 text-[11px] font-medium leading-relaxed italic uppercase",children:"El proceso de reseteo aplica una función de derivación de claves (Key Derivation Function) de 10 rondas. Este cambio es automático y global. Se recomienda al usuario cambiar su clave personal una vez recupere el acceso. Nadie puede visualizar la clave previa una vez ejecutado este comando."})]})]})]})},zEe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(""),[o,d]=j.useState(!1),[u,f]=j.useState(null),[p,x]=j.useState([]),[m,b]=j.useState(!1),[v,y]=j.useState(null),[k,_]=j.useState({rif:"",name:"",contactPerson:"",email:"",phonePrimary:"",phoneOffice:"",country:"Venezuela",serviceType:"Mantenimiento",taxAddress:""}),[C,E]=j.useState({year:new Date().getFullYear(),month:-1,search:""}),T=["admin","programmer","board"].includes(e.role),B=async()=>{s(!0);try{const G=await we.getProviders();r(G)}catch(G){console.error(G)}finally{s(!1)}};j.useEffect(()=>{B()},[]);const I=G=>{G?(y(G.rif),_(G)):(y(null),_({rif:"",name:"",contactPerson:"",email:"",phonePrimary:"",phoneOffice:"",country:"Venezuela",serviceType:"Mantenimiento",taxAddress:""})),d(!0)},M=async G=>{if(G.preventDefault(),!/^[A-Z][0-9]{1,9}$/.test(k.rif)){alert("RIF Inválido: Debe iniciar con letra mayúscula seguida de números, sin guiones (Máx 10 carac).");return}try{await we.saveProvider(k),d(!1),B()}catch(W){alert(W.message)}},U=async G=>{if(confirm(`¿Eliminar al proveedor con RIF ${G}? Se perderá el rastro en el listado desplegable.`))try{await we.deleteProvider(G),B()}catch{alert("Error al eliminar")}},D=async G=>{f(G),b(!0);try{const K=await we.getProviderHistory(G.rif);x(K)}catch(K){console.error(K)}finally{b(!1)}},L=()=>{if(t.length===0)return;const G=window.open("","","width=1000,height=900");if(!G)return;const K=t.map((W,z)=>`
            <tr style="border-bottom: 1px solid #e2e8f0;">
                <td style="padding: 12px; font-size: 10px; font-weight: bold; text-align:center;">${z+1}</td>
                <td style="padding: 12px; font-size: 11px; font-weight: 900; color: #1e293b;">${W.name}</td>
                <td style="padding: 12px; font-size: 11px; font-weight: bold; color: #2563eb;">${W.rif}</td>
                <td style="padding: 12px; font-size: 11px; color: #475569;">${W.contactPerson||"-"}</td>
                <td style="padding: 12px; font-size: 11px; color: #475569;">${W.phonePrimary}</td>
                <td style="padding: 12px; font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b;">${W.serviceType}</td>
                <td style="padding: 12px; font-size: 10px; color: #94a3b8;">${W.email||"-"}</td>
            </tr>
        `).join("");G.document.write(`
            <html>
            <head>
                <title>Reporte Maestro de Proveedores - SAC 2026</title>
                <style>
                    body { font-family: 'Inter', system-ui, sans-serif; padding: 40px; color: #0f172a; line-height: 1.5; }
                    .header { text-align: center; border-bottom: 4px solid #0f172a; padding-bottom: 20px; margin-bottom: 30px; position: relative; }
                    .logo-placeholder { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 24px; color: #2563eb; }
                    h1 { margin: 0; font-size: 28px; text-transform: uppercase; letter-spacing: -1px; }
                    .sub { margin: 5px 0; font-size: 12px; color: #64748b; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; border: 1px solid #e2e8f0; }
                    th { background: #f8fafc; text-align: left; padding: 14px; font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b; border-bottom: 2px solid #0f172a; }
                    .footer { margin-top: 50px; text-align: center; font-size: 9px; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 20px; }
                    .timestamp { font-size: 9px; color: #2563eb; margin-top: 10px; text-align: right; font-weight: bold; }
                    @media print {
                        body { padding: 20px; }
                        .no-print { display: none; }
                    }
                </style>
            </head>
            <body>
                <div class="header">
                    <div class="logo-placeholder">SAC 2026</div>
                    <h1>Listado Maestro de Proveedores</h1>
                    <div class="sub">Gestión Administrativa Condominio El Tejar</div>
                </div>
                <div class="timestamp">Generado el: ${new Date().toLocaleDateString("es-VE")} - ${new Date().toLocaleTimeString("es-VE")}</div>
                <table>
                    <thead>
                        <tr>
                            <th style="text-align:center;">#</th>
                            <th>Razón Social / Empresa</th>
                            <th>RIF / C.I.</th>
                            <th>Contacto</th>
                            <th>Teléfono</th>
                            <th>Servicio</th>
                            <th>Correo Electrónico</th>
                        </tr>
                    </thead>
                    <tbody>${K}</tbody>
                </table>
                <div style="margin-top: 40px; display: flex; justify-content: space-between;">
                    <div style="border-top: 1px solid #ccc; width: 200px; text-align: center; padding-top: 10px; font-size: 10px; font-weight: bold;">Administración</div>
                    <div style="border-top: 1px solid #ccc; width: 200px; text-align: center; padding-top: 10px; font-size: 10px; font-weight: bold;">Junta de Condominio</div>
                </div>
                <div class="footer">
                    Este documento es una emisión oficial del Kernel V4.0.57 • Powered by TecnoMath • All Rights Reserved &copy; 2026
                </div>
            </body>
            </html>
        `),G.document.close(),G.focus(),setTimeout(()=>{G.print()},500)},R=j.useMemo(()=>t.filter(G=>G.name.toLowerCase().includes(i.toLowerCase())||G.rif.toLowerCase().includes(i.toLowerCase())||G.serviceType.toLowerCase().includes(i.toLowerCase())),[t,i]),Q=j.useMemo(()=>p.filter(G=>{const K=new Date(G.date),W=K.getFullYear()===C.year,z=C.month===-1||K.getMonth()===C.month,Z=G.description.toLowerCase().includes(C.search.toLowerCase())||(G.reference||"").includes(C.search);return W&&z&&Z}),[p,C]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Directorio de Proveedores"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Empresas y servicios técnicos vinculados al condominio."})]}),T&&n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsxs("button",{onClick:L,className:"flex-1 md:flex-none bg-slate-900 hover:bg-black text-white px-6 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl transition-all active:scale-95 gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(yt,{size:18})," Listado Maestría"]}),n.jsxs("button",{onClick:()=>I(),className:"flex-[2] md:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-blue-500/20 transition-all active:scale-95",children:[n.jsx(Cn,{className:"w-5 h-5 mr-2"}),"Nuevo Proveedor"]})]})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-6 lg:p-8 border-b border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6",children:[n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por nombre, RIF o servicio...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-bold",value:i,onChange:G=>l(G.target.value)})]}),n.jsx("button",{onClick:B,className:"p-4 bg-slate-50 rounded-2xl text-slate-400 hover:text-blue-600 transition-colors",children:n.jsx(ot,{size:20,className:a?"animate-spin":""})})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Proveedor / RIF"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Contacto"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Teléfonos"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Tipo de Servicio"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"py-20 text-center",children:[n.jsx(Vi,{className:"w-10 h-10 text-blue-600 animate-spin mx-auto mb-4"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-[10px]",children:"Cargando empresas..."})]})}):R.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"No hay proveedores registrados."})}):R.map(G=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400 group-hover:bg-blue-600 group-hover:text-white transition-all",children:n.jsx(Gr,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 uppercase leading-none",children:G.name}),n.jsx("p",{className:"text-[10px] font-bold text-blue-500 mt-1 uppercase tracking-widest",children:G.rif})]})]})}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-bold text-slate-700",children:G.contactPerson}),n.jsx("p",{className:"text-[10px] text-slate-400 truncate max-w-[150px]",children:G.email})]}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-xs font-black text-slate-600",children:G.phonePrimary}),G.phoneOffice&&n.jsxs("p",{className:"text-[10px] text-slate-400",children:["Ofic: ",G.phoneOffice]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:"px-3 py-1 bg-blue-50 text-blue-600 rounded-lg text-[10px] font-black uppercase tracking-widest border border-blue-100",children:G.serviceType})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>D(G),className:"p-2.5 bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white rounded-xl transition-all shadow-sm",title:"Historial de Egresos",children:n.jsx(po,{size:18})}),n.jsx("button",{onClick:()=>I(G),className:"p-2.5 bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(vl,{size:18})}),n.jsx("button",{onClick:()=>U(G.rif),className:"p-2.5 bg-red-50 text-red-600 hover:bg-red-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(Ta,{size:18})})]})})]},G.rif))})]})})]}),o&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-2xl shadow-2xl overflow-y-auto max-h-[95vh] custom-scrollbar animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl",children:n.jsx(ub,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:v?"Editar Proveedor":"Nuevo Proveedor"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Vincule empresas de confianza al sistema."})]})]}),n.jsx("button",{onClick:()=>d(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-slate-200 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:M,className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"C.I / R.I.F. (PK)"}),n.jsx("input",{required:!0,disabled:!!v,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-blue-600 outline-none focus:ring-2 focus:ring-blue-500 uppercase disabled:opacity-50",value:k.rif,onChange:G=>_({...k,rif:G.target.value.replace(/\s+/g,"")}),placeholder:"EJ: J31234567"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Razón Social"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none focus:ring-2 focus:ring-blue-500",value:k.name,onChange:G=>_({...k,name:G.target.value.toUpperCase()}),placeholder:"Nombre de la empresa"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Persona de Contacto"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-800 outline-none",value:k.contactPerson,onChange:G=>_({...k,contactPerson:G.target.value}),placeholder:"Nombre del enlace"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Tipo de Servicio"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-800 outline-none cursor-pointer",value:k.serviceType,onChange:G=>_({...k,serviceType:G.target.value}),children:[n.jsx("option",{value:"Mantenimiento",children:"Mantenimiento"}),n.jsx("option",{value:"Servicios Públicos",children:"Servicios Públicos"}),n.jsx("option",{value:"Seguridad",children:"Seguridad"}),n.jsx("option",{value:"Suministros",children:"Suministros"}),n.jsx("option",{value:"Legal / Contable",children:"Legal / Contable"}),n.jsx("option",{value:"Otro",children:"Otro"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Email Corporativo"}),n.jsx("input",{required:!0,type:"email",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold outline-none",value:k.email,onChange:G=>_({...k,email:G.target.value}),placeholder:"empresa@ejemplo.com"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Teléfono Principal"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black outline-none",value:k.phonePrimary,onChange:G=>_({...k,phonePrimary:G.target.value}),placeholder:"Ej: 0412..."})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Dirección Fiscal"}),n.jsx("textarea",{className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 font-medium outline-none min-h-[100px]",value:k.taxAddress,onChange:G=>_({...k,taxAddress:G.target.value}),placeholder:"Ubicación administrativa..."})]})]}),n.jsxs("button",{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(qn,{size:20})," ",v?"ACTUALIZAR DATOS":"CREAR PROVEEDOR"]})]})]})}),u&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-0 sm:p-4",children:n.jsxs("div",{className:"bg-white rounded-none sm:rounded-[3.5rem] w-full max-w-5xl h-full sm:h-[90vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex flex-col md:flex-row justify-between items-start md:items-center gap-6 bg-white shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-50 text-emerald-600 rounded-[1.5rem] flex items-center justify-center shadow-lg shadow-emerald-100",children:n.jsx(po,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight leading-none uppercase",children:u.name}),n.jsx("p",{className:"text-emerald-600 font-black text-[10px] uppercase tracking-[0.2em] mt-2",children:"Bitácora Financiera Histórica"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-slate-50 text-slate-400 hover:text-blue-600 rounded-2xl transition-all",children:n.jsx(gr,{size:20})}),n.jsx("button",{onClick:()=>f(null),className:"p-4 bg-slate-100 text-slate-500 rounded-2xl hover:bg-red-50 hover:text-red-500 transition-all",children:n.jsx(ft,{size:24})})]})]}),n.jsxs("div",{className:"bg-slate-50 px-8 py-5 border-b border-slate-200 flex flex-wrap items-center gap-4 shrink-0",children:[n.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl px-4 py-2 flex items-center gap-3",children:[n.jsx(Lr,{size:14,className:"text-slate-400"}),n.jsx("select",{className:"text-xs font-black uppercase text-slate-700 outline-none bg-transparent",value:C.year,onChange:G=>E({...C,year:parseInt(G.target.value)}),children:[2023,2024,2025].map(G=>n.jsx("option",{value:G,children:G},G))})]}),n.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl px-4 py-2 flex items-center gap-3",children:[n.jsx(nk,{size:14,className:"text-slate-400"}),n.jsxs("select",{className:"text-xs font-black uppercase text-slate-700 outline-none bg-transparent",value:C.month,onChange:G=>E({...C,month:parseInt(G.target.value)}),children:[n.jsx("option",{value:-1,children:"Todos los Meses"}),Ue.map((G,K)=>n.jsx("option",{value:K,children:G},K))]})]}),n.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[n.jsx(Xt,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),n.jsx("input",{type:"text",placeholder:"Filtrar por monto o concepto...",className:"w-full bg-white border border-slate-200 rounded-xl pl-9 pr-4 py-2 text-xs font-bold outline-none focus:ring-2 focus:ring-emerald-500",value:C.search,onChange:G=>E({...C,search:G.target.value})})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-8 bg-slate-50 custom-scrollbar",children:m?n.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-4",children:[n.jsx(ot,{className:"animate-spin text-emerald-500",size:32}),n.jsx("p",{className:"text-[10px] font-black uppercase text-slate-400",children:"Escaneando transacciones..."})]}):Q.length===0?n.jsxs("div",{className:"py-32 text-center",children:[n.jsx("div",{className:"w-20 h-20 bg-white border border-dashed border-slate-200 rounded-full flex items-center justify-center mx-auto mb-6",children:n.jsx(xr,{size:32,className:"text-slate-200"})}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs italic",children:"Sin egresos registrados para los filtros seleccionados"})]}):n.jsx("div",{className:"space-y-4",children:Q.map(G=>n.jsxs("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-sm flex flex-col md:flex-row justify-between items-center gap-6 group hover:border-emerald-200 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-5 flex-1",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-50 rounded-2xl flex items-center justify-center text-slate-400 group-hover:bg-emerald-50 group-hover:text-emerald-600 transition-all",children:n.jsx(wn,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-sm leading-tight uppercase mb-1",children:G.description}),n.jsxs("div",{className:"flex items-center gap-4 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Lr,{size:12})," ",G.date]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(gr,{size:12})," REF: ",G.reference||"S/R"]}),n.jsx("span",{className:"px-2 py-0.5 bg-slate-100 rounded text-[9px]",children:G.type})]})]})]}),n.jsxs("div",{className:"text-right shrink-0",children:[n.jsxs("p",{className:"text-xl font-black text-rose-600 tracking-tighter",children:["Bs. ",G.amountBs.toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-tight",children:["Equiv: $",G.amountUsd.toFixed(2)," USD"]})]})]},G.id))})}),n.jsxs("div",{className:"p-8 bg-white border-t border-slate-100 flex flex-col sm:flex-row justify-between items-center gap-6 shrink-0",children:[n.jsxs("div",{className:"flex gap-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Gasto Acumulado (Filtro)"}),n.jsxs("p",{className:"text-2xl font-black text-slate-800 tracking-tighter",children:["$",Q.reduce((G,K)=>G+K.amountUsd,0).toLocaleString(void 0,{minimumFractionDigits:2})]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Operaciones"}),n.jsx("p",{className:"text-2xl font-black text-blue-600 tracking-tighter",children:Q.length})]})]}),n.jsx("div",{className:"text-right",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.4em]",children:"Resumen de Gestión Proveedores 2025"})})]})]})})]})},$Ee=({user:e})=>{const{transactions:t,refreshData:r,loading:a}=ht(),[s,i]=j.useState(new Date().getMonth()),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(""),[f,p]=j.useState(!1);j.useEffect(()=>{r()},[]);const x=j.useMemo(()=>t.filter(k=>{var B;if(k.category!=="Comisiones"||k.type!=="Egreso")return!1;const[_,C]=k.date.split("-").map(Number),E=_===l&&C-1===s,T=!d||k.description.toLowerCase().includes(d.toLowerCase())||((B=k.reference)==null?void 0:B.toLowerCase().includes(d.toLowerCase()));return E&&T}).sort((k,_)=>k.date.localeCompare(_.date)),[t,s,l,d]),m=j.useMemo(()=>x.reduce((k,_)=>k+(Number(_.amount)||0),0),[x]),b=j.useMemo(()=>x.reduce((k,_)=>k+(Number(_.amountBs)||0),0),[x]),v=async()=>{if(m<=0){alert("No hay comisiones acumuladas para facturar en este periodo.");return}const k=(s+1)%12,_=s===11?l+1:l;if(confirm(`¿Generar un gasto automático de $${m.toFixed(2)} por comisiones para ser cobrado en ${Ue[k]} ${_}?`)){p(!0);try{const E=await(await fetch(`${ye}/auto_apply_commissions.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({month:s,year:l,amountUsd:m,amountBs:b,targetMonth:k,targetYear:_})})).json();E.success?(alert("¡Éxito! Las comisiones han sido enviadas al Balance como 'Pendiente' para la próxima cuota."),r()):alert("Error: "+E.error)}catch{alert("Error de conexión con el motor contable.")}finally{p(!1)}}},y=()=>{const k=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Reporte de Comisiones - ${Ue[s]} ${l}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 1000px; margin: 0 auto; background: white; padding: 50px; border-radius: 24px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 30px; }
        .title { font-size: 20px; font-weight: 900; text-transform: uppercase; color: #0f172a; letter-spacing: 2px; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th { text-align: left; font-size: 10px; text-transform: uppercase; color: #64748b; padding: 12px; border-bottom: 2px solid #f1f5f9; }
        td { padding: 12px; font-size: 12px; border-bottom: 1px solid #f1f5f9; }
        .total-row { background: #0f172a; color: white; font-weight: 900; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 30px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Reporte de Comisiones Bancarias</div>
            <div style="font-size: 11px; color: #64748b; font-weight: 700; margin-top: 4px;">SAC 2026 - ${Ue[s]} ${l}</div>
        </div>
        
        <table>
            <thead>
                <tr>
                    <th>Fecha</th>
                    <th>Descripción</th>
                    <th>Referencia</th>
                    <th style="text-align: right;">Monto ($)</th>
                </tr>
            </thead>
            <tbody>
                ${x.map(T=>`
                    <tr>
                        <td>${T.date}</td>
                        <td>${T.description}</td>
                        <td>${T.reference||"S/R"}</td>
                        <td style="text-align: right;">$ ${Number(T.amount).toFixed(2)}</td>
                    </tr>
                `).join("")}
                <tr class="total-row">
                    <td colspan="3" style="text-align: right; padding: 15px;">TOTAL ACUMULADO</td>
                    <td style="text-align: right; padding: 15px;">$ ${m.toFixed(2)}</td>
                </tr>
            </tbody>
        </table>
        
        <div class="footer">
            Generado por SAC 2026 • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,_=new Blob([k],{type:"text/html"}),C=URL.createObjectURL(_),E=document.createElement("a");E.href=C,E.download=`Comisiones_${Ue[s]}_${l}.html`,E.click(),URL.revokeObjectURL(C)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-gradient-to-br from-indigo-600 to-blue-800 text-white shadow-2xl relative overflow-hidden",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-white/10 w-fit px-5 py-2 rounded-full backdrop-blur-md border border-white/20 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(ps,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Auditoría de Gastos Bancarios"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Recuperación de ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-300",children:"Comisiones"})]})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest mb-4 px-5 py-2 rounded-full border text-indigo-600 border-indigo-100 bg-indigo-50",children:"TOTAL ACUMULADO DEL MES"}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("span",{className:"text-2xl font-black mt-2 text-indigo-600",children:"$"}),n.jsx("span",{className:"text-7xl lg:text-8xl font-black tracking-tighter text-slate-900",children:m.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})})]}),n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase mt-2",children:["Bs. ",b.toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-8"}),n.jsxs("button",{disabled:f||m<=0,onClick:v,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-black py-5 rounded-2xl shadow-xl shadow-indigo-200 transition-all flex items-center justify-center gap-3 text-xs uppercase tracking-widest active:scale-95 disabled:opacity-50",children:[f?n.jsx(ot,{className:"animate-spin"}):n.jsx(sa,{size:18}),"AUTO-FACTURAR PRÓXIMO MES"]})]})]}),n.jsx(xr,{className:"absolute right-[-40px] bottom-[-40px] w-80 h-80 text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-center gap-6 bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-slate-50 p-2 rounded-2xl border border-slate-100 flex gap-2 w-full sm:w-auto shadow-inner",children:[n.jsx("select",{value:s,onChange:k=>i(Number(k.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-4 py-2 cursor-pointer",children:Ue.map((k,_)=>n.jsx("option",{value:_,children:k},_))}),n.jsx("input",{type:"number",value:l,onChange:k=>o(Number(k.target.value)),className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-20 text-center py-2"})]}),n.jsxs("div",{className:"relative w-full sm:w-72",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",children:n.jsx(Xt,{size:16})}),n.jsx("input",{type:"text",placeholder:"Buscar por referencia o voucher...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-3.5 text-xs focus:ring-2 focus:ring-indigo-500 outline-none transition-all font-bold",value:d,onChange:k=>u(k.target.value)})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-slate-50 text-slate-400 hover:bg-slate-100 rounded-2xl transition-all shadow-sm",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:y,className:"p-4 bg-slate-50 text-slate-400 hover:bg-blue-600 hover:text-white rounded-2xl transition-all shadow-sm",title:"Exportar HTML",children:n.jsx(ja,{size:20})}),n.jsx("button",{onClick:r,className:"p-4 bg-slate-50 text-slate-400 hover:bg-indigo-600 hover:text-white rounded-2xl transition-all shadow-sm",children:n.jsx(ot,{size:20,className:a?"animate-spin":""})})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Concepto Bancario / Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto USD"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto VES"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:x.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"py-24 text-center",children:[n.jsx(Nn,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"Sin comisiones detectadas en este mes"})]})}):n.jsx(n.Fragment,{children:x.map((k,_)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Lr,{size:14,className:"text-slate-300"}),n.jsx("span",{className:"font-black text-slate-700 text-sm",children:k.date})]})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-900 text-sm uppercase leading-none",children:k.description}),n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[n.jsxs("span",{className:"px-2 py-0.5 bg-slate-100 text-slate-500 rounded text-[8px] font-black uppercase tracking-tighter",children:["REF: ",k.reference||"S/R"]}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-300 uppercase",children:["AUDIT-ID: ",k.id]})]})]}),n.jsxs("td",{className:"px-10 py-6 text-right font-black text-rose-600",children:["$",Number(k.amount).toFixed(2)]}),n.jsx("td",{className:"px-10 py-6 text-right font-bold text-slate-400",children:Number(k.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})})]},_))})}),x.length>0&&n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:2,className:"px-10 py-8 text-xs font-black uppercase tracking-[0.3em]",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-xl flex items-center justify-center",children:n.jsx(xr,{size:20,className:"text-blue-400"})}),"Total Consolidado del Periodo"]})}),n.jsxs("td",{className:"px-10 py-8 text-right",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"TOTAL USD"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter text-white",children:["$",m.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})]}),n.jsxs("td",{className:"px-10 py-8 text-right",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"TOTAL VES"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter text-blue-300",children:["Bs. ",b.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})]})]})]})})]})})}),n.jsxs("div",{className:"p-10 bg-indigo-50 border border-indigo-100 rounded-[3rem] flex items-start gap-6",children:[n.jsx("div",{className:"w-12 h-12 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shrink-0 shadow-lg",children:n.jsx(mi,{size:24})}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-black text-indigo-900 uppercase text-xs tracking-widest",children:"Protocolo de Cobranza de Comisiones"}),n.jsx("p",{className:"text-indigo-800/70 text-sm font-medium leading-relaxed italic",children:'Este módulo extrae automáticamente todas las comisiones bancarias descontadas de los pagos de propietarios. Al usar "Auto-Facturar", el monto se agregará como un gasto administrativo al recibo de condominio del mes entrante, garantizando que el condominio no asuma la erosión financiera de los costos transaccionales.'})]})]})]})},VEe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,registerPayment:s,refreshData:i}=ht(),[l,o]=j.useState(null),[d,u]=j.useState([]),[f,p]=j.useState([]),[x,m]=j.useState(!1),[b,v]=j.useState(""),[y,k]=j.useState("TODOS"),_=j.useRef(null),[C,E]=j.useState(null),[T,B]=j.useState(null),[I,M]=j.useState(""),[U,D]=j.useState(""),[L,R]=j.useState("pm"),[Q,G]=j.useState(!1),[K,W]=j.useState(!1),[z,Z]=j.useState(null),[Y,te]=j.useState(!1),O=async ce=>{if(!(!ce||ce==="S/R"||ce.length<3))try{const le=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${ce}`,{credentials:"include"})).json();le.duplicate?Z(le):Z(null)}catch(ne){console.error("Error checking duplicate",ne)}},P=ce=>{var ge;const ne=(ge=ce.target.files)==null?void 0:ge[0];if(!ne)return;m(!0);const le=new FormData;le.append("file",ne),fetch(`${ye}/process_banplus_statement.php`,{method:"POST",body:le,credentials:"include"}).then(X=>X.json()).then(X=>{if(X.success){o(X.metadata);const pe=(X.movements||[]).map(be=>{if(!(be.category==="INGRESOS"||be.category==="EGRESOS"))return be;const _e=X.movements.some(Te=>Te.reference===be.reference&&Te!==be&&(Te.category==="COMISIONES"||Te.description.includes("COMISION")));return{...be,hasMissingCommission:!_e}});u(pe),p(X.summary)}else alert(X.error)}).catch(()=>alert("Error de conexión con el motor de análisis.")).finally(()=>m(!1))},q=j.useMemo(()=>d.filter(ce=>{const ne=ce.description.includes(b.toUpperCase())||ce.reference.includes(b)||ce.debit.toString().includes(b)||ce.credit.toString().includes(b),le=y==="TODOS"||ce.category===y;return ne&&le}),[d,b,y]),H=(ce,ne)=>{if(!ce)return 45;const le=a.find(pe=>pe.date===ce);if(le)return ne==="parallel"&&le.parallelValue?Number(le.parallelValue):ne==="am"&&le.amValue?Number(le.amValue):Number(le.pmValue)||Number(le.amValue);const X=[...a].sort((pe,be)=>be.date.localeCompare(pe.date)).find(pe=>pe.date<ce);return X?ne==="parallel"&&X.parallelValue?Number(X.parallelValue):ne==="am"&&X.amValue?Number(X.amValue):Number(X.pmValue)||Number(X.amValue):45},J=async()=>{if(!(!C||!T||!I)){if(z&&!Y){alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}W(!0);try{const ce=H(U||C.date,L),ne=Number((C.credit/ce).toFixed(2)),le=await fetch(`${ye}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:I,propertyId:T,amount:ne,method:"Transferencia Bancaria",reference:C.reference,date:U||C.date,slot:L,amount_bs:C.credit,skip_commission:Q})});if(!le.ok){const ge=await le.json();throw new Error(ge.error||"Fallo crítico en motor de pagos")}alert(`¡VINCULACIÓN EXITOSA!
Inmueble acreditado con $${ne} USD.`),E(null),await i()}catch(ce){alert("Error al vincular: "+ce.message)}finally{W(!1)}}},ae=j.useMemo(()=>[...t].sort((ce,ne)=>ce.code.localeCompare(ne.code,void 0,{numeric:!0})),[t]),oe=j.useMemo(()=>{if(!I||!T)return null;const ce=r.find(le=>le.id===I),ne=ce==null?void 0:ce.debts.find(le=>le.propertyId===T);return ne?{billed:Number(ne.amountUsd),paid:Number(ne.paidAmount),pending:Number(ne.amountUsd)-Number(ne.paidAmount)}:null},[I,T,r]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(ko,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Master Analyzer v2.0 Pro"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Analizador ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Banplus Estandar"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Kernel V4.0.63: Auditoría automática de comisiones y vinculación contable de precisión."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".csv",ref:_,onChange:P,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-blue-100",children:x?n.jsx(ot,{className:"animate-spin",size:40}):n.jsx(OA,{size:40})}),n.jsx("button",{onClick:()=>{var ce;return(ce=_.current)==null?void 0:ce.click()},disabled:x,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:x?"ANALIZANDO PATRONES...":"PROCESAR ESTADO CSV"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(Nn,{size:12})," Banplus Online Detailed Format"]})]})]}),n.jsx(La,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),l&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom-6 duration-700",children:[n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:f.map((ce,ne)=>n.jsxs("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-sm flex flex-col items-center text-center group hover:border-blue-500 transition-all",children:[n.jsx("span",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-2",children:ce.label}),n.jsxs("span",{className:"text-lg font-black text-slate-900 leading-none",children:["Bs. ",ce.total.toLocaleString("es-VE",{maximumFractionDigits:0})]}),n.jsxs("span",{className:"text-[9px] font-bold text-blue-500 mt-2 bg-blue-50 px-2 py-0.5 rounded-full",children:[ce.count," Ops"]})]},ne))}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50/30",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-slate-900 rounded-xl text-white shadow-lg",children:n.jsx(yl,{size:20})}),n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Libro Maestro de Auditoría V4.0.63"})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border rounded-xl hover:bg-slate-50 transition-all text-slate-400",children:n.jsx(yt,{size:20})})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción Bancaria"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Vincular"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:q.map((ce,ne)=>n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-all group ${ce.hasMissingCommission?"border-l-4 border-amber-400 bg-amber-50/10":""}`,children:[n.jsx("td",{className:"px-8 py-6 text-[11px] font-black text-slate-500",children:ce.date}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-blue-600",children:["#",ce.reference]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight truncate max-w-[280px]",children:ce.description}),n.jsx("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-tighter",children:ce.subCategory})]}),ce.hasMissingCommission&&n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-amber-100 text-amber-700 rounded-full border border-amber-200 shadow-sm",title:"No se detectó el par de comisión en este extracto",children:[n.jsx(na,{size:10}),n.jsx("span",{className:"text-[7px] font-black uppercase",children:"Sin Comisión"})]})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${ce.credit>0?"text-emerald-600":"text-rose-600"}`,children:[ce.credit>0?"+":"-"," ",(ce.credit||ce.debit).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:ce.credit>0&&ce.category==="INGRESOS"?n.jsx("button",{onClick:()=>{E(ce),B(null),M(""),D(ce.date),G(ce.hasMissingCommission||!1),Z(null),te(!1),O(ce.reference)},className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm active:scale-90",title:"Vincular pago a cuota",children:n.jsx(Vf,{size:16})}):n.jsx("div",{className:"w-10"})})]},ne))})]})})]})]}),C&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[90vh] custom-scrollbar border-2 border-indigo-100",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-indigo-100",children:n.jsx(Vf,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:"Asignación Directa"}),n.jsxs("p",{className:"text-[10px] font-bold text-indigo-600 uppercase tracking-widest mt-2",children:["Voucher: #",C.reference]})]})]}),n.jsx("button",{onClick:()=>E(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"space-y-6",children:[C.hasMissingCommission&&n.jsxs("div",{className:"p-5 bg-amber-50 border border-amber-200 rounded-3xl flex items-start gap-4 animate-pulse",children:[n.jsx(na,{className:"text-amber-600 shrink-0",size:24}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-amber-800 uppercase tracking-tight",children:"Advertencia de Conciliación"}),n.jsxs("p",{className:"text-[10px] text-amber-700 font-medium leading-relaxed",children:["El analizador no encontró una comisión bancaria para esta referencia en el extracto. El sistema sugiere ",n.jsx("b",{children:"NO cargar comisión"})," automáticamente para mantener el balance exacto con el banco."]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 space-y-4 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Ajuste de Fecha y Tasa"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Lr,{size:16,className:"text-blue-600"}),n.jsx("input",{type:"date",className:"bg-transparent font-black text-slate-800 outline-none w-full text-xs",value:U||C.date,onChange:ce=>D(ce.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Oc,{size:16,className:"text-indigo-600"}),n.jsxs("select",{className:"bg-transparent font-black text-slate-800 outline-none w-full text-[10px] uppercase tracking-widest",value:L,onChange:ce=>R(ce.target.value),children:[n.jsx("option",{value:"am",children:"Tasa AM (BCV)"}),n.jsx("option",{value:"pm",children:"Tasa PM (BCV)"}),n.jsx("option",{value:"parallel",children:"Tasa Paralelo"})]})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Tasa aplicada:"}),n.jsxs("span",{className:"text-xs font-black text-blue-600",children:[H(U||C.date,L).toFixed(2)," Bs/$"]})]})]}),n.jsxs("div",{className:"bg-blue-600 p-6 rounded-[2rem] text-white shadow-lg flex flex-col justify-center text-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Abono Estimado"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter mt-1",children:["$",(C.credit/H(U||C.date,L)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),n.jsxs("p",{className:"text-[8px] font-bold uppercase mt-2 opacity-50",children:["Bs. ",C.credit.toLocaleString("es-VE")]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`p-2 rounded-lg ${Q?"bg-amber-100 text-amber-600":"bg-blue-100 text-blue-600"}`,children:n.jsx(ps,{size:16})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-800 uppercase tracking-tight",children:"Gasto de Comisión en Banco"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase",children:Q?"NO SE REGISTRARÁ GASTO":"CALCULAR 1.5% AUTOMÁTICAMENTE"})]})]}),n.jsx("button",{type:"button",onClick:()=>G(!Q),className:`w-14 h-7 rounded-full transition-all relative ${Q?"bg-slate-300":"bg-blue-600"}`,children:n.jsx("div",{className:`absolute top-1 w-5 h-5 bg-white rounded-full transition-all shadow-md ${Q?"left-1":"left-8"}`})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"1. Unidad Inmobiliaria"}),n.jsxs("div",{className:"relative",children:[n.jsx(Gr,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:T||"",onChange:ce=>B(Number(ce.target.value)),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),ae.map(ce=>n.jsxs("option",{value:ce.id,children:[ce.code," - ",ce.type," ",ce.number]},ce.id))]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"2. Periodo de Gestión"}),n.jsxs("div",{className:"relative",children:[n.jsx(yl,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:I,onChange:ce=>M(ce.target.value),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),r.map(ce=>n.jsxs("option",{value:ce.id,children:[new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,ce.month)).toUpperCase()," ",ce.year]},ce.id))]})]})]})]}),oe&&n.jsxs("div",{className:"bg-slate-900 rounded-[2rem] p-6 text-white animate-in slide-in-from-top-4",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4 border-b border-white/10 pb-3",children:[n.jsx(na,{size:18,className:"text-amber-400"}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest",children:"Monitor de Deuda del Periodo"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Billed (Cuota)"}),n.jsxs("p",{className:"text-sm font-black",children:["$",oe.billed.toFixed(2)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Abonado"}),n.jsxs("p",{className:"text-sm font-black text-emerald-400",children:["$",oe.paid.toFixed(2)]})]}),n.jsxs("div",{className:"bg-white/10 rounded-xl p-2",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-400 mb-1",children:"Saldo Pendiente"}),n.jsxs("p",{className:`text-sm font-black ${oe.pending<=0?"text-emerald-400":"text-rose-400"}`,children:["$",oe.pending.toFixed(2)]})]})]})]}),z&&n.jsxs("div",{className:"p-6 bg-rose-50 border-2 border-rose-200 rounded-[2rem] space-y-4 animate-in shake duration-500",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600",children:[n.jsx(na,{size:24}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest",children:"Referencia Duplicada Detectada"})]}),n.jsx("p",{className:"text-[10px] text-rose-700 font-bold leading-relaxed",children:"Esta referencia ya existe en el sistema. Por favor, verifique si este pago ya fue procesado anteriormente para evitar duplicidad contable."}),z.matches&&z.matches.length>0&&n.jsx("div",{className:"bg-white/50 rounded-xl p-3 space-y-2",children:z.matches.map((ce,ne)=>n.jsxs("div",{className:"text-[9px] font-mono text-rose-900 flex justify-between border-b border-rose-100 pb-1 last:border-0",children:[n.jsx("span",{children:ce.date}),n.jsxs("span",{className:"font-black",children:["Bs. ",Number(ce.amount_bs||ce.amount).toLocaleString()]}),n.jsx("span",{children:ce.source_table})]},ne))}),["admin","programmer"].includes(e.role)&&n.jsxs("label",{className:"flex items-center gap-3 p-3 bg-white rounded-xl border border-rose-200 cursor-pointer hover:bg-rose-100 transition-colors",children:[n.jsx("input",{type:"checkbox",checked:Y,onChange:ce=>te(ce.target.checked),className:"w-5 h-5 rounded border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("span",{className:"text-[10px] font-black text-rose-900 uppercase tracking-tight",children:"Autorizar carga de referencia duplicada"})]})]}),n.jsxs("button",{disabled:K||!T||!I,onClick:J,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[K?n.jsx(ot,{className:"animate-spin"}):n.jsx(Wi,{size:20}),K?"SELLANDO LIBROS...":"CONFIRMAR VINCULACIÓN"]}),n.jsxs("div",{className:"p-4 bg-blue-50 border border-blue-100 rounded-2xl flex items-start gap-4",children:[n.jsx(Nn,{className:"text-blue-500 shrink-0 mt-0.5",size:18}),n.jsxs("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-relaxed tracking-tight",children:["Esta acción registrará el pago en el recibo y creará el asiento en el Libro de Banco ",Q?"(SIN COMISIÓN)":"(CON COMISIÓN)",", sincronizando los balances."]})]})]})]})})]})},GEe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,refreshData:s}=ht(),[i,l]=j.useState([]),[o,d]=j.useState(!1),[u,f]=j.useState(""),[p,x]=j.useState("TODOS"),m=j.useRef(null),[b,v]=j.useState(null),[y,k]=j.useState(null),[_,C]=j.useState(""),[E,T]=j.useState(""),[B,I]=j.useState("pm"),[M,U]=j.useState(!1),[D,L]=j.useState(null),[R,Q]=j.useState(!1),G=async P=>{if(!(!P||P==="S/R"||P.length<3))try{const H=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${P}`,{credentials:"include"})).json();H.duplicate?L(H):L(null)}catch(q){console.error("Error checking duplicate",q)}},K=P=>{const q=P.split(`
`),H=q.findIndex(oe=>oe.includes("Fecha	Hora	Referencia"));if(H===-1)return[];const ae=q.slice(H+1).map(oe=>{const ce=oe.split("	");if(ce.length<10)return null;const[ne,le,ge,X,pe,be,me,_e,Te,Xe,At]=ce,kt=Bt=>{if(!Bt||Bt.trim()===""||Bt.trim()==="0")return 0;const Kr=Bt.replace(/\./g,"").replace(",",".").trim();return parseFloat(Kr)};return{date:ne.trim(),time:le.trim(),reference:ge.trim(),cod:X.trim(),type:pe.trim(),operation:be.trim(),description:me.trim(),debit:Math.abs(kt(_e)),credit:kt(Te),balance:kt(Xe),reference2:At?At.trim():""}}).filter(oe=>oe!==null&&oe.date);return ae.map((oe,ce)=>{if(oe.credit===0&&oe.debit===0)return oe;if(oe.description.toUpperCase().includes("COMISIÓN")||oe.description.toUpperCase().includes("COMISION")||oe.operation.toUpperCase().includes("COMISIÓN"))return{...oe,isCommission:!0};const le=oe.credit||oe.debit,ge=Number((le*.015).toFixed(2)),X=Number((le*.003).toFixed(2)),pe=ae.find((be,me)=>{if(me===ce||!(be.description.toUpperCase().includes("COMISIÓN")||be.description.toUpperCase().includes("COMISION")||be.operation.toUpperCase().includes("COMISIÓN"))||!(be.reference===oe.reference||oe.reference.length>=8&&be.reference.endsWith(oe.reference.slice(-8))||be.reference.length>=8&&oe.reference.endsWith(be.reference.slice(-8))))return!1;const Xe=be.debit||be.credit;return Math.abs(Xe-ge)<.1||Math.abs(Xe-X)<.1});return{...oe,hasCommission:!!pe,commissionPair:pe}})},W=P=>{var J;const q=(J=P.target.files)==null?void 0:J[0];if(!q)return;d(!0);const H=new FileReader;H.onload=ae=>{var ne;const oe=(ne=ae.target)==null?void 0:ne.result,ce=K(oe);ce&&ce.length>0?l(ce):alert("No se detectaron movimientos válidos en el archivo BNC."),d(!1)},H.onerror=()=>{alert("Error al leer el archivo."),d(!1)},H.readAsText(q)},z=j.useMemo(()=>i.filter(P=>{const q=u.toUpperCase(),H=P.description.toUpperCase().includes(q)||P.reference.includes(q)||P.reference2.includes(q)||P.debit.toString().includes(q)||P.credit.toString().includes(q);let J=!0;return p==="INGRESOS"&&(J=P.credit>0&&!P.isCommission),p==="EGRESOS"&&(J=P.debit>0&&!P.isCommission),p==="COMISIONES"&&(J=P.isCommission===!0),H&&J}),[i,u,p]),Z=(P,q)=>{const H=P.split("/");if(H.length!==3)return 45;const J=`${H[2]}-${H[1]}-${H[0]}`,ae=a.find(ne=>ne.date===J);if(ae)return q==="parallel"&&ae.parallelValue?Number(ae.parallelValue):q==="am"&&ae.amValue?Number(ae.amValue):Number(ae.pmValue)||Number(ae.amValue);const ce=[...a].sort((ne,le)=>le.date.localeCompare(ne.date)).find(ne=>ne.date<J);return ce?q==="parallel"&&ce.parallelValue?Number(ce.parallelValue):q==="am"&&ce.amValue?Number(ce.amValue):Number(ce.pmValue)||Number(ce.amValue):45},Y=async()=>{if(!(!b||!y||!_)){if(D&&!R){alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}U(!0);try{const P=Z(E||b.date,B),q=Number((b.credit/P).toFixed(2)),H=(E||b.date).split("/"),J=H.length===3?`${H[2]}-${H[1]}-${H[0]}`:E,ae=await fetch(`${ye}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:_,propertyId:y,amount:q,method:"Transferencia BNC",reference:b.reference,date:J,slot:B,amount_bs:b.credit,skip_commission:!b.hasCommission})});if(!ae.ok){const oe=await ae.json();throw new Error(oe.error||"Fallo crítico en motor de pagos")}alert(`¡VINCULACIÓN EXITOSA!
Inmueble acreditado con $${q} USD.`),v(null),await s()}catch(P){alert("Error al vincular: "+P.message)}finally{U(!1)}}},te=j.useMemo(()=>[...t].sort((P,q)=>P.code.localeCompare(q.code,void 0,{numeric:!0})),[t]),O=j.useMemo(()=>{if(!_||!y)return null;const P=r.find(H=>H.id===_),q=P==null?void 0:P.debts.find(H=>H.propertyId===y);return q?{billed:Number(q.amountUsd),paid:Number(q.paidAmount),pending:Number(q.amountUsd)-Number(q.paidAmount)}:null},[_,y,r]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-orange-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-orange-600 w-fit px-5 py-2 rounded-full border border-orange-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(xr,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"BNC Intelligence Core v4.1"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Analizador ",n.jsx("br",{}),n.jsx("span",{className:"text-orange-500 italic",children:"Estados BNC"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Motor forense para estados de cuenta BNC en formato TXT. Detección de comisiones y vinculación automatizada."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".txt",ref:m,onChange:W,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-orange-50 text-orange-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-orange-100",children:o?n.jsx(ot,{className:"animate-spin",size:40}):n.jsx(OA,{size:40})}),n.jsx("button",{onClick:()=>{var P;return(P=m.current)==null?void 0:P.click()},disabled:o,className:"w-full bg-orange-600 hover:bg-orange-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:o?"PROCESANDO TXT...":"CARGAR ESTADO BNC"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(Nn,{size:12})," Formato TXT Tabulado BNC"]})]})]}),n.jsx(La,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),i.length>0&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom-6 duration-700",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por referencia, descripción o monto...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold outline-none focus:ring-2 focus:ring-orange-500",value:u,onChange:P=>f(P.target.value)})]}),n.jsx("div",{className:"flex gap-2 w-full lg:w-auto overflow-x-auto pb-2 lg:pb-0",children:["TODOS","INGRESOS","EGRESOS","COMISIONES"].map(P=>n.jsx("button",{onClick:()=>x(P),className:`px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all whitespace-nowrap ${p===P?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:P},P))})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50/30",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-orange-600 rounded-xl text-white shadow-lg",children:n.jsx(yl,{size:20})}),n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Movimientos Detectados BNC"})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border rounded-xl hover:bg-slate-50 transition-all text-slate-400",children:n.jsx(yt,{size:20})})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha / Hora"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Operación"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:z.map((P,q)=>n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-all group ${P.isCommission?"bg-slate-50/30 opacity-70":""}`,children:[n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-[11px] font-black text-slate-700",children:P.date}),n.jsx("p",{className:"text-[9px] text-slate-400",children:P.time})]}),n.jsxs("td",{className:"px-8 py-6 text-center",children:[n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-orange-600",children:["#",P.reference]}),P.reference2&&P.reference2!=="0"&&n.jsxs("p",{className:"text-[8px] text-slate-400 mt-1",children:["Ref2: ",P.reference2]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight",children:P.description}),P.hasCommission&&n.jsxs("div",{className:"flex items-center gap-1 px-2 py-0.5 bg-emerald-100 text-emerald-700 rounded-full border border-emerald-200",title:`Comisión detectada: Bs. ${P.commissionPair.debit}`,children:[n.jsx(ps,{size:8}),n.jsx("span",{className:"text-[7px] font-black uppercase",children:"Con Comisión"})]})]}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-tighter mt-1",children:[P.operation," | ",P.type]})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${P.credit>0?"text-emerald-600":"text-rose-600"}`,children:[P.credit>0?"+":"-"," ",(P.credit||P.debit).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-8 py-6 text-center",children:P.credit>0&&!P.isCommission?n.jsx("button",{onClick:()=>{v(P),k(null),C(""),T(P.date),L(null),Q(!1),G(P.reference)},className:"p-3 bg-orange-50 text-orange-600 rounded-xl hover:bg-orange-600 hover:text-white transition-all shadow-sm active:scale-90",title:"Asignar a Propietario",children:n.jsx(Vf,{size:16})}):n.jsx("div",{className:"w-10 mx-auto"})})]},q))})]})})]})]}),b&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[90vh] custom-scrollbar border-2 border-orange-100",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-orange-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-orange-100",children:n.jsx(eu,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:"Asignación de Pago"}),n.jsxs("p",{className:"text-[10px] font-bold text-orange-600 uppercase tracking-widest mt-2",children:["BNC Ref: #",b.reference]})]})]}),n.jsx("button",{onClick:()=>v(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 space-y-4 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha y Tasa Aplicada"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Lr,{size:16,className:"text-orange-600"}),n.jsx("input",{type:"text",placeholder:"DD/MM/YYYY",className:"bg-transparent font-black text-slate-800 outline-none w-full text-xs",value:E,onChange:P=>T(P.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Oc,{size:16,className:"text-indigo-600"}),n.jsxs("select",{className:"bg-transparent font-black text-slate-800 outline-none w-full text-[10px] uppercase tracking-widest",value:B,onChange:P=>I(P.target.value),children:[n.jsx("option",{value:"am",children:"Tasa AM (BCV)"}),n.jsx("option",{value:"pm",children:"Tasa PM (BCV)"}),n.jsx("option",{value:"parallel",children:"Tasa Paralelo"})]})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Tasa aplicada:"}),n.jsxs("span",{className:"text-xs font-black text-orange-600",children:[Z(E,B).toFixed(2)," Bs/$"]})]})]}),n.jsxs("div",{className:"bg-orange-600 p-6 rounded-[2rem] text-white shadow-lg flex flex-col justify-center text-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Equivalente USD"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter mt-1",children:["$",(b.credit/Z(E,B)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),n.jsxs("p",{className:"text-[8px] font-bold uppercase mt-2 opacity-50",children:["Monto Original: Bs. ",b.credit.toLocaleString("es-VE")]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"1. Seleccionar Propiedad"}),n.jsxs("div",{className:"relative",children:[n.jsx(Gr,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-orange-600 appearance-none text-xs",value:y||"",onChange:P=>k(Number(P.target.value)),children:[n.jsx("option",{value:"",children:"-- Buscar Inmueble --"}),te.map(P=>n.jsxs("option",{value:P.id,children:[P.code," - ",P.type," ",P.number]},P.id))]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"2. Mes a Pagar"}),n.jsxs("div",{className:"relative",children:[n.jsx(yl,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-orange-600 appearance-none text-xs",value:_,onChange:P=>C(P.target.value),children:[n.jsx("option",{value:"",children:"-- Seleccionar Mes --"}),r.map(P=>n.jsxs("option",{value:P.id,children:[new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,P.month)).toUpperCase()," ",P.year]},P.id))]})]})]})]}),O&&n.jsxs("div",{className:"bg-slate-900 rounded-[2rem] p-6 text-white animate-in slide-in-from-top-4",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4 border-b border-white/10 pb-3",children:[n.jsx(sa,{size:18,className:"text-orange-400"}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest",children:"Estado de Cuenta en Sistema"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Total Facturado"}),n.jsxs("p",{className:"text-sm font-black",children:["$",O.billed.toFixed(2)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Pagado"}),n.jsxs("p",{className:"text-sm font-black text-emerald-400",children:["$",O.paid.toFixed(2)]})]}),n.jsxs("div",{className:"bg-white/10 rounded-xl p-2",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-orange-400 mb-1",children:"Pendiente"}),n.jsxs("p",{className:`text-sm font-black ${O.pending<=0?"text-emerald-400":"text-rose-400"}`,children:["$",O.pending.toFixed(2)]})]})]})]}),D&&n.jsxs("div",{className:"p-6 bg-rose-50 border-2 border-rose-200 rounded-[2rem] space-y-4 animate-in shake duration-500",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600",children:[n.jsx(na,{size:24}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest",children:"Referencia Duplicada Detectada"})]}),n.jsx("p",{className:"text-[10px] text-rose-700 font-bold leading-relaxed",children:"Esta referencia ya existe en el sistema. Por favor, verifique si este pago ya fue procesado anteriormente para evitar duplicidad contable."}),D.matches&&D.matches.length>0&&n.jsx("div",{className:"bg-white/50 rounded-xl p-3 space-y-2",children:D.matches.map((P,q)=>n.jsxs("div",{className:"text-[9px] font-mono text-rose-900 flex justify-between border-b border-rose-100 pb-1 last:border-0",children:[n.jsx("span",{children:P.date}),n.jsxs("span",{className:"font-black",children:["Bs. ",Number(P.amount_bs||P.amount).toLocaleString()]}),n.jsx("span",{children:P.source_table})]},q))}),["admin","programmer"].includes(e.role)&&n.jsxs("label",{className:"flex items-center gap-3 p-3 bg-white rounded-xl border border-rose-200 cursor-pointer hover:bg-rose-100 transition-colors",children:[n.jsx("input",{type:"checkbox",checked:R,onChange:P=>Q(P.target.checked),className:"w-5 h-5 rounded border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("span",{className:"text-[10px] font-black text-rose-900 uppercase tracking-tight",children:"Autorizar carga de referencia duplicada"})]})]}),n.jsxs("button",{disabled:M||!y||!_,onClick:Y,className:"w-full bg-orange-600 hover:bg-orange-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[M?n.jsx(ot,{className:"animate-spin"}):n.jsx(Wi,{size:20}),M?"PROCESANDO...":"CONFIRMAR Y ACREDITAR"]}),n.jsxs("div",{className:"p-4 bg-orange-50 border border-orange-100 rounded-2xl flex items-start gap-4",children:[n.jsx(Ea,{className:"text-orange-500 shrink-0 mt-0.5",size:18}),n.jsxs("p",{className:"text-[10px] text-orange-800 font-bold uppercase leading-relaxed tracking-tight",children:["El sistema validará automáticamente la tasa del día ",E," para asegurar que el abono en USD coincida con el registro contable."]})]})]})]})})]})},KEe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,refreshData:s}=ht(),[i,l]=j.useState(null),[o,d]=j.useState(!1),[u,f]=j.useState(""),[p,x]=j.useState("TODOS"),m=j.useRef(null),[b,v]=j.useState(null),[y,k]=j.useState(null),[_,C]=j.useState(""),[E,T]=j.useState(""),[B,I]=j.useState(!1),[M,U]=j.useState(!1),[D,L]=j.useState(null),[R,Q]=j.useState(!1),G=async O=>{if(!(!O||O==="S/R"||O.length<3))try{const q=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${O}`,{credentials:"include"})).json();q.duplicate?L(q):L(null)}catch(P){console.error("Error checking duplicate",P)}},K=O=>{var H;const P=(H=O.target.files)==null?void 0:H[0];if(!P)return;d(!0);const q=new FormData;q.append("file",P),fetch(`${ye}/process_banplus_detailed.php`,{method:"POST",body:q,credentials:"include"}).then(J=>J.json()).then(J=>{J.success?l(J):alert(J.error||"Fallo en el protocolo de lectura.")}).catch(()=>alert("Error crítico en el Kernel de Auditoría.")).finally(()=>d(!1))},W=O=>{if(!O)return 45;const P=a.find(J=>J.date===O);if(P)return Number(P.pmValue)||Number(P.amValue);const H=[...a].sort((J,ae)=>ae.date.localeCompare(J.date)).find(J=>J.date<O);return H?Number(H.pmValue)||Number(H.amValue):45},z=async()=>{if(!(!b||!y||!_)){if(D&&!R){alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}U(!0);try{const O=W(E||b.date),P=Number((b.credit/O).toFixed(2)),q=await fetch(`${ye}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:_,propertyId:y,amount:P,method:"Transferencia Bancaria",reference:b.ref,date:E||b.date,slot:"pm",amount_bs:b.credit,skip_commission:B})});if(!q.ok){const H=await q.json();throw new Error(H.error||"Fallo crítico en motor de pagos")}alert(`¡VINCULACIÓN EXITOSA!
Unidad acreditada satisfactoriamente.`),v(null),await s()}catch(O){alert("Error al vincular: "+O.message)}finally{U(!1)}}},Z=j.useMemo(()=>{if(!_||!y)return null;const O=r.find(q=>q.id===_),P=O==null?void 0:O.debts.find(q=>q.propertyId===y);return P?{billed:Number(P.amountUsd),paid:Number(P.paidAmount),pending:Number(P.amountUsd)-Number(P.paidAmount)}:null},[_,y,r]),Y=j.useMemo(()=>[...t].sort((O,P)=>O.code.localeCompare(P.code,void 0,{numeric:!0})),[t]),te=j.useMemo(()=>i?i.movements.filter(O=>{const P=(O.credit||O.debit).toString(),q=O.desc.includes(u.toUpperCase())||O.ref.includes(u)||P.includes(u),H=p==="TODOS"||O.category===p;return q&&H}):[],[i,u,p]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsx("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Pc,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Protocolo Kernel V4.0.64 Online"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Analizador ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Banplus Detallado"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Auditoría integrada: vinculación automática de pagos, detección de comisiones y monitor de deuda."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".csv",ref:m,onChange:K,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-blue-100 shadow-inner",children:o?n.jsx(ot,{className:"animate-spin",size:40}):n.jsx(OA,{size:40})}),n.jsx("button",{onClick:()=>{var O;return(O=m.current)==null?void 0:O.click()},disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:o?"HASHEANDO EXTRACTO...":"CARGAR CSV DETALLADO"})]})]})}),i&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Filtrar por glosa, referencia o monto...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-blue-500",value:u,onChange:O=>f(O.target.value)})]}),n.jsx("div",{className:"flex gap-2 w-full lg:w-auto",children:["TODOS","INGRESOS_OPERATIVOS","COMISION_BANCARIA"].map(O=>n.jsx("button",{onClick:()=>x(O),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${p===O?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:O.replace("_"," ")},O))})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 bg-slate-50/30 flex justify-between items-center",children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Libro Maestro Banplus Online v4.0.64"}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border rounded-xl hover:bg-slate-50 transition-all text-slate-400",children:n.jsx(yt,{size:20})})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Comisión"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Vincular"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:te.map((O,P)=>n.jsxs("tr",{className:`hover:bg-slate-50 transition-all group ${O.hasMissingCommission?"border-l-4 border-amber-400 bg-amber-50/10":""}`,children:[n.jsx("td",{className:"px-10 py-6 text-[11px] font-black text-slate-500",children:O.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-blue-600",children:["#",O.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight truncate max-w-[280px]",children:O.desc}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-tighter",children:["Canal: ",O.channel]})]}),O.hasMissingCommission&&n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-amber-100 text-amber-700 rounded-full border border-amber-200 shadow-sm",title:"No se detectó el par de comisión en este extracto",children:[n.jsx(na,{size:10}),n.jsx("span",{className:"text-[7px] font-black uppercase",children:"Sin Comisión"})]})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${O.type==="INGRESO"?"text-emerald-600":"text-rose-600"}`,children:[O.type==="INGRESO"?"+":"-"," ",(O.credit||O.debit).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:O.credit>0&&O.category==="INGRESOS_OPERATIVOS"?n.jsx("button",{onClick:()=>{v(O),k(null),C(""),T(O.date),I(O.hasMissingCommission||!1),L(null),Q(!1),G(O.ref)},className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm active:scale-90",children:n.jsx(Vf,{size:16})}):n.jsx("div",{className:"w-10"})})]},P))})]})})]})]}),b&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[90vh] custom-scrollbar border-2 border-indigo-100",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-indigo-100",children:n.jsx(Vf,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:"Asignación Directa"}),n.jsxs("p",{className:"text-[10px] font-bold text-indigo-600 uppercase tracking-widest mt-2",children:["Voucher: #",b.ref]})]})]}),n.jsx("button",{onClick:()=>v(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"space-y-6",children:[b.hasMissingCommission&&n.jsxs("div",{className:"p-5 bg-amber-50 border border-amber-200 rounded-3xl flex items-start gap-4",children:[n.jsx(na,{className:"text-amber-600 shrink-0",size:24}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-amber-800 uppercase tracking-tight",children:"Advertencia de Comisión"}),n.jsxs("p",{className:"text-[10px] text-amber-700 font-medium leading-relaxed",children:["El analizador no encontró comisión bancaria para esta referencia. El sistema sugiere ",n.jsx("b",{children:"no cargar"})," el gasto administrativo."]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 space-y-4 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha Contable"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Lr,{size:16,className:"text-blue-600"}),n.jsx("input",{type:"date",className:"bg-transparent font-black text-slate-800 outline-none w-full text-xs",value:E,onChange:O=>T(O.target.value)})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Tasa aplicada:"}),n.jsxs("span",{className:"text-xs font-black text-blue-600",children:[W(E).toFixed(2)," Bs/$"]})]})]}),n.jsxs("div",{className:"bg-blue-600 p-6 rounded-[2rem] text-white shadow-lg flex flex-col justify-center text-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Abono Proyectado"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter mt-1",children:["$",(b.credit/W(E)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),n.jsxs("p",{className:"text-[8px] font-bold uppercase mt-2 opacity-50",children:["Bs. ",b.credit.toLocaleString("es-VE")]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`p-2 rounded-lg ${B?"bg-amber-100 text-amber-600":"bg-blue-100 text-blue-600"}`,children:n.jsx(ps,{size:16})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-800 uppercase tracking-tight",children:"Comisión en Banco"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase",children:B?"NO SE REGISTRARÁ GASTO":"CALCULAR 1.5% AUTOMÁTICAMENTE"})]})]}),n.jsx("button",{type:"button",onClick:()=>I(!B),className:`w-14 h-7 rounded-full transition-all relative ${B?"bg-slate-300":"bg-blue-600"}`,children:n.jsx("div",{className:`absolute top-1 w-5 h-5 bg-white rounded-full transition-all shadow-md ${B?"left-1":"left-8"}`})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"1. Unidad Inmobiliaria"}),n.jsxs("div",{className:"relative",children:[n.jsx(Gr,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:y||"",onChange:O=>k(Number(O.target.value)),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),Y.map(O=>n.jsxs("option",{value:O.id,children:[O.code," - ",O.type," ",O.number]},O.id))]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"2. Periodo"}),n.jsxs("div",{className:"relative",children:[n.jsx(yl,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:_,onChange:O=>C(O.target.value),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),r.map(O=>n.jsxs("option",{value:O.id,children:[Ue[O.month].toUpperCase()," ",O.year]},O.id))]})]})]})]}),Z&&n.jsxs("div",{className:"bg-slate-900 rounded-[2rem] p-6 text-white animate-in slide-in-from-top-4",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4 border-b border-white/10 pb-3",children:[n.jsx(na,{size:18,className:"text-amber-400"}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest",children:"Monitor de Deuda"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Facturado"}),n.jsxs("p",{className:"text-sm font-black",children:["$",Z.billed.toFixed(2)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Abonado"}),n.jsxs("p",{className:"text-sm font-black text-emerald-400",children:["$",Z.paid.toFixed(2)]})]}),n.jsxs("div",{className:"bg-white/10 rounded-xl p-2",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-400 mb-1",children:"Saldo Pendiente"}),n.jsxs("p",{className:`text-sm font-black ${Z.pending<=0?"text-emerald-400":"text-rose-400"}`,children:["$",Z.pending.toFixed(2)]})]})]})]}),D&&n.jsxs("div",{className:"p-6 bg-rose-50 border-2 border-rose-200 rounded-[2rem] space-y-4 animate-in shake duration-500",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600",children:[n.jsx(na,{size:24}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest",children:"Referencia Duplicada Detectada"})]}),n.jsx("p",{className:"text-[10px] text-rose-700 font-bold leading-relaxed",children:"Esta referencia ya existe en el sistema. Por favor, verifique si este pago ya fue procesado anteriormente para evitar duplicidad contable."}),D.matches&&D.matches.length>0&&n.jsx("div",{className:"bg-white/50 rounded-xl p-3 space-y-2",children:D.matches.map((O,P)=>n.jsxs("div",{className:"text-[9px] font-mono text-rose-900 flex justify-between border-b border-rose-100 pb-1 last:border-0",children:[n.jsx("span",{children:O.date}),n.jsxs("span",{className:"font-black",children:["Bs. ",Number(O.amount_bs||O.amount).toLocaleString()]}),n.jsx("span",{children:O.source_table})]},P))}),["admin","programmer"].includes(e.role)&&n.jsxs("label",{className:"flex items-center gap-3 p-3 bg-white rounded-xl border border-rose-200 cursor-pointer hover:bg-rose-100 transition-colors",children:[n.jsx("input",{type:"checkbox",checked:R,onChange:O=>Q(O.target.checked),className:"w-5 h-5 rounded border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("span",{className:"text-[10px] font-black text-rose-900 uppercase tracking-tight",children:"Autorizar carga de referencia duplicada"})]})]}),n.jsxs("button",{disabled:M||!y||!_,onClick:z,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[M?n.jsx(ot,{className:"animate-spin"}):n.jsx(Wi,{size:20}),M?"SELLANDO LIBROS...":"CONFIRMAR VINCULACIÓN"]})]})]})})]})},qEe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!1),[i,l]=j.useState(""),[o,d]=j.useState("TODOS"),u=j.useRef(null),[f,p]=j.useState(new Date().getMonth()+1),[x,m]=j.useState(new Date().getFullYear()),[b,v]=j.useState(null),y=T=>{s(!0);const B=new FormData;B.append("file",T),B.append("month",f.toString()),B.append("year",x.toString()),fetch(`${ye}/process_bank_vs_bank.php`,{method:"POST",body:B,credentials:"include"}).then(I=>I.json()).then(I=>{I.success?r(I):alert(I.error||"Fallo en el protocolo de cruce.")}).catch(()=>alert("Error crítico en el motor de conciliación.")).finally(()=>s(!1))},k=T=>{var I;const B=(I=T.target.files)==null?void 0:I[0];B&&(v(B),y(B))},_=j.useMemo(()=>t?t.missing.filter(T=>{const B=T.desc.includes(i.toUpperCase())||T.ref.includes(i)||T.amount.toString().includes(i.replace(",",".")),I=o==="TODOS"||T.type===o;return B&&I}):[],[t,i,o]),C=[{v:1,n:"Enero"},{v:2,n:"Febrero"},{v:3,n:"Marzo"},{v:4,n:"Abril"},{v:5,n:"Mayo"},{v:6,n:"Junio"},{v:7,n:"Julio"},{v:8,n:"Agosto"},{v:9,n:"Septiembre"},{v:10,n:"Octubre"},{v:11,n:"Noviembre"},{v:12,n:"Diciembre"}],E=Array.from({length:5},(T,B)=>new Date().getFullYear()-2+B);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(kA,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Cotejo Inteligente SAC 2026"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Banco ",n.jsx("span",{className:"text-indigo-500 italic",children:"vs"})," Banco"]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Validación forense de rastro bancario. Detecta automáticamente operaciones procesadas por el banco pero omitidas en el sistema administrativo."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsxs("div",{className:"flex gap-4 mb-8 w-full",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Mes de Cruce"}),n.jsx("select",{value:f,onChange:T=>{const B=parseInt(T.target.value);if(p(B),b){const I=new FormData;I.append("file",b),I.append("month",B.toString()),I.append("year",x.toString()),s(!0),fetch(`${ye}/process_bank_vs_bank.php`,{method:"POST",body:I,credentials:"include"}).then(M=>M.json()).then(M=>{M.success&&r(M)}).finally(()=>s(!1))}},className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:C.map(T=>n.jsx("option",{value:T.v,children:T.n},T.v))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Año"}),n.jsx("select",{value:x,onChange:T=>{const B=parseInt(T.target.value);if(m(B),b){const I=new FormData;I.append("file",b),I.append("month",f.toString()),I.append("year",B.toString()),s(!0),fetch(`${ye}/process_bank_vs_bank.php`,{method:"POST",body:I,credentials:"include"}).then(M=>M.json()).then(M=>{M.success&&r(M)}).finally(()=>s(!1))}},className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:E.map(T=>n.jsx("option",{value:T,children:T},T))})]})]}),n.jsx("input",{type:"file",accept:".csv",ref:u,onChange:k,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-indigo-100 shadow-inner",children:a?n.jsx(ot,{className:"animate-spin",size:40}):n.jsx(ko,{size:40})}),n.jsx("button",{onClick:()=>{var T;return(T=u.current)==null?void 0:T.click()},disabled:a,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:a?"REALIZANDO CRUCE...":"SUBIR ESTADO PARA COTEJAR"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(Ea,{size:12})," Auditoría de Integridad Bancaria"]})]})]}),n.jsx(La,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),t?n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Operaciones en Banco"}),n.jsx("h4",{className:"text-4xl font-black text-slate-900",children:t.summary.total_processed})]}),n.jsxs("div",{className:"bg-emerald-50 p-8 rounded-[3rem] border border-emerald-100 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-4",children:"Coinciden con Sistema"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(zt,{className:"text-emerald-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-emerald-600",children:t.summary.matched})]})]}),n.jsxs("div",{className:"bg-rose-50 p-8 rounded-[3rem] border border-rose-100 shadow-sm text-center flex flex-col items-center justify-center animate-pulse-subtle",children:[n.jsx("span",{className:"text-[10px] font-black text-rose-600 uppercase tracking-widest mb-4",children:"OMISIONES DETECTADAS"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(na,{className:"text-rose-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-rose-600",children:t.summary.unmatched})]})]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar omisión por referencia o descripción...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-indigo-500",value:i,onChange:T=>l(T.target.value)})]}),n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>d("TODOS"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="TODOS"?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Todos"}),n.jsx("button",{onClick:()=>d("INGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="INGRESO"?"bg-emerald-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Ingresos"}),n.jsx("button",{onClick:()=>d("EGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="EGRESO"?"bg-rose-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Egresos"})]})]}),n.jsxs("div",{className:"bg-white rounded-[4rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-10 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center bg-slate-50/30 gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-4 bg-rose-600 rounded-2xl text-white shadow-lg",children:n.jsx(Pc,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight uppercase leading-none",children:"Operaciones No Registradas"}),n.jsx("p",{className:"text-[10px] font-bold text-rose-500 uppercase tracking-widest mt-2",children:"Acciones pendientes de regularización contable"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const T=["Fecha","Referencia","Descripción","Monto Banco","Monto Sistema","Diferencia"],B=_.map(I=>[I.date,I.ref,I.desc,`$${Number(I.amount).toFixed(2)}`,I.type]);zc("Conciliación Banco vs Banco",T,B)},className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(gr,{size:24})}),n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",children:n.jsx(yt,{size:24})})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Banco"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Concepto Bancario (Glosa)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Nominal (Bs)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estatus"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:_.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"No se detectaron omisiones para estos filtros."})}):_.map((T,B)=>n.jsxs("tr",{className:"hover:bg-slate-50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6 text-slate-500 font-bold text-xs",children:T.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"bg-slate-100 text-slate-800 px-4 py-2 rounded-xl text-xs font-black border border-slate-200 shadow-sm",children:["#",T.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsx("p",{className:"font-black text-slate-700 text-[11px] uppercase leading-tight truncate max-w-[320px]",children:T.desc})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${T.type==="INGRESO"?"text-emerald-600":"text-rose-600"}`,children:[T.type==="INGRESO"?"+":"-"," ",T.amount.toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"px-3 py-1 bg-red-50 text-red-600 rounded-full text-[8px] font-black uppercase tracking-widest border border-red-100 flex items-center justify-center gap-1.5 w-fit mx-auto animate-pulse",children:[n.jsx(sa,{size:10})," FALTANTE"]})})]},B))})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5 p-6 bg-white border border-slate-200 rounded-[2.5rem] shadow-sm",children:[n.jsx(hs,{className:"text-rose-600",size:32}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:"Protocolo de Conciliación Activo"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase italic",children:'Las omisiones detectadas deben ser regularizadas mediante "Registrar Movimiento" o "Reporte de Pago".'})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.4em]",children:"Arquitectura SAC 2026"}),n.jsx("p",{className:"text-[10px] font-black text-indigo-600 uppercase",children:"TecnoMath Reconciliation Core"})]})]})]})]}):n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx("div",{className:"w-24 h-24 bg-slate-50 rounded-[2rem] flex items-center justify-center mx-auto mb-6 shadow-inner",children:n.jsx(Xt,{size:48,className:"text-slate-200"})}),n.jsx("h3",{className:"text-xl font-black text-slate-400 uppercase tracking-widest",children:"Protocolo de Conciliación Listo"}),n.jsx("p",{className:"text-slate-300 text-sm mt-2 font-medium",children:"Suba el CSV del banco para identificar operaciones faltantes en SAC 2026."})]}),n.jsx("style",{children:`
          @keyframes pulse-subtle {
              0%, 100% { transform: scale(1); }
              50% { transform: scale(1.02); }
          }
          .animate-pulse-subtle {
              animation: pulse-subtle 4s infinite ease-in-out;
          }
      `})]})},WEe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!1),[i,l]=j.useState(""),[o,d]=j.useState("TODOS"),u=j.useRef(null),[f,p]=j.useState(new Date().getMonth()+1),[x,m]=j.useState(new Date().getFullYear()),b=E=>{const T=E.split(`
`),B=T.findIndex(M=>M.includes("Fecha	Hora	Referencia"));return B===-1?[]:T.slice(B+1).map(M=>{const U=M.split("	");if(U.length<10)return null;const[D,L,R,Q,G,K,W,z,Z,Y,te]=U,O=P=>{if(!P||P.trim()===""||P.trim()==="0")return 0;const q=P.replace(/\./g,"").replace(",",".").trim();return parseFloat(q)};return{date:D.trim(),reference:R.trim(),description:W.trim(),amount:O(Z)||-Math.abs(O(z)),type:O(Z)>0?"INGRESO":"EGRESO"}}).filter(M=>M!==null&&M.date)},v=async E=>{s(!0);try{const T=await E.text(),B=b(T),M=await(await fetch(`${ye}/get_system_bank_movements.php?month=${f}&year=${x}`,{credentials:"include"})).json();if(!M.success)throw new Error(M.error);const U=M.movements,D=[];let L=0;B.forEach(R=>{if(R.amount===0)return;U.find(G=>G.reference===R.reference||R.reference.length>=8&&G.reference.endsWith(R.reference.slice(-8))||G.reference.length>=8&&R.reference.endsWith(G.reference.slice(-8)))?L++:D.push({date:R.date,ref:R.reference,desc:R.description,amount:Math.abs(R.amount),type:R.type})}),r({summary:{total_processed:B.filter(R=>R.amount!==0).length,matched:L,unmatched:D.length},missing:D})}catch(T){alert("Error en el cruce de datos: "+T.message)}finally{s(!1)}},y=E=>{var B;const T=(B=E.target.files)==null?void 0:B[0];T&&v(T)},k=j.useMemo(()=>t?t.missing.filter(E=>{const T=E.desc.toUpperCase().includes(i.toUpperCase())||E.ref.includes(i)||E.amount.toString().includes(i.replace(",",".")),B=o==="TODOS"||E.type===o;return T&&B}):[],[t,i,o]),_=[{v:1,n:"Enero"},{v:2,n:"Febrero"},{v:3,n:"Marzo"},{v:4,n:"Abril"},{v:5,n:"Mayo"},{v:6,n:"Junio"},{v:7,n:"Julio"},{v:8,n:"Agosto"},{v:9,n:"Septiembre"},{v:10,n:"Octubre"},{v:11,n:"Noviembre"},{v:12,n:"Diciembre"}],C=Array.from({length:5},(E,T)=>new Date().getFullYear()-2+T);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-orange-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-orange-600 w-fit px-5 py-2 rounded-full border border-orange-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(kA,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Cotejo BNC SAC 2026"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Banco ",n.jsx("span",{className:"text-orange-500 italic",children:"vs"})," Banco BNC"]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Validación forense de rastro bancario BNC. Cruce automático de referencias de 8 dígitos y montos nominales."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsxs("div",{className:"flex gap-4 mb-8 w-full",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Mes de Cruce"}),n.jsx("select",{value:f,onChange:E=>p(parseInt(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-orange-500",children:_.map(E=>n.jsx("option",{value:E.v,children:E.n},E.v))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Año"}),n.jsx("select",{value:x,onChange:E=>m(parseInt(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-orange-500",children:C.map(E=>n.jsx("option",{value:E,children:E},E))})]})]}),n.jsx("input",{type:"file",accept:".txt",ref:u,onChange:y,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-orange-50 text-orange-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-orange-100 shadow-inner",children:a?n.jsx(ot,{className:"animate-spin",size:40}):n.jsx(ko,{size:40})}),n.jsx("button",{onClick:()=>{var E;return(E=u.current)==null?void 0:E.click()},disabled:a,className:"w-full bg-orange-600 hover:bg-orange-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:a?"REALIZANDO CRUCE...":"SUBIR TXT BNC"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(Ea,{size:12})," Auditoría de Integridad BNC"]})]})]}),n.jsx(La,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),t?n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Operaciones en BNC"}),n.jsx("h4",{className:"text-4xl font-black text-slate-900",children:t.summary.total_processed})]}),n.jsxs("div",{className:"bg-emerald-50 p-8 rounded-[3rem] border border-emerald-100 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-4",children:"Coinciden con Sistema"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(zt,{className:"text-emerald-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-emerald-600",children:t.summary.matched})]})]}),n.jsxs("div",{className:"bg-orange-50 p-8 rounded-[3rem] border border-orange-100 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-orange-600 uppercase tracking-widest mb-4",children:"OMISIONES DETECTADAS"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(na,{className:"text-orange-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-orange-600",children:t.summary.unmatched})]})]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar omisión por referencia o descripción...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold outline-none focus:ring-2 focus:ring-orange-500",value:i,onChange:E=>l(E.target.value)})]}),n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>d("TODOS"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="TODOS"?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Todos"}),n.jsx("button",{onClick:()=>d("INGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="INGRESO"?"bg-emerald-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Ingresos"}),n.jsx("button",{onClick:()=>d("EGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="EGRESO"?"bg-orange-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Egresos"})]})]}),n.jsxs("div",{className:"bg-white rounded-[4rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-10 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center bg-slate-50/30 gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-4 bg-orange-600 rounded-2xl text-white shadow-lg",children:n.jsx(Pc,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight uppercase leading-none",children:"Operaciones No Registradas (BNC)"}),n.jsx("p",{className:"text-[10px] font-bold text-orange-500 uppercase tracking-widest mt-2",children:"Acciones pendientes de regularización contable"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const E=["Fecha","Referencia","Descripción","Monto Banco","Monto Sistema","Diferencia"],T=k.map(B=>[B.date,B.ref,B.desc,`$${Number(B.amount).toFixed(2)}`,B.type]);zc("Conciliación Banco vs Banco BNC",E,T)},className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-orange-600 hover:text-white transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(gr,{size:24})}),n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-orange-600 hover:text-white transition-all shadow-sm",children:n.jsx(yt,{size:24})})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Banco"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Concepto Bancario (Glosa)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Nominal (Bs)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estatus"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:k.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"No se detectaron omisiones para estos filtros."})}):k.map((E,T)=>n.jsxs("tr",{className:"hover:bg-slate-50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6 text-slate-500 font-bold text-xs",children:E.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"bg-slate-100 text-slate-800 px-4 py-2 rounded-xl text-xs font-black border border-slate-200 shadow-sm",children:["#",E.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsx("p",{className:"font-black text-slate-700 text-[11px] uppercase leading-tight truncate max-w-[320px]",children:E.desc})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${E.type==="INGRESO"?"text-emerald-600":"text-orange-600"}`,children:[E.type==="INGRESO"?"+":"-"," ",E.amount.toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"px-3 py-1 bg-red-50 text-red-600 rounded-full text-[8px] font-black uppercase tracking-widest border border-red-100 flex items-center justify-center gap-1.5 w-fit mx-auto animate-pulse",children:[n.jsx(sa,{size:10})," FALTANTE"]})})]},T))})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5 p-6 bg-white border border-slate-200 rounded-[2.5rem] shadow-sm",children:[n.jsx(hs,{className:"text-orange-600",size:32}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:"Protocolo de Conciliación BNC"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase italic",children:'Las omisiones detectadas deben ser regularizadas mediante "Registrar Movimiento" o "Reporte de Pago".'})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.4em]",children:"Arquitectura SAC 2026"}),n.jsx("p",{className:"text-[10px] font-black text-orange-600 uppercase",children:"TecnoMath Reconciliation Core BNC"})]})]})]})]}):n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx("div",{className:"w-24 h-24 bg-slate-50 rounded-[2rem] flex items-center justify-center mx-auto mb-6 shadow-inner",children:n.jsx(Xt,{size:48,className:"text-slate-200"})}),n.jsx("h3",{className:"text-xl font-black text-slate-400 uppercase tracking-widest",children:"Protocolo de Conciliación Listo"}),n.jsx("p",{className:"text-slate-300 text-sm mt-2 font-medium",children:"Suba el TXT del BNC para identificar operaciones faltantes en SAC 2026."})]})]})},YEe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!0),[i,l]=j.useState(""),[o,d]=j.useState(""),[u,f]=j.useState(!1),[p,x]=j.useState({amount:"",currency:"USD",reference:"",date:Er(),months:"1"}),m=async()=>{s(!0);try{const y=await(await fetch(`${ye}/get_license_status.php`)).json();r(y),l(y.expiration_date),d(y.monthly_rate)}catch(v){console.error(v)}finally{s(!1)}};j.useEffect(()=>{m()},[]);const b=async(v,y)=>{if(confirm(`¿Ejecutar acción: ${v.toUpperCase()}?`)){f(!0);try{(await fetch(`${ye}/update_license.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:v,...y})})).ok&&(alert("Motor de Licencias Actualizado."),m(),v==="add_payment"&&x({amount:"",currency:"USD",reference:"",date:Er(),months:"1"}))}catch{alert("Error de conexión")}finally{f(!1)}}};return e.role!=="programmer"?n.jsxs("div",{className:"p-10 text-center",children:[n.jsx(hs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h2",{className:"text-2xl font-black text-slate-800",children:"ACCESO RESTRINGIDO AL NÚCLEO"}),n.jsx("p",{className:"text-slate-400 mt-2",children:"Esta sección es de uso exclusivo del Arquitecto de Sistemas de TecnoMath."})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-500/20 w-fit px-4 py-1.5 rounded-full border border-blue-500/30 flex items-center gap-2 mb-6",children:[n.jsx(Rd,{size:16,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-400",children:"Master License Control (SaaS)"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Gestión de ",n.jsx("span",{className:"text-blue-500 italic",children:"Suscripción"})]}),n.jsx("p",{className:"text-slate-400 mt-4 text-lg font-medium italic",children:"Control de accesos y recaudación de renta TecnoMath."})]}),n.jsx(ok,{size:200,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-8",children:[n.jsx("div",{className:"xl:col-span-2 space-y-8",children:n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-8",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Estatus del Arrendatario"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-[10px] tracking-widest",children:(t==null?void 0:t.customer)||"Cargando..."})]}),n.jsx("div",{className:`px-6 py-2 rounded-full font-black text-xs uppercase tracking-widest ${(t==null?void 0:t.status)==="active"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100 animate-pulse"}`,children:(t==null?void 0:t.status)==="active"?"SISTEMA OPERATIVO":"SISTEMA BLOQUEADO"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:"Próxima Expiración"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Lr,{className:"text-blue-600",size:24}),n.jsx("span",{className:"text-2xl font-black text-slate-800",children:t==null?void 0:t.expiration_date})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:"Canon Mensual Actual"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(wn,{className:"text-emerald-600",size:24}),n.jsxs("span",{className:"text-2xl font-black text-slate-800",children:["$",parseFloat((t==null?void 0:t.monthly_rate)||0).toFixed(2)]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:"Recaudación Total"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx($i,{className:"text-blue-500",size:24}),n.jsxs("span",{className:"text-2xl font-black text-slate-800",children:["$",parseFloat((t==null?void 0:t.total_paid)||0).toFixed(2)]})]})]})]}),n.jsxs("div",{className:"bg-amber-50 p-8 rounded-[2.5rem] border border-amber-100 space-y-6",children:[n.jsx("div",{className:"flex justify-between items-center",children:n.jsxs("h4",{className:"font-black text-amber-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(ob,{size:18})," Ajuste de Tarifa SaaS"]})}),n.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-end",children:[n.jsxs("div",{className:"flex-1 w-full",children:[n.jsx("label",{className:"text-[9px] font-black text-amber-600 uppercase ml-1 block mb-1",children:"Monto de Renta Mensual (USD)"}),n.jsxs("div",{className:"relative",children:[n.jsx(wn,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-amber-400",size:18}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-amber-200 rounded-xl pl-12 pr-4 py-3 font-black text-slate-800 outline-none focus:ring-2 focus:ring-amber-500",value:o,onChange:v=>d(v.target.value),placeholder:"0.00"})]})]}),n.jsxs("button",{disabled:u||!o,onClick:()=>b("update_rate",{rate:parseFloat(o)}),className:"w-full md:w-auto bg-amber-600 hover:bg-amber-700 text-white px-8 py-3.5 rounded-xl font-black text-xs uppercase tracking-widest shadow-lg active:scale-95 transition-all flex items-center justify-center gap-2",children:[u?n.jsx(ot,{className:"animate-spin",size:14}):n.jsx(qn,{size:14})," ACTUALIZAR CANON"]})]})]}),n.jsxs("div",{className:"bg-blue-50 p-8 rounded-[2.5rem] border border-blue-100 space-y-6",children:[n.jsxs("h4",{className:"font-black text-blue-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(_p,{size:18})," Registrar Pago de Renta"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Monto Pagado"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500",value:p.amount,onChange:v=>x({...p,amount:v.target.value}),placeholder:"0.00"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Moneda"}),n.jsxs("select",{className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none",value:p.currency,onChange:v=>x({...p,currency:v.target.value}),children:[n.jsx("option",{value:"USD",children:"Dólares (USD)"}),n.jsx("option",{value:"VES",children:"Bolívares (VES)"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Meses a Extender"}),n.jsx("select",{className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none",value:p.months,onChange:v=>x({...p,months:v.target.value}),children:[1,2,3,4,5,6,12].map(v=>n.jsxs("option",{value:v,children:[v," Mes",v>1?"es":""]},v))})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Referencia / Observación"}),n.jsx("input",{className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 uppercase",value:p.reference,onChange:v=>x({...p,reference:v.target.value}),placeholder:"VOUCHER - BANCO - CASH"})]}),n.jsx("div",{className:"flex items-end",children:n.jsxs("button",{disabled:u||!p.amount||!p.reference,onClick:()=>b("add_payment",{amount:parseFloat(p.amount),currency:p.currency,reference:p.reference,payment_date:p.date,months_extended:parseInt(p.months)}),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-3.5 rounded-xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 flex items-center justify-center gap-2 active:scale-95 disabled:opacity-50",children:[u?n.jsx(ot,{className:"animate-spin",size:14}):n.jsx(Cn,{size:14})," REGISTRAR Y EXTENDER"]})})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("h4",{className:"font-black text-slate-800 uppercase text-xs tracking-widest flex items-center gap-2 px-1",children:[n.jsx(Ba,{size:18,className:"text-blue-600"})," Historial de Cobranza TecnoMath"]}),n.jsx("div",{className:"bg-slate-50 rounded-3xl border border-slate-100 overflow-hidden",children:n.jsxs("table",{className:"w-full text-left text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-100 border-b border-slate-200",children:[n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Referencia"}),n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Extensión"}),n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-200",children:((t==null?void 0:t.payment_history)||[]).length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:4,className:"px-6 py-10 text-center text-slate-400 italic",children:"No hay registros de renta aún."})}):t.payment_history.map(v=>n.jsxs("tr",{className:"hover:bg-white transition-colors group",children:[n.jsx("td",{className:"px-6 py-4 font-bold text-slate-600",children:v.payment_date}),n.jsx("td",{className:"px-6 py-4",children:n.jsx("span",{className:"font-black text-slate-800 uppercase text-xs",children:v.reference})}),n.jsx("td",{className:"px-6 py-4 text-center",children:n.jsxs("span",{className:"bg-blue-50 text-blue-600 px-3 py-1 rounded-lg text-[10px] font-black uppercase border border-blue-100",children:["+",v.months_extended," M"]})}),n.jsxs("td",{className:"px-6 py-4 text-right font-black text-emerald-600",children:[v.currency==="USD"?"$":"Bs."," ",parseFloat(v.amount).toFixed(2)]})]},v.id))})]})})]})]})}),n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col items-center justify-center text-center space-y-8",children:[n.jsx("div",{className:`w-24 h-24 rounded-[2rem] flex items-center justify-center shadow-2xl transition-all duration-500 ${t!=null&&t.is_manual_block?"bg-red-600 text-white scale-110 shadow-red-200":"bg-slate-100 text-slate-400"}`,children:t!=null&&t.is_manual_block?n.jsx(Rd,{size:48}):n.jsx(NM,{size:48})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight",children:"Manual Kill-Switch"}),n.jsx("p",{className:"text-slate-400 text-sm mt-2 font-medium leading-relaxed",children:"Bloqueo inmediato de la interfaz por incumplimiento administrativo grave."})]}),t!=null&&t.is_manual_block?n.jsx("button",{onClick:()=>b("unblock"),className:"w-full bg-emerald-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest active:scale-95 transition-all shadow-xl shadow-emerald-100",children:"DESBLOQUEAR NÚCLEO"}):n.jsx("button",{onClick:()=>b("block"),className:"w-full bg-slate-900 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest active:scale-95 transition-all shadow-xl shadow-slate-300",children:"BLOQUEAR SISTEMA"}),n.jsxs("div",{className:"flex items-center gap-2 p-4 bg-blue-50 border border-blue-100 rounded-2xl w-full",children:[n.jsx(Ea,{size:20,className:"text-blue-500 shrink-0"}),n.jsx("p",{className:"text-[9px] text-blue-800 font-bold uppercase text-left leading-tight",children:"TecnoMath SaaS Protocol. El bloqueo manual ignora la fecha de expiración cronológica."})]})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-6",children:[n.jsxs("h4",{className:"font-black text-slate-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(sa,{className:"text-amber-500",size:16})," Override de Fecha"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("input",{type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-500",value:i,onChange:v=>l(v.target.value)}),n.jsx("button",{onClick:()=>b("extend",{new_date:i}),disabled:u,className:"w-full bg-slate-100 hover:bg-slate-200 text-slate-600 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all",children:"ACTUALIZAR EXPIRACIÓN SIN PAGO"})]})]})]})]})]})},XEe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState(null),i=j.useRef(null),l=d=>{var p;const u=(p=d.target.files)==null?void 0:p[0];if(!u)return;r(!0);const f=new FileReader;f.onload=async x=>{var m;try{const b=(m=x.target)==null?void 0:m.result,v=o(b);if(v.length===0)throw new Error("El archivo está vacío.");const k=await(await fetch(`${ye}/bulk_load_properties.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rows:v})})).json();s(k)}catch(b){alert("Error: "+b.message)}finally{r(!1),i.current&&(i.current.value="")}},f.readAsText(u)},o=d=>{const u=d.split(/\r?\n/);if(u.length<2)return[];const f=u[0].toLowerCase().split(",").map(x=>x.trim().replace(/"/g,"")),p=[];for(let x=1;x<u.length;x++){if(!u[x].trim())continue;const m=u[x].split(",").map(v=>v.trim().replace(/"/g,"")),b={};f.forEach((v,y)=>{b[v]=m[y]}),p.push(b)}return p};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsx("div",{className:"bg-white p-10 lg:p-14 rounded-[4rem] border border-slate-200 shadow-sm relative overflow-hidden",children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex-1 space-y-4",children:[n.jsxs("div",{className:"bg-emerald-50 w-fit px-4 py-1.5 rounded-full border border-emerald-100 flex items-center gap-2",children:[n.jsx(gl,{size:14,className:"text-emerald-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-emerald-600",children:"Nuclear Data Import"})]}),n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter",children:["Carga Excel ",n.jsx("span",{className:"text-emerald-600 italic",children:"Propiedades"})]}),n.jsx("p",{className:"text-slate-500 font-medium max-w-lg",children:"Sincronización masiva de unidades, alícuotas y saldos migrados."})]}),n.jsxs("div",{className:"bg-slate-50 p-10 rounded-[3rem] border border-slate-200 flex flex-col items-center w-full lg:w-80 text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-white rounded-2xl flex items-center justify-center shadow-sm mb-6",children:n.jsx(OA,{size:32,className:t?"animate-bounce text-emerald-500":"text-slate-300"})}),n.jsx("input",{type:"file",accept:".csv",className:"hidden",ref:i,onChange:l}),n.jsx("button",{disabled:t,onClick:()=>{var d;return(d=i.current)==null?void 0:d.click()},className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all disabled:opacity-50",children:t?"PROCESANDO...":"CARGAR CSV PROPIEDADES"})]})]})}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-800 mb-8 flex items-center gap-3",children:[n.jsx(yl,{className:"text-blue-600"})," Guía de Estructura Excel"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed italic",children:"Columnas requeridas en minúsculas (Fila 1):"}),n.jsx("div",{className:"bg-slate-50 rounded-3xl p-6 border border-slate-100 overflow-x-auto",children:n.jsxs("table",{className:"w-full text-[10px] font-black uppercase text-slate-500 tracking-tighter",children:[n.jsx("thead",{className:"border-b border-slate-200",children:n.jsxs("tr",{children:[n.jsx("th",{className:"py-2 text-left pr-4",children:"Columna"}),n.jsx("th",{className:"py-2 text-left",children:"Ejemplo"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-100",children:[n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"codigo"}),n.jsx("td",{children:"PH-101"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"tipo"}),n.jsx("td",{children:"Casa / Apartamento"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"numero"}),n.jsx("td",{children:"101"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"alicuota"}),n.jsx("td",{children:"1.2500"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"es_gnc"}),n.jsx("td",{children:"1 (Sí) / 0 (No)"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"deuda_inicial"}),n.jsx("td",{children:"0.00"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"saldo_favor"}),n.jsx("td",{children:"0.00"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"estatus"}),n.jsx("td",{children:"Ocupada / Vacía"})]})]})]})}),n.jsxs("div",{className:"p-4 bg-blue-50 border border-blue-100 rounded-2xl flex items-start gap-3",children:[n.jsx(Nn,{size:16,className:"text-blue-600 shrink-0 mt-0.5"}),n.jsx("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-tight",children:"Al terminar el Excel, seleccione: 'Guardar como' -> 'CSV (delimitado por comas)'."})]})]})]}),n.jsx("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col justify-center items-center text-center",children:a?n.jsxs("div",{className:"animate-in zoom-in duration-300 space-y-6",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-full flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Wi,{size:40})}),n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Sincronización Exitosa"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Nuevos"}),n.jsx("p",{className:"text-3xl font-black text-emerald-600",children:a.inserted})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Actualizados"}),n.jsx("p",{className:"text-3xl font-black text-blue-600",children:a.updated})]})]})]}):n.jsxs("div",{className:"opacity-20 flex flex-col items-center",children:[n.jsx(ot,{size:80,className:"mb-6"}),n.jsx("p",{className:"font-black text-sm uppercase tracking-widest",children:"Esperando archivo..."})]})})]})]})},JEe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState(null),i=j.useRef(null),l=d=>{var p;const u=(p=d.target.files)==null?void 0:p[0];if(!u)return;r(!0);const f=new FileReader;f.onload=async x=>{var m;try{const b=(m=x.target)==null?void 0:m.result,v=o(b);if(v.length===0)throw new Error("Archivo inválido.");const k=await(await fetch(`${ye}/bulk_load_users.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rows:v})})).json();s(k)}catch(b){alert("Error: "+b.message)}finally{r(!1),i.current&&(i.current.value="")}},f.readAsText(u)},o=d=>{const u=d.split(/\r?\n/);if(u.length<2)return[];const f=u[0].toLowerCase().split(",").map(x=>x.trim().replace(/"/g,"")),p=[];for(let x=1;x<u.length;x++){if(!u[x].trim())continue;const m=u[x].split(",").map(v=>v.trim().replace(/"/g,"")),b={};f.forEach((v,y)=>{b[v]=m[y]}),p.push(b)}return p};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsx("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600",children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex-1 space-y-4",children:[n.jsxs("div",{className:"bg-blue-600/20 w-fit px-4 py-1.5 rounded-full border border-blue-600/30 flex items-center gap-2",children:[n.jsx(jA,{size:14,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-400",children:"Security Mass Control"})]}),n.jsxs("h1",{className:"text-4xl font-black tracking-tighter",children:["Carga Excel ",n.jsx("span",{className:"text-blue-500 italic",children:"Usuarios"})]}),n.jsx("p",{className:"text-slate-400 font-medium max-w-lg",children:"Creación masiva de credenciales y perfiles de propietarios."})]}),n.jsxs("div",{className:"bg-white/5 p-10 rounded-[3rem] border border-white/10 flex flex-col items-center w-full lg:w-80 text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-white/10 rounded-2xl flex items-center justify-center mb-6",children:n.jsx(OA,{size:32,className:t?"animate-bounce text-blue-400":"text-slate-500"})}),n.jsx("input",{type:"file",accept:".csv",className:"hidden",ref:i,onChange:l}),n.jsx("button",{disabled:t,onClick:()=>{var d;return(d=i.current)==null?void 0:d.click()},className:"w-full bg-blue-600 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all disabled:opacity-50",children:t?"HASHEANDO...":"CARGAR CSV USUARIOS"})]})]})}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-800 mb-8 flex items-center gap-3",children:[n.jsx(yl,{className:"text-indigo-600"})," Estructura Excel Usuarios"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed italic",children:"Columnas obligatorias (Minúsculas):"}),n.jsx("div",{className:"bg-slate-50 rounded-3xl p-6 border border-slate-100 overflow-x-auto",children:n.jsxs("table",{className:"w-full text-[10px] font-black uppercase text-slate-500 tracking-tighter",children:[n.jsx("thead",{className:"border-b border-slate-200",children:n.jsxs("tr",{children:[n.jsx("th",{className:"py-2 text-left pr-4",children:"Columna"}),n.jsx("th",{className:"py-2 text-left",children:"Valor Esperado"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-100",children:[n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"cedula"}),n.jsx("td",{children:"V12345678"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"nombre_completo"}),n.jsx("td",{children:"JUAN PEREZ"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"correo"}),n.jsx("td",{children:"juan@gmail.com"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"telefono"}),n.jsx("td",{children:"04121234567"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"rol"}),n.jsx("td",{children:"owner / resident"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600 font-black",children:"telegram_id"}),n.jsx("td",{children:"123456789 (Opcional)"})]})]})]})}),n.jsxs("div",{className:"p-5 bg-amber-50 border border-amber-100 rounded-2xl flex items-start gap-3",children:[n.jsx(jA,{size:18,className:"text-amber-600 shrink-0 mt-0.5"}),n.jsx("p",{className:"text-[10px] text-amber-800 font-bold uppercase leading-tight",children:"La cédula se asignará como contraseña inicial. Si incluye el telegram_id, se habilitará el botón de inmediato."})]})]})]}),n.jsx("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col justify-center items-center text-center",children:a?n.jsxs("div",{className:"animate-in zoom-in duration-300 space-y-6",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-full flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Wi,{size:40})}),n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Usuarios Listos"}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Total Procesados"}),n.jsx("p",{className:"text-5xl font-black text-blue-600 mt-2",children:a.total})]})]}):n.jsxs("div",{className:"opacity-20 flex flex-col items-center",children:[n.jsx(gl,{size:80,className:"mb-6"}),n.jsx("p",{className:"font-black text-sm uppercase tracking-widest",children:"Sincronización Masiva"})]})})]})]})},ZEe=({user:e})=>{const{exchangeRateHistory:t}=ht(),[r,a]=j.useState(new Date().getMonth()),[s,i]=j.useState(new Date().getFullYear()),[l,o]=j.useState(!1),[d,u]=j.useState([]),[f,p]=j.useState(10),x=()=>{if(!t||t.length===0)return 45.5;const E=t[0];return Number(E.pmValue)>0?Number(E.pmValue):Number(E.amValue)},[m,b]=j.useState(x()),v=async()=>{o(!0);try{const T=await(await fetch(`${ye}/get_prefill_expenses.php?month=${r}&year=${s}`,{credentials:"include"})).json();Array.isArray(T)&&u(T.map((B,I)=>({...B,included:!0,id:`sim-${I}`})))}catch(E){console.error("Error al simular:",E)}finally{o(!1)}},y=E=>{u(T=>T.map(B=>B.id===E?{...B,included:!B.included}:B))},k=()=>{const E=d.filter(U=>U.included),T=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simulación de Cuota - ${Ue[r]} ${s}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=JetBrains+Mono:wght@400;700&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.5; background: #f8fafc; }
        .container { max-width: 800px; margin: 0 auto; background: white; padding: 40px; border-radius: 24px; shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 40px; border-bottom: 4px solid #2563eb; padding-bottom: 20px; }
        .header h1 { margin: 0; color: #0f172a; font-size: 28px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; }
        .header p { margin: 5px 0; color: #64748b; font-size: 14px; font-weight: 700; }
        .badge { background: #2563eb; color: white; padding: 4px 12px; rounded: 20px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; display: inline-block; margin-bottom: 10px; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
        th { background: #f1f5f9; text-align: left; padding: 12px; border-bottom: 2px solid #e2e8f0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 900; color: #475569; }
        td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
        .category { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; background: #eff6ff; padding: 2px 8px; border-radius: 4px; }
        .amount { font-family: 'JetBrains Mono', monospace; text-align: right; font-weight: 700; }
        .totals { background: #0f172a; padding: 30px; border-radius: 20px; margin-top: 20px; color: white; }
        .total-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 700; font-size: 14px; }
        .grand-total { font-size: 24px; color: #60a5fa; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; margin-top: 15px; font-weight: 900; }
        .footer { margin-top: 50px; text-align: center; font-size: 10px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="badge">Simulación SAC 2026</div>
            <h1>Simulación de Cuota Mensual</h1>
            <p>${Ra}</p>
            <p>Periodo: ${Ue[r]} ${s}</p>
            <p>Tasa de Cambio: ${m.toFixed(2)} Bs/$</p>
        </div>
        <table>
            <thead>
                <tr>
                    <th>Descripción</th>
                    <th>Categoría</th>
                    <th style="text-align: right">Monto ($)</th>
                </tr>
            </thead>
            <tbody>
                ${E.map(U=>`
                    <tr>
                        <td style="font-weight: 700">${U.description}</td>
                        <td><span class="category">${U.category}</span></td>
                        <td class="amount">$${U.amountUsd.toFixed(2)}</td>
                    </tr>
                `).join("")}
            </tbody>
        </table>
        <div class="totals">
            <div class="total-row" style="color: #94a3b8"><span>Subtotal Gastos:</span> <span>$${C.subtotal.toFixed(2)}</span></div>
            <div class="total-row" style="color: #94a3b8"><span>Fondo de Reserva (${f}%):</span> <span>$${C.reserve.toFixed(2)}</span></div>
            <div class="total-row grand-total"><span>TOTAL PROYECTADO:</span> <span>$${C.totalUsd.toFixed(2)}</span></div>
            <div class="total-row" style="color: #60a5fa; font-size: 16px; margin-top: 10px;"><span>Equivalente en Bolívares:</span> <span>Bs. ${C.totalBs.toLocaleString("es-VE",{minimumFractionDigits:2})}</span></div>
        </div>
        <div class="footer">
            <p>Generado por SAC 2026 - ${Ps}</p>
            <p>Este documento es una simulación informativa no vinculante.</p>
        </div>
    </div>
</body>
</html>`,B=new Blob([T],{type:"text/html"}),I=URL.createObjectURL(B),M=document.createElement("a");M.href=I,M.download=`Simulacion_${Ue[r]}_${s}.html`,document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(I)},_=async()=>{const E=`Simulación de Cuota ${Ue[r]} ${s} - ${Ra}
Total Proyectado: $${C.totalUsd.toFixed(2)} (Bs. ${C.totalBs.toLocaleString("es-VE",{minimumFractionDigits:2})})`;if(navigator.share)try{await navigator.share({title:"Simulación de Cuota",text:E,url:window.location.href})}catch(T){console.log("Share failed",T)}else try{await navigator.clipboard.writeText(E)}catch(T){console.error("Clipboard failed",T)}},C=j.useMemo(()=>{const E=d.filter(R=>R.included),T=E.filter(R=>R.category==="fixed").reduce((R,Q)=>R+Q.amountUsd,0),B=E.filter(R=>R.category==="variable").reduce((R,Q)=>R+Q.amountUsd,0),I=E.filter(R=>R.category==="other").reduce((R,Q)=>R+Q.amountUsd,0),M=T+B+I,U=M*(f/100),D=M+U,L=D*m;return{subFixed:T,subVariable:B,subOther:I,subtotal:M,reserve:U,totalUsd:D,totalBs:L}},[d,f,m]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(sa,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Ambiente de Simulación SAC 2026"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Pre-fill ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Simulador Mensual"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Proyecte la cuota del mes seleccionando egresos específicos. Cálculo dinámico no persistente."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsxs("div",{className:"w-full grid grid-cols-2 gap-3 mb-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Periodo"}),n.jsx("select",{value:r,onChange:E=>a(Number(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-2 font-black text-slate-800 text-xs",children:Ue.map((E,T)=>n.jsx("option",{value:T,children:E},T))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Año"}),n.jsx("input",{type:"number",value:s,onChange:E=>i(Number(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-2 font-black text-slate-800 text-xs"})]})]}),n.jsxs("button",{onClick:v,disabled:l,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-black py-5 rounded-2xl shadow-xl shadow-blue-500/20 transition-all flex items-center justify-center gap-3 text-xs uppercase tracking-widest active:scale-95 disabled:opacity-50",children:[l?n.jsx(ot,{className:"animate-spin",size:18}):n.jsx($f,{size:18}),l?"ANALIZANDO EGRESOS...":"SIMULAR ESCENARIO"]})]})]}),n.jsx(ha,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),d.length===0&&!l?n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border border-dashed border-slate-200",children:[n.jsx(sa,{size:48,className:"mx-auto mb-4 text-slate-200 opacity-20"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"Seleccione un periodo y ejecute la simulación."})]}):n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[n.jsx("div",{className:"lg:col-span-2 space-y-12 animate-in slide-in-from-bottom duration-700",children:n.jsxs("div",{className:"bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-900 uppercase tracking-tighter mb-8 flex items-center gap-3",children:[n.jsx(Pc,{className:"text-blue-600",size:24})," Estructura de Gastos del Periodo"]}),n.jsxs("div",{className:"mb-12",children:[n.jsxs("div",{className:"flex justify-between items-center border-b-2 border-slate-50 pb-3 mb-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"Gastos Fijos Proyectados"}),n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",C.subFixed.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="fixed").map(E=>n.jsx(O2,{item:E,onToggle:()=>y(E.id)},E.id)),d.filter(E=>E.category==="fixed").length===0&&n.jsx("p",{className:"text-xs italic text-slate-300",children:"No hay egresos fijos para este mes."})]})]}),n.jsxs("div",{className:"mb-12",children:[n.jsxs("div",{className:"flex justify-between items-center border-b-2 border-slate-50 pb-3 mb-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"Gastos Variables Proyectados"}),n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",C.subVariable.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="variable").map(E=>n.jsx(O2,{item:E,onToggle:()=>y(E.id)},E.id)),d.filter(E=>E.category==="variable").length===0&&n.jsx("p",{className:"text-xs italic text-slate-300",children:"No hay egresos variables para este mes."})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex justify-between items-center border-b-2 border-slate-50 pb-3 mb-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"Otros Gastos Proyectados"}),n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",C.subOther.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="other").map(E=>n.jsx(O2,{item:E,onToggle:()=>y(E.id)},E.id)),d.filter(E=>E.category==="other").length===0&&n.jsx("p",{className:"text-xs italic text-slate-300",children:"No hay otros egresos para este mes."})]})]})]})}),n.jsx("div",{className:"space-y-8 animate-in slide-in-from-right duration-700",children:n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-xl sticky top-24",children:[n.jsxs("h3",{className:"text-2xl font-black text-slate-900 tracking-tight mb-8 flex items-center gap-3",children:[n.jsx(mi,{className:"text-blue-600"})," Resultados Proyectados"]}),n.jsxs("div",{className:"flex items-center gap-2 mb-8 no-print",children:[n.jsxs("button",{onClick:k,className:"flex-1 bg-slate-100 hover:bg-slate-200 text-slate-600 p-3 rounded-xl transition-all flex items-center justify-center gap-2 group",title:"Exportar a HTML",children:[n.jsx(Jd,{size:16,className:"group-hover:scale-110 transition-transform"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"HTML"})]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 bg-slate-100 hover:bg-slate-200 text-slate-600 p-3 rounded-xl transition-all flex items-center justify-center gap-2 group",title:"Imprimir",children:[n.jsx(yt,{size:16,className:"group-hover:scale-110 transition-transform"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Imprimir"})]}),n.jsxs("button",{onClick:_,className:"flex-1 bg-slate-100 hover:bg-slate-200 text-slate-600 p-3 rounded-xl transition-all flex items-center justify-center gap-2 group",title:"Compartir",children:[n.jsx(_a,{size:16,className:"group-hover:scale-110 transition-transform"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Compartir"})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center py-4 border-b border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Subtotal Gastos ($)"}),n.jsxs("span",{className:"text-xl font-black text-slate-800 tracking-tighter",children:["$",C.subtotal.toLocaleString(void 0,{minimumFractionDigits:2})]})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("label",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest",children:"Fondo Reserva (%)"}),n.jsx("input",{type:"number",className:"w-16 bg-slate-50 border border-slate-200 rounded-lg px-2 py-1 text-right font-black text-blue-600 text-xs",value:f,onChange:E=>p(Number(E.target.value))})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[9px] font-bold text-slate-400 uppercase",children:"Impacto Reserva ($)"}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:["+$",C.reserve.toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-8 text-white relative overflow-hidden shadow-2xl",children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-blue-400 tracking-[0.3em] mb-4 relative z-10 text-center",children:"GRAN TOTAL PROYECTADO"}),n.jsxs("div",{className:"flex justify-center items-start gap-1 relative z-10",children:[n.jsx("span",{className:"text-2xl font-black mt-2 text-blue-400",children:"$"}),n.jsx("h4",{className:"text-6xl font-black tracking-tighter",children:C.totalUsd.toLocaleString(void 0,{minimumFractionDigits:2})})]}),n.jsxs("div",{className:"mt-8 pt-6 border-t border-white/10 flex justify-between items-center relative z-10",children:[n.jsxs("div",{children:[n.jsxs("span",{className:"text-[9px] font-black uppercase text-slate-500 block",children:["Equiv. VES (@",m.toFixed(2),")"]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight",children:["Bs. ",C.totalBs.toLocaleString("es-VE",{minimumFractionDigits:2})]})]}),n.jsx($i,{className:"text-blue-500/20",size:40})]}),n.jsx(La,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-[2rem] flex items-start gap-4",children:[n.jsx(Nn,{className:"text-blue-600 shrink-0 mt-0.5",size:20}),n.jsx("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-relaxed tracking-tight",children:'Esta simulación es local. Para confirmar estos gastos, deberá cargarlos formalmente en el módulo "Generar Cuotas".'})]})]})]})})]})]})},O2=({item:e,onToggle:t})=>n.jsxs("div",{onClick:t,className:`p-5 rounded-[1.8rem] border transition-all cursor-pointer flex items-center justify-between group ${e.included?"bg-white border-blue-200 shadow-md scale-[1.02]":"bg-slate-50 border-slate-100 opacity-40 hover:opacity-70"}`,children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center transition-all ${e.included?"bg-blue-600 text-white":"bg-slate-200 text-slate-400"}`,children:e.included?n.jsx(zt,{size:18}):n.jsx(vM,{size:18})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-xs uppercase leading-none truncate max-w-[180px]",children:e.description}),n.jsx("p",{className:"text-[8px] font-bold text-slate-400 uppercase mt-1 tracking-widest",children:e.category})]})]}),n.jsx("div",{className:"text-right",children:n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",e.amountUsd.toFixed(2)]})})]}),eSe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=ht(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState(null),[b,v]=j.useState("selection"),[y,k]=j.useState(null),[_,C]=j.useState({});j.useEffect(()=>{(async()=>{try{const G=await we.getSystemSettings();C(G||{})}catch(G){console.error("Error fetching settings",G)}})()},[]);const E=j.useMemo(()=>t.find(Q=>Q.month===d&&Q.year===f),[t,d,f]),T=j.useMemo(()=>r.find(Q=>Q.id===x),[r,x]),B=j.useMemo(()=>{if(!T)return null;const Q=a.find(K=>K.propertyId===T.id&&K.isOwner),G=s.find(K=>K.cedula===(Q==null?void 0:Q.cedula));return{fullName:(Q==null?void 0:Q.fullName)||"Propietario",email:(G==null?void 0:G.email)||"",phone:(Q==null?void 0:Q.phone)||(G==null?void 0:G.phone)||"",telegramId:(G==null?void 0:G.telegramChatId)||"",propertyCode:T.code,propertyId:T.id,role:"owner"}},[T,a,s]),I=Q=>Number(Q).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),M=Q=>Number(Q).toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2}),U=Q=>{if(!Q)return"";let G=Q.trim();return G.startsWith("+")?G.replace(/\D/g,""):G.startsWith("0")?"58"+G.substring(1).replace(/\D/g,""):G.length===10?"58"+G.replace(/\D/g,""):G.replace(/\D/g,"")},D=async()=>{if(!(B!=null&&B.email)||!E)return alert("Datos insuficientes.");k("email");const Q=E.debts.find(W=>W.propertyId===x),G=Q?(Number(Q.amountUsd)-Number(Q.paidAmount)).toFixed(2):"0.00",K={channel:"email",messageType:"fee",subject:`Aviso de Cobro SAC 2026 - ${Ue[d]}`,recipients:[{name:B.fullName,email:B.email,amount:G,status:(Q==null?void 0:Q.status)||"Pendiente",propName:`${T==null?void 0:T.type} ${T==null?void 0:T.number}`}],monthName:Ue[d],year:f};try{const z=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();z.status==="success"?(await l(E.id,x,"email"),alert("¡Éxito! Email entregado.")):alert("Error: "+z.message)}catch{alert("Fallo de red.")}finally{k(null)}},L=async()=>{if(!(B!=null&&B.telegramId)||!E)return alert("Datos insuficientes.");k("telegram");const Q=E.debts.find(W=>W.propertyId===x),G=Q?(Number(Q.amountUsd)-Number(Q.paidAmount)).toFixed(2):"0.00",K={channel:"telegram",messageType:"fee",recipients:[{name:B.fullName,telegramChatId:B.telegramId,amount:G,status:(Q==null?void 0:Q.status)||"Pendiente",propName:`${T==null?void 0:T.type} ${T==null?void 0:T.number}`}],monthName:Ue[d],year:f};try{const z=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();z.status==="success"?(await l(E.id,x,"telegram"),alert("¡Éxito! Telegram enviado.")):alert("Error: "+z.message)}catch{alert("Fallo de red.")}finally{k(null)}},R=()=>{if(!T||!B||!E)return;const Q=E.debts.find(ne=>ne.propertyId===x),G=Number(T.aliquot)||0,K=!!T.hasUncommonExpense,W=r.filter(ne=>ne.hasUncommonExpense).length,z=ne=>{var pe,be;const le=Number(ne.amountUsd)||0;let ge=0,X="";if(ne.isSpecial){const me=((pe=ne.specialPropertyIds)==null?void 0:pe.length)||1,_e=(be=ne.specialPropertyIds)==null?void 0:be.includes(x);ge=_e?le/me:0,X=_e?`ESP (1/${me})`:"Exento"}else ne.isUncommon?(ge=K&&W>0?le/W:0,X=K&&W>0?`GNC (1/${W})`:"Exento"):(ge=le*(G/100),X=`ALIQ (${G.toFixed(4)}%)`);return{...ne,global:le,myPortion:ge,basisDesc:X}},Z=[{title:"Gastos Fijos",items:E.fixedExpenses.map(z)},{title:"Gastos Variables",items:E.variableExpenses.map(z)},{title:"Otros Gastos",items:E.otherExpenses.map(z)}],Y=Z.reduce((ne,le)=>ne+le.items.reduce((ge,X)=>ge+X.myPortion,0),0);Z.reduce((ne,le)=>ne+le.items.reduce((ge,X)=>ge+X.global,0),0);const te=Number(E.reserveFundPercent)||10,O=Y*(te/100),P=Y+O,q=Q?(Number(Q.amountUsd)-Number(Q.paidAmount)).toFixed(2):P.toFixed(2),H=ne=>ne.map(le=>`
                <tr>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-transform: uppercase;">${le.description}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 10px; text-align: center; color: #64748b;">${le.basisDesc}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right;">$ ${I(le.global)}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; font-weight: 700; background: #f8fafc;">$ ${I(le.myPortion)}</td>
                </tr>
            `).join(""),J=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Aviso de Cobro - ${T.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 20px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 900px; margin: 0 auto; background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border: 1px solid #e2e8f0; }
        .header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; border-bottom: 2px solid #f1f5f9; padding-bottom: 20px; }
        .logo-area { text-align: left; }
        .logo-title { font-size: 28px; font-weight: 900; color: #0f172a; letter-spacing: -1px; }
        .logo-subtitle { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; letter-spacing: 2px; }
        .property-info { text-align: right; }
        .prop-label { font-size: 9px; font-weight: 900; color: #64748b; text-transform: uppercase; }
        .prop-value { font-size: 14px; font-weight: 700; color: #1e293b; }
        .section-title { font-size: 12px; font-weight: 900; text-transform: uppercase; color: #0f172a; background: #f1f5f9; padding: 8px 15px; border-radius: 8px; margin: 20px 0 10px 0; display: flex; align-items: center; gap: 10px; }
        .section-title::before { content: ""; display: block; width: 4px; height: 12px; background: #2563eb; border-radius: 2px; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
        th { font-size: 9px; font-weight: 900; color: #64748b; text-transform: uppercase; text-align: left; padding: 8px; border-bottom: 2px solid #f1f5f9; }
        .summary-box { background: #0f172a; color: white; padding: 30px; border-radius: 20px; margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
        .total-label { font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
        .total-value { font-size: 36px; font-weight: 900; color: #60a5fa; letter-spacing: -1px; }
        .ves-value { font-size: 18px; font-weight: 700; color: #cbd5e1; }
        .payment-info { margin-top: 30px; display: grid; grid-cols: 2; gap: 20px; border-top: 1px solid #f1f5f9; padding-top: 20px; }
        .payment-column { font-size: 11px; line-height: 1.5; }
        .payment-title { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 8px; }
        .footer { text-align: center; font-size: 9px; color: #94a3b8; margin-top: 40px; border-top: 1px solid #f1f5f9; padding-top: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
        @media print {
            body { background: white; padding: 0; }
            .container { box-shadow: none; border: none; padding: 0; }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logo-area">
                <div class="logo-title">SAC <span style="color: #2563eb;">2026</span></div>
                <div class="logo-subtitle">${Ra}</div>
                <div style="font-size: 12px; font-weight: 700; color: #64748b; margin-top: 5px;">AVISO DE COBRO INDIVIDUAL</div>
            </div>
            <div class="property-info">
                <div style="margin-bottom: 10px;">
                    <div class="prop-label">Propietario</div>
                    <div class="prop-value">${B.fullName}</div>
                </div>
                <div>
                    <div class="prop-label">Unidad / Alícuota</div>
                    <div class="prop-value">${T.code} (${T.type} ${T.number}) / ${G.toFixed(4)}%</div>
                </div>
            </div>
        </div>

        <div style="display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 11px; font-weight: 700; color: #64748b;">
            <div>PERIODO: ${Ue[d].toUpperCase()} ${f}</div>
            <div>TASA: Bs. ${o.toFixed(2)}</div>
        </div>

        ${Z.map(ne=>ne.items.length>0?`
            <div class="section-title">${ne.title}</div>
            <table>
                <thead>
                    <tr>
                        <th style="width: 50%;">Concepto</th>
                        <th style="text-align: center;">Base</th>
                        <th style="text-align: right;">Global ($)</th>
                        <th style="text-align: right; background: #f8fafc;">Su Cuota ($)</th>
                    </tr>
                </thead>
                <tbody>
                    ${H(ne.items)}
                </tbody>
            </table>
        `:"").join("")}

        <div class="summary-box">
            <div>
                <div style="margin-bottom: 15px;">
                    <div class="total-label">Subtotal Gastos</div>
                    <div style="font-size: 18px; font-weight: 700;">$ ${I(Y)}</div>
                </div>
                <div>
                    <div class="total-label">Fondo Reserva (${te}%)</div>
                    <div style="font-size: 18px; font-weight: 700;">$ ${I(O)}</div>
                </div>
            </div>
            <div style="text-align: right; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 20px;">
                <div class="total-label">Total a Pagar</div>
                <div class="total-value">$ ${q}</div>
                <div class="ves-value">Bs. ${M(Number(q)*o)}</div>
            </div>
        </div>

        <div class="payment-info" style="display: flex; justify-content: space-between;">
            <div class="payment-column">
                <div class="payment-title">Datos para el Pago</div>
                <div style="font-weight: 700;">${_.payment_bank_name||"BanPlus"} ${_.payment_account_type||"Cta Cte"}</div>
                <div style="font-weight: 900; color: #2563eb;"># ${_.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                <div>RIF: ${_.payment_rif||"J-313266507"}</div>
                <div>Pago Móvil: ${_.payment_mobile_phone||"0424-4910040"}</div>
            </div>
            <div class="payment-column" style="text-align: right;">
                <div class="payment-title">Reportar Pago</div>
                <div>Enviar comprobante a:</div>
                <div style="font-weight: 700;">${_.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com"}</div>
                <div style="font-weight: 700;">WhatsApp: ${_.payment_whatsapp||"0412-8213310"}</div>
                <div style="font-size: 9px; color: #f59e0b; font-weight: 900; margin-top: 5px;">INDICAR #CASA Y NOMBRE PARA IDENTIFICAR</div>
            </div>
        </div>

        <div style="margin-top: 30px; font-size: 11px; color: #64748b; line-height: 1.6; font-style: italic; text-align: center;">
            Este documento es una relación detallada de sus compromisos para con la comunidad. 
            El pago oportuno garantiza la continuidad de los servicios y el mantenimiento de nuestro patrimonio común.
        </div>

        <div class="footer">
            SISTEMA ADMINISTRATIVO PARA CONDOMINIOS SAC 2026 • Kernel V4.1.85 MC/MB • ${T.code} • ${B.fullName} • GENERADO EL ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,ae=new Blob([J],{type:"text/html"}),oe=URL.createObjectURL(ae),ce=document.createElement("a");ce.href=oe,ce.download=`Cuota_${T.code}_${Ue[d]}.html`,ce.click(),URL.revokeObjectURL(oe)};if(b==="breakdown"&&E&&T&&B){const Q=async ce=>{{if(navigator.share)try{await navigator.share({title:`Aviso de Cobro - ${T.code}`,text:ae.replace(/\*/g,""),url:la})}catch(ne){console.warn("Share failed",ne)}else alert("La función de compartir no está disponible en este navegador.");return}},G=Number(T.aliquot)||0,K=!!T.hasUncommonExpense,W=r.filter(ce=>ce.hasUncommonExpense).length,z=ce=>{var X,pe;const ne=Number(ce.amountUsd)||0;let le=0,ge="";if(ce.isSpecial){const be=((X=ce.specialPropertyIds)==null?void 0:X.length)||1,me=(pe=ce.specialPropertyIds)==null?void 0:pe.includes(x);le=me?ne/be:0,ge=me?`ESP (1/${be})`:"Exento"}else ce.isUncommon?(le=K&&W>0?ne/W:0,ge=K&&W>0?`GNC (1/${W})`:"Exento"):(le=ne*(G/100),ge=`ALIQ (${G.toFixed(4)}%)`);return{...ce,global:ne,myPortion:le,basisDesc:ge}},Z=[{title:"Gastos Fijos",items:E.fixedExpenses.map(z)},{title:"Gastos Variables",items:E.variableExpenses.map(z)},{title:"Otros Gastos",items:E.otherExpenses.map(z)}],Y=Z.reduce((ce,ne)=>ce+ne.items.reduce((le,ge)=>le+ge.myPortion,0),0),te=Z.reduce((ce,ne)=>ce+ne.items.reduce((le,ge)=>le+ge.global,0),0),O=Number(E.reserveFundPercent)||10,P=Y*(O/100),q=Y+P,H=E.debts.find(ce=>ce.propertyId===x),J=H?(Number(H.amountUsd)-Number(H.paidAmount)).toFixed(2):q.toFixed(2),ae=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${B.fullName}*,

Su recibo de *${Ue[d]} ${f}* para la unidad *${T.type} ${T.number}* ya está disponible.

💵 *Total a Pagar:* $${J} USD
📌 *Estado:* ${(H==null?void 0:H.status)||"Pendiente"}

Por favor, gestione su reporte de pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${la}

¡Muchas gracias!`,oe=U(B.phone);return n.jsxs("div",{className:"max-w-7xl mx-auto space-y-10 animate-in fade-in duration-500 pb-24 px-1 print:p-0 print:space-y-2 print-compact",children:[n.jsx("style",{children:`
                    @media print {
                        @page { margin: 0.5cm; size: auto; }
                        .print-compact { font-size: 8pt !important; width: 100% !important; overflow: visible !important; }
                        .print-compact table td, .print-compact table th { padding-top: 2px !important; padding-bottom: 2px !important; line-height: 1.1 !important; font-size: 8pt !important; }
                        .print-compact h2 { font-size: 14pt !important; margin-bottom: 4px !important; }
                        .print-compact h3 { font-size: 10pt !important; margin-bottom: 6px !important; margin-top: 6px !important; border-bottom-width: 1px !important; padding-bottom: 2px !important; }
                        .print-compact .p-10, .print-compact .p-14, .print-compact .p-8 { padding: 12px !important; }
                        .print-compact .mt-8, .print-compact .mt-10, .print-compact .mt-6 { margin-top: 6px !important; }
                        .print-compact .mb-8, .print-compact .mb-10, .print-compact .mb-4, .print-compact .mb-2 { margin-bottom: 4px !important; }
                        .print-compact .rounded-[3rem], .print-compact .rounded-2xl, .print-compact .rounded-[2.5rem] { border-radius: 8px !important; }
                        .print-compact .shadow-xl, .print-compact .shadow-2xl, .print-compact .shadow-lg { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
                        .print-compact .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .bg-indigo-600/20 { background-color: rgba(79, 70, 229, 0.2) !important; border: 1px solid rgba(129, 140, 248, 0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md, .print-header .backdrop-blur-sm { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .print-compact .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .print-compact .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                        .print-compact .bg-indigo-600 { background-color: #4f46e5 !important; -webkit-print-color-adjust: exact; }
                        .print-compact table { page-break-inside: auto !important; }
                        .print-compact tr { page-break-inside: avoid !important; page-break-after: auto !important; }
                    }
                `}),n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>v("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:R,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(ja,{size:20})}),oe&&n.jsx("a",{href:`https://wa.me/${oe}?text=${encodeURIComponent(ae)}`,target:"_blank",rel:"noreferrer",onClick:()=>l(E.id,x,"whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:L,disabled:!B.telegramId||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Enviar Telegram",children:y==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:D,disabled:!B.email||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.email?"bg-indigo-600":"bg-slate-200"}`,title:"Enviar Email",children:y==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>Q(),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(_a,{size:20})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-xl border border-slate-200 overflow-hidden print:overflow-visible print:border-none print:shadow-none",children:[n.jsxs("div",{className:"p-10 lg:p-14 bg-slate-900 text-white text-center relative overflow-hidden print:p-6 print-header",children:[n.jsx("h2",{className:"text-2xl lg:text-3xl font-black uppercase tracking-[0.2em] mb-2 print:text-xl",children:"Aviso de Cobro Individual"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-xs",children:[Ue[E.month]," ",E.year]}),n.jsx("div",{className:"mt-8 mb-4 max-w-md mx-auto print:mt-4 print:mb-2",children:n.jsxs("div",{className:"bg-indigo-600/20 border border-indigo-400/30 p-4 rounded-2xl backdrop-blur-sm flex items-center justify-between print:p-2 print:border-none",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ho,{className:"text-blue-400",size:24}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-300 tracking-widest",children:"Disponibilidad Fondo de Reserva"}),n.jsxs("p",{className:"text-lg font-black text-white",children:["$ ",I((i==null?void 0:i.reserveFundUsd)||0)]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[7px] font-black uppercase text-indigo-300",children:"Equiv. VES"}),n.jsxs("p",{className:"text-xs font-black text-blue-200",children:["Bs. ",M((i==null?void 0:i.reserveFundBs)||0)]})]})]})}),n.jsxs("div",{className:"mt-6 flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[T.type," ",T.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[G.toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsx("div",{className:"p-8 lg:p-14 space-y-12 bg-white print:p-4 print:space-y-4",children:Z.map((ce,ne)=>ce.items.length===0?null:n.jsxs("div",{className:"print:break-inside-auto",children:[n.jsxs("h3",{className:"text-lg font-black text-slate-900 uppercase tracking-tighter mb-6 flex items-center gap-3 print:text-sm print:mb-2",children:[n.jsx("div",{className:"w-2 h-6 bg-blue-600 rounded-full print:h-4"})," ",ce.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b-2 border-slate-100",children:[n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 tracking-widest print:py-1",children:"Concepto"}),n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 text-center print:py-1",children:"Base"}),n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 text-right print:py-1",children:"Gasto Global ($)"}),n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-blue-600 text-right bg-blue-50/30 px-4 print:py-1",children:"Su Cuota ($)"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:ce.items.map((le,ge)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[n.jsxs("td",{className:"py-4 text-xs font-bold text-slate-600 uppercase flex items-center gap-3 print:py-0.5 print:text-[7pt]",children:[le.isSpecial?n.jsx(cb,{size:12,className:"text-amber-500 no-print"}):le.isUncommon?n.jsx(Lc,{size:12,className:"text-indigo-500 no-print",fill:"currentColor"}):n.jsx("div",{className:"w-3 no-print"}),le.description]}),n.jsx("td",{className:"py-4 text-center print:py-0.5",children:n.jsx("span",{className:"px-3 py-1 rounded-lg text-[8px] font-black uppercase tracking-tighter border bg-slate-50 text-slate-500 print:text-[6pt] print:px-1",children:le.basisDesc})}),n.jsxs("td",{className:"py-4 text-xs font-black text-right text-slate-400 print:py-0.5",children:["$",I(le.global)]}),n.jsxs("td",{className:"py-4 text-sm font-black text-blue-900 text-right bg-blue-50/10 px-4 print:py-0.5 print:text-[8pt]",children:["$",I(le.myPortion)]})]},ge))})]})})]},ne))}),n.jsx("div",{className:"bg-slate-50 p-10 lg:p-14 border-t border-slate-100 space-y-12 print:p-6 print:space-y-6",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 print:gap-4 print:grid-cols-2",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"space-y-4 print:space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-3 text-amber-600 print:gap-1",children:[n.jsx(Cr,{size:20,className:"print:w-4 print:h-4"}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest print:text-[8pt]",children:"Resumen"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-4 print:pt-1",children:[n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-slate-400 uppercase print:text-[6pt]",children:"Subtotal"}),n.jsxs("span",{className:"font-black text-slate-800 text-xs print:text-[8pt]",children:["$",I(Y)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsxs("span",{className:"block text-[8px] font-black text-blue-400 uppercase print:text-[6pt]",children:["Reserva (",O,"%)"]}),n.jsxs("span",{className:"font-black text-blue-600 text-xs print:text-[8pt]",children:["$",I(P)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-amber-400 uppercase print:text-[6pt]",children:"Gasto Global"}),n.jsxs("span",{className:"font-black text-amber-600 text-xs print:text-[8pt]",children:["$",I(te)]})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left pt-4 border-t border-slate-200 print:pt-2 print:gap-2",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(xr,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-white p-4 rounded-2xl border border-slate-100 shadow-sm space-y-1 print:p-2",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase print:text-[7pt]",children:[_.payment_bank_name||"BanPlus"," ",_.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider print:text-[7pt]",children:["# ",_.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase print:text-[7pt]",children:["RIF: ",_.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase print:text-[7pt]",children:["Pago Móvil: ",_.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Qr,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-white p-4 rounded-2xl border border-slate-100 shadow-sm space-y-1 print:p-2",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase print:text-[6pt]",children:"Enviar comprobante a:"}),(_.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((ce,ne)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700 print:text-[7pt]",children:ce.trim()},ne)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1 print:text-[7pt]",children:["WhatsApp: ",_.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2 print:text-[6pt]",children:"Indicar #casa y nombre para identificar"})]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-2xl relative overflow-hidden flex flex-col justify-center print:p-4",children:[n.jsxs("div",{className:"relative z-10 flex flex-col gap-6 print:gap-2",children:[n.jsxs("div",{className:"flex justify-between items-center border-b border-white/10 pb-4 print:pb-1",children:[n.jsx("span",{className:"text-[10px] font-black uppercase text-blue-400 print:text-[7pt]",children:"Total a Pagar"}),n.jsxs("span",{className:"text-4xl font-black tracking-tighter print:text-xl",children:["$",I(q)]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600/20 p-5 rounded-2xl border border-blue-500/20 print:p-2",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] font-black uppercase text-blue-300 block print:text-[6pt]",children:"Equivalente VES"}),n.jsxs("p",{className:"text-2xl font-black tracking-tight mt-1 print:text-sm print:mt-0",children:["Bs. ",M(q*o)]})]}),n.jsx($i,{size:32,className:"text-blue-400 opacity-50 print:w-6 print:h-6"})]})]}),n.jsx(Fp,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/[0.05] pointer-events-none no-print"})]})]})})]}),n.jsx("div",{className:"hidden print:block text-center mt-4 border-t pt-4",children:n.jsx("p",{className:"text-[8pt] font-black uppercase text-slate-300 tracking-[0.4em]",children:"Certificado Digital de Gestión • SAC 2026 • Kernel V4.1.85 MC/MB • By Andres Mathison"})})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Cuota por ",n.jsx("span",{className:"text-blue-600",children:"Usuario Individual"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Visualización y envío de avisos de cobro personalizados."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:Q=>u(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((Q,G)=>n.jsx("option",{value:G,children:Q},G))}),n.jsx("input",{type:"number",value:f,onChange:Q=>p(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(PA,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Seleccione una Propiedad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Elija la unidad para generar la vista previa del aviso de cobro."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:x||"",onChange:Q=>m(Number(Q.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),r.sort((Q,G)=>Q.code.localeCompare(G.code,void 0,{numeric:!0})).map(Q=>n.jsxs("option",{value:Q.id,children:[Q.code," - ",Q.type," ",Q.number]},Q.id))]})]}),n.jsx("button",{disabled:!x||!E,onClick:()=>v("breakdown"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:E?n.jsxs(n.Fragment,{children:["GENERAR VISTA PREVIA ",n.jsx(Os,{size:18})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA PARA ESTE MES"})}),!E&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-6 rounded-2xl flex items-center gap-4 text-amber-700",children:[n.jsx(Cr,{size:24,className:"shrink-0"}),n.jsx("p",{className:"text-xs font-bold leading-relaxed uppercase tracking-tight",children:'Debe generar primero la relación de gastos global para este periodo en el módulo de "Generar Cuotas".'})]})]})})]})};/*!
 * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var _C=function(e,t){return _C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(r[s]=a[s])},_C(e,t)};function Ji(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");_C(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var TC=function(){return TC=Object.assign||function(t){for(var r,a=1,s=arguments.length;a<s;a++){r=arguments[a];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},TC.apply(this,arguments)};function Hn(e,t,r,a){function s(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function o(f){try{u(a.next(f))}catch(p){l(p)}}function d(f){try{u(a.throw(f))}catch(p){l(p)}}function u(f){f.done?i(f.value):s(f.value).then(o,d)}u((a=a.apply(e,[])).next())})}function Sn(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,s,i,l;return l={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function o(u){return function(f){return d([u,f])}}function d(u){if(a)throw new TypeError("Generator is already executing.");for(;r;)try{if(a=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(f){u=[6,f],s=0}finally{a=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Xx(e,t,r){if(arguments.length===2)for(var a=0,s=t.length,i;a<s;a++)(i||!(a in t))&&(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||t)}var Co=(function(){function e(t,r,a,s){this.left=t,this.top=r,this.width=a,this.height=s}return e.prototype.add=function(t,r,a,s){return new e(this.left+t,this.top+r,this.width+a,this.height+s)},e.fromClientRect=function(t,r){return new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height)},e.fromDOMRectList=function(t,r){var a=Array.from(r).find(function(s){return s.width!==0});return a?new e(a.left+t.windowBounds.left,a.top+t.windowBounds.top,a.width,a.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e})(),pv=function(e,t){return Co.fromClientRect(e,t.getBoundingClientRect())},tSe=function(e){var t=e.body,r=e.documentElement;if(!t||!r)throw new Error("Unable to get document size");var a=Math.max(Math.max(t.scrollWidth,r.scrollWidth),Math.max(t.offsetWidth,r.offsetWidth),Math.max(t.clientWidth,r.clientWidth)),s=Math.max(Math.max(t.scrollHeight,r.scrollHeight),Math.max(t.offsetHeight,r.offsetHeight),Math.max(t.clientHeight,r.clientHeight));return new Co(0,0,a,s)},hv=function(e){for(var t=[],r=0,a=e.length;r<a;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){var i=e.charCodeAt(r++);(i&64512)===56320?t.push(((s&1023)<<10)+(i&1023)+65536):(t.push(s),r--)}else t.push(s)}return t},fa=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var a=[],s=-1,i="";++s<r;){var l=e[s];l<=65535?a.push(l):(l-=65536,a.push((l>>10)+55296,l%1024+56320)),(s+1===r||a.length>16384)&&(i+=String.fromCharCode.apply(String,a),a.length=0)}return i},pU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rSe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Jx=0;Jx<pU.length;Jx++)rSe[pU.charCodeAt(Jx)]=Jx;var hU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Zx=0;Zx<hU.length;Zx++)Nf[hU.charCodeAt(Zx)]=Zx;var aSe=function(e){var t=e.length*.75,r=e.length,a,s=0,i,l,o,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),f=Array.isArray(u)?u:new Uint8Array(u);for(a=0;a<r;a+=4)i=Nf[e.charCodeAt(a)],l=Nf[e.charCodeAt(a+1)],o=Nf[e.charCodeAt(a+2)],d=Nf[e.charCodeAt(a+3)],f[s++]=i<<2|l>>4,f[s++]=(l&15)<<4|o>>2,f[s++]=(o&3)<<6|d&63;return u},nSe=function(e){for(var t=e.length,r=[],a=0;a<t;a+=2)r.push(e[a+1]<<8|e[a]);return r},sSe=function(e){for(var t=e.length,r=[],a=0;a<t;a+=4)r.push(e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a]);return r},Dd=5,QE=11,P2=2,iSe=QE-Dd,vH=65536>>Dd,lSe=1<<Dd,L2=lSe-1,oSe=1024>>Dd,cSe=vH+oSe,dSe=cSe,uSe=32,ASe=dSe+uSe,fSe=65536>>QE,pSe=1<<iSe,hSe=pSe-1,xU=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},xSe=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},mSe=function(e,t){var r=aSe(e),a=Array.isArray(r)?sSe(r):new Uint32Array(r),s=Array.isArray(r)?nSe(r):new Uint16Array(r),i=24,l=xU(s,i/2,a[4]/2),o=a[5]===2?xU(s,(i+a[4])/2):xSe(a,Math.ceil((i+a[4])/4));return new gSe(a[0],a[1],a[2],a[3],l,o)},gSe=(function(){function e(t,r,a,s,i,l){this.initialValue=t,this.errorValue=r,this.highStart=a,this.highValueIndex=s,this.index=i,this.data=l}return e.prototype.get=function(t){var r;if(t>=0){if(t<55296||t>56319&&t<=65535)return r=this.index[t>>Dd],r=(r<<P2)+(t&L2),this.data[r];if(t<=65535)return r=this.index[vH+(t-55296>>Dd)],r=(r<<P2)+(t&L2),this.data[r];if(t<this.highStart)return r=ASe-fSe+(t>>QE),r=this.index[r],r+=t>>Dd&hSe,r=this.index[r],r=(r<<P2)+(t&L2),this.data[r];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),mU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bSe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var em=0;em<mU.length;em++)bSe[mU.charCodeAt(em)]=em;var vSe=" ",gU=50,ySe=1,yH=2,wH=3,wSe=4,NSe=5,bU=7,NH=8,vU=9,wc=10,FC=11,yU=12,IC=13,CSe=14,Cf=15,DC=16,tm=17,cf=18,kSe=19,wU=20,UC=21,df=22,Q2=23,Ju=24,Bs=25,kf=26,jf=27,Zu=28,jSe=29,bd=30,ESe=31,rm=32,am=33,MC=34,RC=35,OC=36,jp=37,PC=38,Im=39,Dm=40,H2=41,CH=42,SSe=43,BSe=[9001,65288],kH="!",Lt="×",nm="÷",LC=mSe(vSe),Zl=[bd,OC],QC=[ySe,yH,wH,NSe],jH=[wc,NH],NU=[jf,kf],_Se=QC.concat(jH),CU=[PC,Im,Dm,MC,RC],TSe=[Cf,IC],FSe=function(e,t){t===void 0&&(t="strict");var r=[],a=[],s=[];return e.forEach(function(i,l){var o=LC.get(i);if(o>gU?(s.push(!0),o-=gU):s.push(!1),["normal","auto","loose"].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(i)!==-1)return a.push(l),r.push(DC);if(o===wSe||o===FC){if(l===0)return a.push(l),r.push(bd);var d=r[l-1];return _Se.indexOf(d)===-1?(a.push(a[l-1]),r.push(d)):(a.push(l),r.push(bd))}if(a.push(l),o===ESe)return r.push(t==="strict"?UC:jp);if(o===CH||o===jSe)return r.push(bd);if(o===SSe)return i>=131072&&i<=196605||i>=196608&&i<=262141?r.push(jp):r.push(bd);r.push(o)}),[a,r,s]},z2=function(e,t,r,a){var s=a[r];if(Array.isArray(e)?e.indexOf(s)!==-1:e===s)for(var i=r;i<=a.length;){i++;var l=a[i];if(l===t)return!0;if(l!==wc)break}if(s===wc)for(var i=r;i>0;){i--;var o=a[i];if(Array.isArray(e)?e.indexOf(o)!==-1:e===o)for(var d=r;d<=a.length;){d++;var l=a[d];if(l===t)return!0;if(l!==wc)break}if(o!==wc)break}return!1},kU=function(e,t){for(var r=e;r>=0;){var a=t[r];if(a===wc)r--;else return a}return 0},ISe=function(e,t,r,a,s){if(r[a]===0)return Lt;var i=a-1;if(Array.isArray(s)&&s[i]===!0)return Lt;var l=i-1,o=i+1,d=t[i],u=l>=0?t[l]:0,f=t[o];if(d===yH&&f===wH)return Lt;if(QC.indexOf(d)!==-1)return kH;if(QC.indexOf(f)!==-1||jH.indexOf(f)!==-1)return Lt;if(kU(i,t)===NH)return nm;if(LC.get(e[i])===FC||(d===rm||d===am)&&LC.get(e[o])===FC||d===bU||f===bU||d===vU||[wc,IC,Cf].indexOf(d)===-1&&f===vU||[tm,cf,kSe,Ju,Zu].indexOf(f)!==-1||kU(i,t)===df||z2(Q2,df,i,t)||z2([tm,cf],UC,i,t)||z2(yU,yU,i,t))return Lt;if(d===wc)return nm;if(d===Q2||f===Q2)return Lt;if(f===DC||d===DC)return nm;if([IC,Cf,UC].indexOf(f)!==-1||d===CSe||u===OC&&TSe.indexOf(d)!==-1||d===Zu&&f===OC||f===wU||Zl.indexOf(f)!==-1&&d===Bs||Zl.indexOf(d)!==-1&&f===Bs||d===jf&&[jp,rm,am].indexOf(f)!==-1||[jp,rm,am].indexOf(d)!==-1&&f===kf||Zl.indexOf(d)!==-1&&NU.indexOf(f)!==-1||NU.indexOf(d)!==-1&&Zl.indexOf(f)!==-1||[jf,kf].indexOf(d)!==-1&&(f===Bs||[df,Cf].indexOf(f)!==-1&&t[o+1]===Bs)||[df,Cf].indexOf(d)!==-1&&f===Bs||d===Bs&&[Bs,Zu,Ju].indexOf(f)!==-1)return Lt;if([Bs,Zu,Ju,tm,cf].indexOf(f)!==-1)for(var p=i;p>=0;){var x=t[p];if(x===Bs)return Lt;if([Zu,Ju].indexOf(x)!==-1)p--;else break}if([jf,kf].indexOf(f)!==-1)for(var p=[tm,cf].indexOf(d)!==-1?l:i;p>=0;){var x=t[p];if(x===Bs)return Lt;if([Zu,Ju].indexOf(x)!==-1)p--;else break}if(PC===d&&[PC,Im,MC,RC].indexOf(f)!==-1||[Im,MC].indexOf(d)!==-1&&[Im,Dm].indexOf(f)!==-1||[Dm,RC].indexOf(d)!==-1&&f===Dm||CU.indexOf(d)!==-1&&[wU,kf].indexOf(f)!==-1||CU.indexOf(f)!==-1&&d===jf||Zl.indexOf(d)!==-1&&Zl.indexOf(f)!==-1||d===Ju&&Zl.indexOf(f)!==-1||Zl.concat(Bs).indexOf(d)!==-1&&f===df&&BSe.indexOf(e[o])===-1||Zl.concat(Bs).indexOf(f)!==-1&&d===cf)return Lt;if(d===H2&&f===H2){for(var m=r[i],b=1;m>0&&(m--,t[m]===H2);)b++;if(b%2!==0)return Lt}return d===rm&&f===am?Lt:nm},DSe=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var r=FSe(e,t.lineBreak),a=r[0],s=r[1],i=r[2];(t.wordBreak==="break-all"||t.wordBreak==="break-word")&&(s=s.map(function(o){return[Bs,bd,CH].indexOf(o)!==-1?jp:o}));var l=t.wordBreak==="keep-all"?i.map(function(o,d){return o&&e[d]>=19968&&e[d]<=40959}):void 0;return[a,s,l]},USe=(function(){function e(t,r,a,s){this.codePoints=t,this.required=r===kH,this.start=a,this.end=s}return e.prototype.slice=function(){return fa.apply(void 0,this.codePoints.slice(this.start,this.end))},e})(),MSe=function(e,t){var r=hv(e),a=DSe(r,t),s=a[0],i=a[1],l=a[2],o=r.length,d=0,u=0;return{next:function(){if(u>=o)return{done:!0,value:null};for(var f=Lt;u<o&&(f=ISe(r,i,s,++u,l))===Lt;);if(f!==Lt||u===o){var p=new USe(r,f,d,u);return d=u,{value:p,done:!1}}return{done:!0,value:null}}}},RSe=1,OSe=2,nh=4,jU=8,Xg=10,EU=47,Pf=92,PSe=9,LSe=32,sm=34,uf=61,QSe=35,HSe=36,zSe=37,im=39,lm=40,Af=41,$Se=95,cs=45,VSe=33,GSe=60,KSe=62,qSe=64,WSe=91,YSe=93,XSe=61,JSe=123,om=63,ZSe=125,SU=124,eBe=126,tBe=128,BU=65533,$2=42,kd=43,rBe=44,aBe=58,nBe=59,Ep=46,sBe=0,iBe=8,lBe=11,oBe=14,cBe=31,dBe=127,dl=-1,EH=48,SH=97,BH=101,uBe=102,ABe=117,fBe=122,_H=65,TH=69,FH=70,pBe=85,hBe=90,Fn=function(e){return e>=EH&&e<=57},xBe=function(e){return e>=55296&&e<=57343},eA=function(e){return Fn(e)||e>=_H&&e<=FH||e>=SH&&e<=uBe},mBe=function(e){return e>=SH&&e<=fBe},gBe=function(e){return e>=_H&&e<=hBe},bBe=function(e){return mBe(e)||gBe(e)},vBe=function(e){return e>=tBe},cm=function(e){return e===Xg||e===PSe||e===LSe},Jg=function(e){return bBe(e)||vBe(e)||e===$Se},_U=function(e){return Jg(e)||Fn(e)||e===cs},yBe=function(e){return e>=sBe&&e<=iBe||e===lBe||e>=oBe&&e<=cBe||e===dBe},xc=function(e,t){return e!==Pf?!1:t!==Xg},dm=function(e,t,r){return e===cs?Jg(t)||xc(t,r):Jg(e)?!0:!!(e===Pf&&xc(e,t))},V2=function(e,t,r){return e===kd||e===cs?Fn(t)?!0:t===Ep&&Fn(r):Fn(e===Ep?t:e)},wBe=function(e){var t=0,r=1;(e[t]===kd||e[t]===cs)&&(e[t]===cs&&(r=-1),t++);for(var a=[];Fn(e[t]);)a.push(e[t++]);var s=a.length?parseInt(fa.apply(void 0,a),10):0;e[t]===Ep&&t++;for(var i=[];Fn(e[t]);)i.push(e[t++]);var l=i.length,o=l?parseInt(fa.apply(void 0,i),10):0;(e[t]===TH||e[t]===BH)&&t++;var d=1;(e[t]===kd||e[t]===cs)&&(e[t]===cs&&(d=-1),t++);for(var u=[];Fn(e[t]);)u.push(e[t++]);var f=u.length?parseInt(fa.apply(void 0,u),10):0;return r*(s+o*Math.pow(10,-l))*Math.pow(10,d*f)},NBe={type:2},CBe={type:3},kBe={type:4},jBe={type:13},EBe={type:8},SBe={type:21},BBe={type:9},_Be={type:10},TBe={type:11},FBe={type:12},IBe={type:14},um={type:23},DBe={type:1},UBe={type:25},MBe={type:24},RBe={type:26},OBe={type:27},PBe={type:28},LBe={type:29},QBe={type:31},HC={type:32},IH=(function(){function e(){this._value=[]}return e.prototype.write=function(t){this._value=this._value.concat(hv(t))},e.prototype.read=function(){for(var t=[],r=this.consumeToken();r!==HC;)t.push(r),r=this.consumeToken();return t},e.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case sm:return this.consumeStringToken(sm);case QSe:var r=this.peekCodePoint(0),a=this.peekCodePoint(1),s=this.peekCodePoint(2);if(_U(r)||xc(a,s)){var i=dm(r,a,s)?OSe:RSe,l=this.consumeName();return{type:5,value:l,flags:i}}break;case HSe:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),jBe;break;case im:return this.consumeStringToken(im);case lm:return NBe;case Af:return CBe;case $2:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),IBe;break;case kd:if(V2(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case rBe:return kBe;case cs:var o=t,d=this.peekCodePoint(0),u=this.peekCodePoint(1);if(V2(o,d,u))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(dm(o,d,u))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(d===cs&&u===KSe)return this.consumeCodePoint(),this.consumeCodePoint(),MBe;break;case Ep:if(V2(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case EU:if(this.peekCodePoint(0)===$2)for(this.consumeCodePoint();;){var f=this.consumeCodePoint();if(f===$2&&(f=this.consumeCodePoint(),f===EU))return this.consumeToken();if(f===dl)return this.consumeToken()}break;case aBe:return RBe;case nBe:return OBe;case GSe:if(this.peekCodePoint(0)===VSe&&this.peekCodePoint(1)===cs&&this.peekCodePoint(2)===cs)return this.consumeCodePoint(),this.consumeCodePoint(),UBe;break;case qSe:var p=this.peekCodePoint(0),x=this.peekCodePoint(1),m=this.peekCodePoint(2);if(dm(p,x,m)){var l=this.consumeName();return{type:7,value:l}}break;case WSe:return PBe;case Pf:if(xc(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case YSe:return LBe;case XSe:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),EBe;break;case JSe:return TBe;case ZSe:return FBe;case ABe:case pBe:var b=this.peekCodePoint(0),v=this.peekCodePoint(1);return b===kd&&(eA(v)||v===om)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case SU:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),BBe;if(this.peekCodePoint(0)===SU)return this.consumeCodePoint(),SBe;break;case eBe:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),_Be;break;case dl:return HC}return cm(t)?(this.consumeWhiteSpace(),QBe):Fn(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):Jg(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:fa(t)}},e.prototype.consumeCodePoint=function(){var t=this._value.shift();return typeof t>"u"?-1:t},e.prototype.reconsumeCodePoint=function(t){this._value.unshift(t)},e.prototype.peekCodePoint=function(t){return t>=this._value.length?-1:this._value[t]},e.prototype.consumeUnicodeRangeToken=function(){for(var t=[],r=this.consumeCodePoint();eA(r)&&t.length<6;)t.push(r),r=this.consumeCodePoint();for(var a=!1;r===om&&t.length<6;)t.push(r),r=this.consumeCodePoint(),a=!0;if(a){var s=parseInt(fa.apply(void 0,t.map(function(d){return d===om?EH:d})),16),i=parseInt(fa.apply(void 0,t.map(function(d){return d===om?FH:d})),16);return{type:30,start:s,end:i}}var l=parseInt(fa.apply(void 0,t),16);if(this.peekCodePoint(0)===cs&&eA(this.peekCodePoint(1))){this.consumeCodePoint(),r=this.consumeCodePoint();for(var o=[];eA(r)&&o.length<6;)o.push(r),r=this.consumeCodePoint();var i=parseInt(fa.apply(void 0,o),16);return{type:30,start:l,end:i}}else return{type:30,start:l,end:l}},e.prototype.consumeIdentLikeToken=function(){var t=this.consumeName();return t.toLowerCase()==="url"&&this.peekCodePoint(0)===lm?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===lm?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},e.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===dl)return{type:22,value:""};var r=this.peekCodePoint(0);if(r===im||r===sm){var a=this.consumeStringToken(this.consumeCodePoint());return a.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===dl||this.peekCodePoint(0)===Af)?(this.consumeCodePoint(),{type:22,value:a.value}):(this.consumeBadUrlRemnants(),um)}for(;;){var s=this.consumeCodePoint();if(s===dl||s===Af)return{type:22,value:fa.apply(void 0,t)};if(cm(s))return this.consumeWhiteSpace(),this.peekCodePoint(0)===dl||this.peekCodePoint(0)===Af?(this.consumeCodePoint(),{type:22,value:fa.apply(void 0,t)}):(this.consumeBadUrlRemnants(),um);if(s===sm||s===im||s===lm||yBe(s))return this.consumeBadUrlRemnants(),um;if(s===Pf)if(xc(s,this.peekCodePoint(0)))t.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),um;else t.push(s)}},e.prototype.consumeWhiteSpace=function(){for(;cm(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(t===Af||t===dl)return;xc(t,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(t){for(var r=5e4,a="";t>0;){var s=Math.min(r,t);a+=fa.apply(void 0,this._value.splice(0,s)),t-=s}return this._value.shift(),a},e.prototype.consumeStringToken=function(t){var r="",a=0;do{var s=this._value[a];if(s===dl||s===void 0||s===t)return r+=this.consumeStringSlice(a),{type:0,value:r};if(s===Xg)return this._value.splice(0,a),DBe;if(s===Pf){var i=this._value[a+1];i!==dl&&i!==void 0&&(i===Xg?(r+=this.consumeStringSlice(a),a=-1,this._value.shift()):xc(s,i)&&(r+=this.consumeStringSlice(a),r+=fa(this.consumeEscapedCodePoint()),a=-1))}a++}while(!0)},e.prototype.consumeNumber=function(){var t=[],r=nh,a=this.peekCodePoint(0);for((a===kd||a===cs)&&t.push(this.consumeCodePoint());Fn(this.peekCodePoint(0));)t.push(this.consumeCodePoint());a=this.peekCodePoint(0);var s=this.peekCodePoint(1);if(a===Ep&&Fn(s))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=jU;Fn(this.peekCodePoint(0));)t.push(this.consumeCodePoint());a=this.peekCodePoint(0),s=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((a===TH||a===BH)&&((s===kd||s===cs)&&Fn(i)||Fn(s)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=jU;Fn(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[wBe(t),r]},e.prototype.consumeNumericToken=function(){var t=this.consumeNumber(),r=t[0],a=t[1],s=this.peekCodePoint(0),i=this.peekCodePoint(1),l=this.peekCodePoint(2);if(dm(s,i,l)){var o=this.consumeName();return{type:15,number:r,flags:a,unit:o}}return s===zSe?(this.consumeCodePoint(),{type:16,number:r,flags:a}):{type:17,number:r,flags:a}},e.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(eA(t)){for(var r=fa(t);eA(this.peekCodePoint(0))&&r.length<6;)r+=fa(this.consumeCodePoint());cm(this.peekCodePoint(0))&&this.consumeCodePoint();var a=parseInt(r,16);return a===0||xBe(a)||a>1114111?BU:a}return t===dl?BU:t},e.prototype.consumeName=function(){for(var t="";;){var r=this.consumeCodePoint();if(_U(r))t+=fa(r);else if(xc(r,this.peekCodePoint(0)))t+=fa(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(r),t}},e})(),DH=(function(){function e(t){this._tokens=t}return e.create=function(t){var r=new IH;return r.write(t),new e(r.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var t=this.consumeToken();t.type===31;)t=this.consumeToken();if(t.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(t);var r=this.consumeComponentValue();do t=this.consumeToken();while(t.type===31);if(t.type===32)return r;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var t=[];;){var r=this.consumeComponentValue();if(r.type===32)return t;t.push(r),t.push()}},e.prototype.consumeComponentValue=function(){var t=this.consumeToken();switch(t.type){case 11:case 28:case 2:return this.consumeSimpleBlock(t.type);case 19:return this.consumeFunction(t)}return t},e.prototype.consumeSimpleBlock=function(t){for(var r={type:t,values:[]},a=this.consumeToken();;){if(a.type===32||zBe(a,t))return r;this.reconsumeToken(a),r.values.push(this.consumeComponentValue()),a=this.consumeToken()}},e.prototype.consumeFunction=function(t){for(var r={name:t.value,values:[],type:18};;){var a=this.consumeToken();if(a.type===32||a.type===3)return r;this.reconsumeToken(a),r.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var t=this._tokens.shift();return typeof t>"u"?HC:t},e.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},e})(),sh=function(e){return e.type===15},n0=function(e){return e.type===17},pr=function(e){return e.type===20},HBe=function(e){return e.type===0},zC=function(e,t){return pr(e)&&e.value===t},UH=function(e){return e.type!==31},MA=function(e){return e.type!==31&&e.type!==4},Fl=function(e){var t=[],r=[];return e.forEach(function(a){if(a.type===4){if(r.length===0)throw new Error("Error parsing function args, zero tokens for arg");t.push(r),r=[];return}a.type!==31&&r.push(a)}),r.length&&t.push(r),t},zBe=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Rc=function(e){return e.type===17||e.type===15},ka=function(e){return e.type===16||Rc(e)},MH=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},bn={type:17,number:0,flags:nh},HE={type:16,number:50,flags:nh},Nc={type:16,number:100,flags:nh},Ef=function(e,t,r){var a=e[0],s=e[1];return[Nr(a,t),Nr(typeof s<"u"?s:a,r)]},Nr=function(e,t){if(e.type===16)return e.number/100*t;if(sh(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},RH="deg",OH="grad",PH="rad",LH="turn",xv={name:"angle",parse:function(e,t){if(t.type===15)switch(t.unit){case RH:return Math.PI*t.number/180;case OH:return Math.PI/200*t.number;case PH:return t.number;case LH:return Math.PI*2*t.number}throw new Error("Unsupported angle type")}},QH=function(e){return e.type===15&&(e.unit===RH||e.unit===OH||e.unit===PH||e.unit===LH)},HH=function(e){var t=e.filter(pr).map(function(r){return r.value}).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[bn,bn];case"to top":case"bottom":return hi(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[bn,Nc];case"to right":case"left":return hi(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Nc,Nc];case"to bottom":case"top":return hi(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Nc,bn];case"to left":case"right":return hi(270)}return 0},hi=function(e){return Math.PI*e/180},Ec={name:"color",parse:function(e,t){if(t.type===18){var r=$Be[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return r(e,t.values)}if(t.type===5){if(t.value.length===3){var a=t.value.substring(0,1),s=t.value.substring(1,2),i=t.value.substring(2,3);return Cc(parseInt(a+a,16),parseInt(s+s,16),parseInt(i+i,16),1)}if(t.value.length===4){var a=t.value.substring(0,1),s=t.value.substring(1,2),i=t.value.substring(2,3),l=t.value.substring(3,4);return Cc(parseInt(a+a,16),parseInt(s+s,16),parseInt(i+i,16),parseInt(l+l,16)/255)}if(t.value.length===6){var a=t.value.substring(0,2),s=t.value.substring(2,4),i=t.value.substring(4,6);return Cc(parseInt(a,16),parseInt(s,16),parseInt(i,16),1)}if(t.value.length===8){var a=t.value.substring(0,2),s=t.value.substring(2,4),i=t.value.substring(4,6),l=t.value.substring(6,8);return Cc(parseInt(a,16),parseInt(s,16),parseInt(i,16),parseInt(l,16)/255)}}if(t.type===20){var o=fo[t.value.toUpperCase()];if(typeof o<"u")return o}return fo.TRANSPARENT}},Sc=function(e){return(255&e)===0},Ga=function(e){var t=255&e,r=255&e>>8,a=255&e>>16,s=255&e>>24;return t<255?"rgba("+s+","+a+","+r+","+t/255+")":"rgb("+s+","+a+","+r+")"},Cc=function(e,t,r,a){return(e<<24|t<<16|r<<8|Math.round(a*255)<<0)>>>0},TU=function(e,t){if(e.type===17)return e.number;if(e.type===16){var r=t===3?1:255;return t===3?e.number/100*r:Math.round(e.number/100*r)}return 0},FU=function(e,t){var r=t.filter(MA);if(r.length===3){var a=r.map(TU),s=a[0],i=a[1],l=a[2];return Cc(s,i,l,1)}if(r.length===4){var o=r.map(TU),s=o[0],i=o[1],l=o[2],d=o[3];return Cc(s,i,l,d)}return 0};function G2(e,t,r){return r<0&&(r+=1),r>=1&&(r-=1),r<1/6?(t-e)*r*6+e:r<1/2?t:r<2/3?(t-e)*6*(2/3-r)+e:e}var IU=function(e,t){var r=t.filter(MA),a=r[0],s=r[1],i=r[2],l=r[3],o=(a.type===17?hi(a.number):xv.parse(e,a))/(Math.PI*2),d=ka(s)?s.number/100:0,u=ka(i)?i.number/100:0,f=typeof l<"u"&&ka(l)?Nr(l,1):1;if(d===0)return Cc(u*255,u*255,u*255,1);var p=u<=.5?u*(d+1):u+d-u*d,x=u*2-p,m=G2(x,p,o+1/3),b=G2(x,p,o),v=G2(x,p,o-1/3);return Cc(m*255,b*255,v*255,f)},$Be={hsl:IU,hsla:IU,rgb:FU,rgba:FU},Lf=function(e,t){return Ec.parse(e,DH.create(t).parseComponentValue())},fo={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},VBe={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(r){if(pr(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},GBe={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},mv=function(e,t){var r=Ec.parse(e,t[0]),a=t[1];return a&&ka(a)?{color:r,stop:a}:{color:r,stop:null}},DU=function(e,t){var r=e[0],a=e[e.length-1];r.stop===null&&(r.stop=bn),a.stop===null&&(a.stop=Nc);for(var s=[],i=0,l=0;l<e.length;l++){var o=e[l].stop;if(o!==null){var d=Nr(o,t);d>i?s.push(d):s.push(i),i=d}else s.push(null)}for(var u=null,l=0;l<s.length;l++){var f=s[l];if(f===null)u===null&&(u=l);else if(u!==null){for(var p=l-u,x=s[u-1],m=(f-x)/(p+1),b=1;b<=p;b++)s[u+b-1]=m*b;u=null}}return e.map(function(v,y){var k=v.color;return{color:k,stop:Math.max(Math.min(1,s[y]/t),0)}})},KBe=function(e,t,r){var a=t/2,s=r/2,i=Nr(e[0],t)-a,l=s-Nr(e[1],r);return(Math.atan2(l,i)+Math.PI*2)%(Math.PI*2)},qBe=function(e,t,r){var a=typeof e=="number"?e:KBe(e,t,r),s=Math.abs(t*Math.sin(a))+Math.abs(r*Math.cos(a)),i=t/2,l=r/2,o=s/2,d=Math.sin(a-Math.PI/2)*o,u=Math.cos(a-Math.PI/2)*o;return[s,i-u,i+u,l-d,l+d]},Fi=function(e,t){return Math.sqrt(e*e+t*t)},UU=function(e,t,r,a,s){var i=[[0,0],[0,t],[e,0],[e,t]];return i.reduce(function(l,o){var d=o[0],u=o[1],f=Fi(r-d,a-u);return(s?f<l.optimumDistance:f>l.optimumDistance)?{optimumCorner:o,optimumDistance:f}:l},{optimumDistance:s?1/0:-1/0,optimumCorner:null}).optimumCorner},WBe=function(e,t,r,a,s){var i=0,l=0;switch(e.size){case 0:e.shape===0?i=l=Math.min(Math.abs(t),Math.abs(t-a),Math.abs(r),Math.abs(r-s)):e.shape===1&&(i=Math.min(Math.abs(t),Math.abs(t-a)),l=Math.min(Math.abs(r),Math.abs(r-s)));break;case 2:if(e.shape===0)i=l=Math.min(Fi(t,r),Fi(t,r-s),Fi(t-a,r),Fi(t-a,r-s));else if(e.shape===1){var o=Math.min(Math.abs(r),Math.abs(r-s))/Math.min(Math.abs(t),Math.abs(t-a)),d=UU(a,s,t,r,!0),u=d[0],f=d[1];i=Fi(u-t,(f-r)/o),l=o*i}break;case 1:e.shape===0?i=l=Math.max(Math.abs(t),Math.abs(t-a),Math.abs(r),Math.abs(r-s)):e.shape===1&&(i=Math.max(Math.abs(t),Math.abs(t-a)),l=Math.max(Math.abs(r),Math.abs(r-s)));break;case 3:if(e.shape===0)i=l=Math.max(Fi(t,r),Fi(t,r-s),Fi(t-a,r),Fi(t-a,r-s));else if(e.shape===1){var o=Math.max(Math.abs(r),Math.abs(r-s))/Math.max(Math.abs(t),Math.abs(t-a)),p=UU(a,s,t,r,!1),u=p[0],f=p[1];i=Fi(u-t,(f-r)/o),l=o*i}break}return Array.isArray(e.size)&&(i=Nr(e.size[0],a),l=e.size.length===2?Nr(e.size[1],s):i),[i,l]},YBe=function(e,t){var r=hi(180),a=[];return Fl(t).forEach(function(s,i){if(i===0){var l=s[0];if(l.type===20&&l.value==="to"){r=HH(s);return}else if(QH(l)){r=xv.parse(e,l);return}}var o=mv(e,s);a.push(o)}),{angle:r,stops:a,type:1}},Am=function(e,t){var r=hi(180),a=[];return Fl(t).forEach(function(s,i){if(i===0){var l=s[0];if(l.type===20&&["top","left","right","bottom"].indexOf(l.value)!==-1){r=HH(s);return}else if(QH(l)){r=(xv.parse(e,l)+hi(270))%hi(360);return}}var o=mv(e,s);a.push(o)}),{angle:r,stops:a,type:1}},XBe=function(e,t){var r=hi(180),a=[],s=1,i=0,l=3,o=[];return Fl(t).forEach(function(d,u){var f=d[0];if(u===0){if(pr(f)&&f.value==="linear"){s=1;return}else if(pr(f)&&f.value==="radial"){s=2;return}}if(f.type===18){if(f.name==="from"){var p=Ec.parse(e,f.values[0]);a.push({stop:bn,color:p})}else if(f.name==="to"){var p=Ec.parse(e,f.values[0]);a.push({stop:Nc,color:p})}else if(f.name==="color-stop"){var x=f.values.filter(MA);if(x.length===2){var p=Ec.parse(e,x[1]),m=x[0];n0(m)&&a.push({stop:{type:16,number:m.number*100,flags:m.flags},color:p})}}}}),s===1?{angle:(r+hi(180))%hi(360),stops:a,type:s}:{size:l,shape:i,stops:a,position:o,type:s}},zH="closest-side",$H="farthest-side",VH="closest-corner",GH="farthest-corner",KH="circle",qH="ellipse",WH="cover",YH="contain",JBe=function(e,t){var r=0,a=3,s=[],i=[];return Fl(t).forEach(function(l,o){var d=!0;if(o===0){var u=!1;d=l.reduce(function(p,x){if(u)if(pr(x))switch(x.value){case"center":return i.push(HE),p;case"top":case"left":return i.push(bn),p;case"right":case"bottom":return i.push(Nc),p}else(ka(x)||Rc(x))&&i.push(x);else if(pr(x))switch(x.value){case KH:return r=0,!1;case qH:return r=1,!1;case"at":return u=!0,!1;case zH:return a=0,!1;case WH:case $H:return a=1,!1;case YH:case VH:return a=2,!1;case GH:return a=3,!1}else if(Rc(x)||ka(x))return Array.isArray(a)||(a=[]),a.push(x),!1;return p},d)}if(d){var f=mv(e,l);s.push(f)}}),{size:a,shape:r,stops:s,position:i,type:2}},fm=function(e,t){var r=0,a=3,s=[],i=[];return Fl(t).forEach(function(l,o){var d=!0;if(o===0?d=l.reduce(function(f,p){if(pr(p))switch(p.value){case"center":return i.push(HE),!1;case"top":case"left":return i.push(bn),!1;case"right":case"bottom":return i.push(Nc),!1}else if(ka(p)||Rc(p))return i.push(p),!1;return f},d):o===1&&(d=l.reduce(function(f,p){if(pr(p))switch(p.value){case KH:return r=0,!1;case qH:return r=1,!1;case YH:case zH:return a=0,!1;case $H:return a=1,!1;case VH:return a=2,!1;case WH:case GH:return a=3,!1}else if(Rc(p)||ka(p))return Array.isArray(a)||(a=[]),a.push(p),!1;return f},d)),d){var u=mv(e,l);s.push(u)}}),{size:a,shape:r,stops:s,position:i,type:2}},ZBe=function(e){return e.type===1},e4e=function(e){return e.type===2},zE={name:"image",parse:function(e,t){if(t.type===22){var r={url:t.value,type:0};return e.cache.addImage(t.value),r}if(t.type===18){var a=XH[t.name];if(typeof a>"u")throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return a(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function t4e(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!XH[e.name])}var XH={"linear-gradient":YBe,"-moz-linear-gradient":Am,"-ms-linear-gradient":Am,"-o-linear-gradient":Am,"-webkit-linear-gradient":Am,"radial-gradient":JBe,"-moz-radial-gradient":fm,"-ms-radial-gradient":fm,"-o-radial-gradient":fm,"-webkit-radial-gradient":fm,"-webkit-gradient":XBe},r4e={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var r=t[0];return r.type===20&&r.value==="none"?[]:t.filter(function(a){return MA(a)&&t4e(a)}).map(function(a){return zE.parse(e,a)})}},a4e={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(r){if(pr(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},n4e={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return Fl(t).map(function(r){return r.filter(ka)}).map(MH)}},s4e={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return Fl(t).map(function(r){return r.filter(pr).map(function(a){return a.value}).join(" ")}).map(i4e)}},i4e=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},CA;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(CA||(CA={}));var l4e={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return Fl(t).map(function(r){return r.filter(o4e)})}},o4e=function(e){return pr(e)||ka(e)},gv=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},c4e=gv("top"),d4e=gv("right"),u4e=gv("bottom"),A4e=gv("left"),bv=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(t,r){return MH(r.filter(ka))}}},f4e=bv("top-left"),p4e=bv("top-right"),h4e=bv("bottom-right"),x4e=bv("bottom-left"),vv=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(t,r){switch(r){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},m4e=vv("top"),g4e=vv("right"),b4e=vv("bottom"),v4e=vv("left"),yv=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,r){return sh(r)?r.number:0}}},y4e=yv("top"),w4e=yv("right"),N4e=yv("bottom"),C4e=yv("left"),k4e={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},j4e={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},E4e={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(pr).reduce(function(r,a){return r|S4e(a.value)},0)}},S4e=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},B4e={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},_4e={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return t.type===20&&t.value==="normal"?0:t.type===17||t.type===15?t.number:0}},Zg;(function(e){e.NORMAL="normal",e.STRICT="strict"})(Zg||(Zg={}));var T4e={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return Zg.STRICT;case"normal":default:return Zg.NORMAL}}},F4e={name:"line-height",initialValue:"normal",prefix:!1,type:4},MU=function(e,t){return pr(e)&&e.value==="normal"?1.2*t:e.type===17?t*e.number:ka(e)?Nr(e,t):t},I4e={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value==="none"?null:zE.parse(e,t)}},D4e={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){switch(t){case"inside":return 0;case"outside":default:return 1}}},$C={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},wv=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},U4e=wv("top"),M4e=wv("right"),R4e=wv("bottom"),O4e=wv("left"),P4e={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(pr).map(function(r){switch(r.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},L4e={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-word":return"break-word";case"normal":default:return"normal"}}},Nv=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Q4e=Nv("top"),H4e=Nv("right"),z4e=Nv("bottom"),$4e=Nv("left"),V4e={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},G4e={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},K4e={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&zC(t[0],"none")?[]:Fl(t).map(function(r){for(var a={color:fo.TRANSPARENT,offsetX:bn,offsetY:bn,blur:bn},s=0,i=0;i<r.length;i++){var l=r[i];Rc(l)?(s===0?a.offsetX=l:s===1?a.offsetY=l:a.blur=l,s++):a.color=Ec.parse(e,l)}return a})}},q4e={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},W4e={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(t.type===20&&t.value==="none")return null;if(t.type===18){var r=J4e[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return r(t.values)}return null}},Y4e=function(e){var t=e.filter(function(r){return r.type===17}).map(function(r){return r.number});return t.length===6?t:null},X4e=function(e){var t=e.filter(function(d){return d.type===17}).map(function(d){return d.number}),r=t[0],a=t[1];t[2],t[3];var s=t[4],i=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var l=t[12],o=t[13];return t[14],t[15],t.length===16?[r,a,s,i,l,o]:null},J4e={matrix:Y4e,matrix3d:X4e},RU={type:16,number:50,flags:nh},Z4e=[RU,RU],e_e={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var r=t.filter(ka);return r.length!==2?Z4e:[r[0],r[1]]}},t_e={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},Qf;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(Qf||(Qf={}));var r_e={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return Qf.BREAK_ALL;case"keep-all":return Qf.KEEP_ALL;case"normal":default:return Qf.NORMAL}}},a_e={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(t.type===20)return{auto:!0,order:0};if(n0(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},JH={name:"time",parse:function(e,t){if(t.type===15)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},n_e={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return n0(t)?t.number:1}},s_e={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},i_e={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(pr).map(function(r){switch(r.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(r){return r!==0})}},l_e={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var r=[],a=[];return t.forEach(function(s){switch(s.type){case 20:case 0:r.push(s.value);break;case 17:r.push(s.number.toString());break;case 4:a.push(r.join(" ")),r.length=0;break}}),r.length&&a.push(r.join(" ")),a.map(function(s){return s.indexOf(" ")===-1?s:"'"+s+"'"})}},o_e={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},c_e={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){if(n0(t))return t.number;if(pr(t))switch(t.value){case"bold":return 700;case"normal":default:return 400}return 400}},d_e={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(pr).map(function(r){return r.value})}},u_e={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},Oa=function(e,t){return(e&t)!==0},A_e={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var r=t[0];return r.type===20&&r.value==="none"?[]:t}},f_e={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var r=t[0];if(r.type===20&&r.value==="none")return null;for(var a=[],s=t.filter(UH),i=0;i<s.length;i++){var l=s[i],o=s[i+1];if(l.type===20){var d=o&&n0(o)?o.number:1;a.push({counter:l.value,increment:d})}}return a}},p_e={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return[];for(var r=[],a=t.filter(UH),s=0;s<a.length;s++){var i=a[s],l=a[s+1];if(pr(i)&&i.value!=="none"){var o=l&&n0(l)?l.number:0;r.push({counter:i.value,reset:o})}}return r}},h_e={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(sh).map(function(r){return JH.parse(e,r)})}},x_e={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var r=t[0];if(r.type===20&&r.value==="none")return null;var a=[],s=t.filter(HBe);if(s.length%2!==0)return null;for(var i=0;i<s.length;i+=2){var l=s[i].value,o=s[i+1].value;a.push({open:l,close:o})}return a}},OU=function(e,t,r){if(!e)return"";var a=e[Math.min(t,e.length-1)];return a?r?a.open:a.close:""},m_e={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&zC(t[0],"none")?[]:Fl(t).map(function(r){for(var a={color:255,offsetX:bn,offsetY:bn,blur:bn,spread:bn,inset:!1},s=0,i=0;i<r.length;i++){var l=r[i];zC(l,"inset")?a.inset=!0:Rc(l)?(s===0?a.offsetX=l:s===1?a.offsetY=l:s===2?a.blur=l:a.spread=l,s++):a.color=Ec.parse(e,l)}return a})}},g_e={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var r=[0,1,2],a=[];return t.filter(pr).forEach(function(s){switch(s.value){case"stroke":a.push(1);break;case"fill":a.push(0);break;case"markers":a.push(2);break}}),r.forEach(function(s){a.indexOf(s)===-1&&a.push(s)}),a}},b_e={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},v_e={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return sh(t)?t.number:0}},y_e=(function(){function e(t,r){var a,s;this.animationDuration=at(t,h_e,r.animationDuration),this.backgroundClip=at(t,VBe,r.backgroundClip),this.backgroundColor=at(t,GBe,r.backgroundColor),this.backgroundImage=at(t,r4e,r.backgroundImage),this.backgroundOrigin=at(t,a4e,r.backgroundOrigin),this.backgroundPosition=at(t,n4e,r.backgroundPosition),this.backgroundRepeat=at(t,s4e,r.backgroundRepeat),this.backgroundSize=at(t,l4e,r.backgroundSize),this.borderTopColor=at(t,c4e,r.borderTopColor),this.borderRightColor=at(t,d4e,r.borderRightColor),this.borderBottomColor=at(t,u4e,r.borderBottomColor),this.borderLeftColor=at(t,A4e,r.borderLeftColor),this.borderTopLeftRadius=at(t,f4e,r.borderTopLeftRadius),this.borderTopRightRadius=at(t,p4e,r.borderTopRightRadius),this.borderBottomRightRadius=at(t,h4e,r.borderBottomRightRadius),this.borderBottomLeftRadius=at(t,x4e,r.borderBottomLeftRadius),this.borderTopStyle=at(t,m4e,r.borderTopStyle),this.borderRightStyle=at(t,g4e,r.borderRightStyle),this.borderBottomStyle=at(t,b4e,r.borderBottomStyle),this.borderLeftStyle=at(t,v4e,r.borderLeftStyle),this.borderTopWidth=at(t,y4e,r.borderTopWidth),this.borderRightWidth=at(t,w4e,r.borderRightWidth),this.borderBottomWidth=at(t,N4e,r.borderBottomWidth),this.borderLeftWidth=at(t,C4e,r.borderLeftWidth),this.boxShadow=at(t,m_e,r.boxShadow),this.color=at(t,k4e,r.color),this.direction=at(t,j4e,r.direction),this.display=at(t,E4e,r.display),this.float=at(t,B4e,r.cssFloat),this.fontFamily=at(t,l_e,r.fontFamily),this.fontSize=at(t,o_e,r.fontSize),this.fontStyle=at(t,u_e,r.fontStyle),this.fontVariant=at(t,d_e,r.fontVariant),this.fontWeight=at(t,c_e,r.fontWeight),this.letterSpacing=at(t,_4e,r.letterSpacing),this.lineBreak=at(t,T4e,r.lineBreak),this.lineHeight=at(t,F4e,r.lineHeight),this.listStyleImage=at(t,I4e,r.listStyleImage),this.listStylePosition=at(t,D4e,r.listStylePosition),this.listStyleType=at(t,$C,r.listStyleType),this.marginTop=at(t,U4e,r.marginTop),this.marginRight=at(t,M4e,r.marginRight),this.marginBottom=at(t,R4e,r.marginBottom),this.marginLeft=at(t,O4e,r.marginLeft),this.opacity=at(t,n_e,r.opacity);var i=at(t,P4e,r.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=at(t,L4e,r.overflowWrap),this.paddingTop=at(t,Q4e,r.paddingTop),this.paddingRight=at(t,H4e,r.paddingRight),this.paddingBottom=at(t,z4e,r.paddingBottom),this.paddingLeft=at(t,$4e,r.paddingLeft),this.paintOrder=at(t,g_e,r.paintOrder),this.position=at(t,G4e,r.position),this.textAlign=at(t,V4e,r.textAlign),this.textDecorationColor=at(t,s_e,(a=r.textDecorationColor)!==null&&a!==void 0?a:r.color),this.textDecorationLine=at(t,i_e,(s=r.textDecorationLine)!==null&&s!==void 0?s:r.textDecoration),this.textShadow=at(t,K4e,r.textShadow),this.textTransform=at(t,q4e,r.textTransform),this.transform=at(t,W4e,r.transform),this.transformOrigin=at(t,e_e,r.transformOrigin),this.visibility=at(t,t_e,r.visibility),this.webkitTextStrokeColor=at(t,b_e,r.webkitTextStrokeColor),this.webkitTextStrokeWidth=at(t,v_e,r.webkitTextStrokeWidth),this.wordBreak=at(t,r_e,r.wordBreak),this.zIndex=at(t,a_e,r.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return Sc(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return Oa(this.display,4)||Oa(this.display,33554432)||Oa(this.display,268435456)||Oa(this.display,536870912)||Oa(this.display,67108864)||Oa(this.display,134217728)},e})(),w_e=(function(){function e(t,r){this.content=at(t,A_e,r.content),this.quotes=at(t,x_e,r.quotes)}return e})(),PU=(function(){function e(t,r){this.counterIncrement=at(t,f_e,r.counterIncrement),this.counterReset=at(t,p_e,r.counterReset)}return e})(),at=function(e,t,r){var a=new IH,s=r!==null&&typeof r<"u"?r.toString():t.initialValue;a.write(s);var i=new DH(a.read());switch(t.type){case 2:var l=i.parseComponentValue();return t.parse(e,pr(l)?l.value:t.initialValue);case 0:return t.parse(e,i.parseComponentValue());case 1:return t.parse(e,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(t.format){case"angle":return xv.parse(e,i.parseComponentValue());case"color":return Ec.parse(e,i.parseComponentValue());case"image":return zE.parse(e,i.parseComponentValue());case"length":var o=i.parseComponentValue();return Rc(o)?o:bn;case"length-percentage":var d=i.parseComponentValue();return ka(d)?d:bn;case"time":return JH.parse(e,i.parseComponentValue())}break}},N_e="data-html2canvas-debug",C_e=function(e){var t=e.getAttribute(N_e);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},VC=function(e,t){var r=C_e(e);return r===1||t===r},Il=(function(){function e(t,r){if(this.context=t,this.textNodes=[],this.elements=[],this.flags=0,VC(r,3))debugger;this.styles=new y_e(t,window.getComputedStyle(r,null)),qC(r)&&(this.styles.animationDuration.some(function(a){return a>0})&&(r.style.animationDuration="0s"),this.styles.transform!==null&&(r.style.transform="none")),this.bounds=pv(this.context,r),VC(r,4)&&(this.flags|=16)}return e})(),k_e=" ",LU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var pm=0;pm<LU.length;pm++)Sf[LU.charCodeAt(pm)]=pm;var j_e=function(e){var t=e.length*.75,r=e.length,a,s=0,i,l,o,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),f=Array.isArray(u)?u:new Uint8Array(u);for(a=0;a<r;a+=4)i=Sf[e.charCodeAt(a)],l=Sf[e.charCodeAt(a+1)],o=Sf[e.charCodeAt(a+2)],d=Sf[e.charCodeAt(a+3)],f[s++]=i<<2|l>>4,f[s++]=(l&15)<<4|o>>2,f[s++]=(o&3)<<6|d&63;return u},E_e=function(e){for(var t=e.length,r=[],a=0;a<t;a+=2)r.push(e[a+1]<<8|e[a]);return r},S_e=function(e){for(var t=e.length,r=[],a=0;a<t;a+=4)r.push(e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a]);return r},Ud=5,$E=11,K2=2,B_e=$E-Ud,ZH=65536>>Ud,__e=1<<Ud,q2=__e-1,T_e=1024>>Ud,F_e=ZH+T_e,I_e=F_e,D_e=32,U_e=I_e+D_e,M_e=65536>>$E,R_e=1<<B_e,O_e=R_e-1,QU=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},P_e=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},L_e=function(e,t){var r=j_e(e),a=Array.isArray(r)?S_e(r):new Uint32Array(r),s=Array.isArray(r)?E_e(r):new Uint16Array(r),i=24,l=QU(s,i/2,a[4]/2),o=a[5]===2?QU(s,(i+a[4])/2):P_e(a,Math.ceil((i+a[4])/4));return new Q_e(a[0],a[1],a[2],a[3],l,o)},Q_e=(function(){function e(t,r,a,s,i,l){this.initialValue=t,this.errorValue=r,this.highStart=a,this.highValueIndex=s,this.index=i,this.data=l}return e.prototype.get=function(t){var r;if(t>=0){if(t<55296||t>56319&&t<=65535)return r=this.index[t>>Ud],r=(r<<K2)+(t&q2),this.data[r];if(t<=65535)return r=this.index[ZH+(t-55296>>Ud)],r=(r<<K2)+(t&q2),this.data[r];if(t<this.highStart)return r=U_e-M_e+(t>>$E),r=this.index[r],r+=t>>Ud&O_e,r=this.index[r],r=(r<<K2)+(t&q2),this.data[r];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),HU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H_e=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var hm=0;hm<HU.length;hm++)H_e[HU.charCodeAt(hm)]=hm;var z_e=1,W2=2,Y2=3,zU=4,$U=5,$_e=7,VU=8,X2=9,J2=10,GU=11,KU=12,qU=13,WU=14,Z2=15,V_e=function(e){for(var t=[],r=0,a=e.length;r<a;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){var i=e.charCodeAt(r++);(i&64512)===56320?t.push(((s&1023)<<10)+(i&1023)+65536):(t.push(s),r--)}else t.push(s)}return t},G_e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var a=[],s=-1,i="";++s<r;){var l=e[s];l<=65535?a.push(l):(l-=65536,a.push((l>>10)+55296,l%1024+56320)),(s+1===r||a.length>16384)&&(i+=String.fromCharCode.apply(String,a),a.length=0)}return i},K_e=L_e(k_e),ci="×",eN="÷",q_e=function(e){return K_e.get(e)},W_e=function(e,t,r){var a=r-2,s=t[a],i=t[r-1],l=t[r];if(i===W2&&l===Y2)return ci;if(i===W2||i===Y2||i===zU||l===W2||l===Y2||l===zU)return eN;if(i===VU&&[VU,X2,GU,KU].indexOf(l)!==-1||(i===GU||i===X2)&&(l===X2||l===J2)||(i===KU||i===J2)&&l===J2||l===qU||l===$U||l===$_e||i===z_e)return ci;if(i===qU&&l===WU){for(;s===$U;)s=t[--a];if(s===WU)return ci}if(i===Z2&&l===Z2){for(var o=0;s===Z2;)o++,s=t[--a];if(o%2===0)return ci}return eN},Y_e=function(e){var t=V_e(e),r=t.length,a=0,s=0,i=t.map(q_e);return{next:function(){if(a>=r)return{done:!0,value:null};for(var l=ci;a<r&&(l=W_e(t,i,++a))===ci;);if(l!==ci||a===r){var o=G_e.apply(null,t.slice(s,a));return s=a,{value:o,done:!1}}return{done:!0,value:null}}}},X_e=function(e){for(var t=Y_e(e),r=[],a;!(a=t.next()).done;)a.value&&r.push(a.value.slice());return r},J_e=function(e){var t=123;if(e.createRange){var r=e.createRange();if(r.getBoundingClientRect){var a=e.createElement("boundtest");a.style.height=t+"px",a.style.display="block",e.body.appendChild(a),r.selectNode(a);var s=r.getBoundingClientRect(),i=Math.round(s.height);if(e.body.removeChild(a),i===t)return!0}}return!1},Z_e=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var r=e.createRange();t.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var a=t.firstChild,s=hv(a.data).map(function(d){return fa(d)}),i=0,l={},o=s.every(function(d,u){r.setStart(a,i),r.setEnd(a,i+d.length);var f=r.getBoundingClientRect();i+=d.length;var p=f.x>l.x||f.y>l.y;return l=f,u===0?!0:p});return e.body.removeChild(t),o},eTe=function(){return typeof new Image().crossOrigin<"u"},tTe=function(){return typeof new XMLHttpRequest().responseType=="string"},rTe=function(e){var t=new Image,r=e.createElement("canvas"),a=r.getContext("2d");if(!a)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{a.drawImage(t,0,0),r.toDataURL()}catch{return!1}return!0},YU=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},aTe=function(e){var t=e.createElement("canvas"),r=100;t.width=r,t.height=r;var a=t.getContext("2d");if(!a)return Promise.reject(!1);a.fillStyle="rgb(0, 255, 0)",a.fillRect(0,0,r,r);var s=new Image,i=t.toDataURL();s.src=i;var l=GC(r,r,0,0,s);return a.fillStyle="red",a.fillRect(0,0,r,r),XU(l).then(function(o){a.drawImage(o,0,0);var d=a.getImageData(0,0,r,r).data;a.fillStyle="red",a.fillRect(0,0,r,r);var u=e.createElement("div");return u.style.backgroundImage="url("+i+")",u.style.height=r+"px",YU(d)?XU(GC(r,r,0,0,u)):Promise.reject(!1)}).then(function(o){return a.drawImage(o,0,0),YU(a.getImageData(0,0,r,r).data)}).catch(function(){return!1})},GC=function(e,t,r,a,s){var i="http://www.w3.org/2000/svg",l=document.createElementNS(i,"svg"),o=document.createElementNS(i,"foreignObject");return l.setAttributeNS(null,"width",e.toString()),l.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",r.toString()),o.setAttributeNS(null,"y",a.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),l.appendChild(o),o.appendChild(s),l},XU=function(e){return new Promise(function(t,r){var a=new Image;a.onload=function(){return t(a)},a.onerror=r,a.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},hn={get SUPPORT_RANGE_BOUNDS(){var e=J_e(document);return Object.defineProperty(hn,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=hn.SUPPORT_RANGE_BOUNDS&&Z_e(document);return Object.defineProperty(hn,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=rTe(document);return Object.defineProperty(hn,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?aTe(document):Promise.resolve(!1);return Object.defineProperty(hn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=eTe();return Object.defineProperty(hn,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=tTe();return Object.defineProperty(hn,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(hn,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(hn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Hf=(function(){function e(t,r){this.text=t,this.bounds=r}return e})(),nTe=function(e,t,r,a){var s=lTe(t,r),i=[],l=0;return s.forEach(function(o){if(r.textDecorationLine.length||o.trim().length>0)if(hn.SUPPORT_RANGE_BOUNDS){var d=JU(a,l,o.length).getClientRects();if(d.length>1){var u=VE(o),f=0;u.forEach(function(x){i.push(new Hf(x,Co.fromDOMRectList(e,JU(a,f+l,x.length).getClientRects()))),f+=x.length})}else i.push(new Hf(o,Co.fromDOMRectList(e,d)))}else{var p=a.splitText(o.length);i.push(new Hf(o,sTe(e,a))),a=p}else hn.SUPPORT_RANGE_BOUNDS||(a=a.splitText(o.length));l+=o.length}),i},sTe=function(e,t){var r=t.ownerDocument;if(r){var a=r.createElement("html2canvaswrapper");a.appendChild(t.cloneNode(!0));var s=t.parentNode;if(s){s.replaceChild(a,t);var i=pv(e,a);return a.firstChild&&s.replaceChild(a.firstChild,a),i}}return Co.EMPTY},JU=function(e,t,r){var a=e.ownerDocument;if(!a)throw new Error("Node has no owner document");var s=a.createRange();return s.setStart(e,t),s.setEnd(e,t+r),s},VE=function(e){if(hn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(r){return r.segment})}return X_e(e)},iTe=function(e,t){if(hn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var r=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(r.segment(e)).map(function(a){return a.segment})}return cTe(e,t)},lTe=function(e,t){return t.letterSpacing!==0?VE(e):iTe(e,t)},oTe=[32,160,4961,65792,65793,4153,4241],cTe=function(e,t){for(var r=MSe(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap==="break-word"?"break-word":t.wordBreak}),a=[],s,i=function(){if(s.value){var l=s.value.slice(),o=hv(l),d="";o.forEach(function(u){oTe.indexOf(u)===-1?d+=fa(u):(d.length&&a.push(d),a.push(fa(u)),d="")}),d.length&&a.push(d)}};!(s=r.next()).done;)i();return a},dTe=(function(){function e(t,r,a){this.text=uTe(r.data,a.textTransform),this.textBounds=nTe(t,this.text,a,r)}return e})(),uTe=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(ATe,fTe);case 2:return e.toUpperCase();default:return e}},ATe=/(^|\s|:|-|\(|\))([a-z])/g,fTe=function(e,t,r){return e.length>0?t+r.toUpperCase():e},ez=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.src=a.currentSrc||a.src,s.intrinsicWidth=a.naturalWidth,s.intrinsicHeight=a.naturalHeight,s.context.cache.addImage(s.src),s}return t})(Il),tz=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.canvas=a,s.intrinsicWidth=a.width,s.intrinsicHeight=a.height,s}return t})(Il),rz=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this,i=new XMLSerializer,l=pv(r,a);return a.setAttribute("width",l.width+"px"),a.setAttribute("height",l.height+"px"),s.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(a)),s.intrinsicWidth=a.width.baseVal.value,s.intrinsicHeight=a.height.baseVal.value,s.context.cache.addImage(s.svg),s}return t})(Il),az=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.value=a.value,s}return t})(Il),KC=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.start=a.start,s.reversed=typeof a.reversed=="boolean"&&a.reversed===!0,s}return t})(Il),pTe=[{type:15,flags:0,unit:"px",number:3}],hTe=[{type:16,flags:0,number:50}],xTe=function(e){return e.width>e.height?new Co(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new Co(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},mTe=function(e){var t=e.type===gTe?new Array(e.value.length+1).join("•"):e.value;return t.length===0?e.placeholder||"":t},eb="checkbox",tb="radio",gTe="password",ZU=707406591,GE=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;switch(s.type=a.type.toLowerCase(),s.checked=a.checked,s.value=mTe(a),(s.type===eb||s.type===tb)&&(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=1,s.styles.backgroundClip=[0],s.styles.backgroundOrigin=[0],s.bounds=xTe(s.bounds)),s.type){case eb:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=pTe;break;case tb:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=hTe;break}return s}return t})(Il),nz=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this,i=a.options[a.selectedIndex||0];return s.value=i&&i.text||"",s}return t})(Il),sz=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.value=a.value,s}return t})(Il),iz=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;s.src=a.src,s.width=parseInt(a.width,10)||0,s.height=parseInt(a.height,10)||0,s.backgroundColor=s.styles.backgroundColor;try{if(a.contentWindow&&a.contentWindow.document&&a.contentWindow.document.documentElement){s.tree=oz(r,a.contentWindow.document.documentElement);var i=a.contentWindow.document.documentElement?Lf(r,getComputedStyle(a.contentWindow.document.documentElement).backgroundColor):fo.TRANSPARENT,l=a.contentWindow.document.body?Lf(r,getComputedStyle(a.contentWindow.document.body).backgroundColor):fo.TRANSPARENT;s.backgroundColor=Sc(i)?Sc(l)?s.styles.backgroundColor:l:i}}catch{}return s}return t})(Il),bTe=["OL","UL","MENU"],Um=function(e,t,r,a){for(var s=t.firstChild,i=void 0;s;s=i)if(i=s.nextSibling,cz(s)&&s.data.trim().length>0)r.textNodes.push(new dTe(e,s,r.styles));else if(hA(s))if(fz(s)&&s.assignedNodes)s.assignedNodes().forEach(function(o){return Um(e,o,r,a)});else{var l=lz(e,s);l.styles.isVisible()&&(vTe(s,l,a)?l.flags|=4:yTe(l.styles)&&(l.flags|=2),bTe.indexOf(s.tagName)!==-1&&(l.flags|=8),r.elements.push(l),s.slot,s.shadowRoot?Um(e,s.shadowRoot,l,a):!rb(s)&&!dz(s)&&!ab(s)&&Um(e,s,l,a))}},lz=function(e,t){return WC(t)?new ez(e,t):uz(t)?new tz(e,t):dz(t)?new rz(e,t):wTe(t)?new az(e,t):NTe(t)?new KC(e,t):CTe(t)?new GE(e,t):ab(t)?new nz(e,t):rb(t)?new sz(e,t):Az(t)?new iz(e,t):new Il(e,t)},oz=function(e,t){var r=lz(e,t);return r.flags|=4,Um(e,t,r,r),r},vTe=function(e,t,r){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||KE(e)&&r.styles.isTransparent()},yTe=function(e){return e.isPositioned()||e.isFloating()},cz=function(e){return e.nodeType===Node.TEXT_NODE},hA=function(e){return e.nodeType===Node.ELEMENT_NODE},qC=function(e){return hA(e)&&typeof e.style<"u"&&!Mm(e)},Mm=function(e){return typeof e.className=="object"},wTe=function(e){return e.tagName==="LI"},NTe=function(e){return e.tagName==="OL"},CTe=function(e){return e.tagName==="INPUT"},kTe=function(e){return e.tagName==="HTML"},dz=function(e){return e.tagName==="svg"},KE=function(e){return e.tagName==="BODY"},uz=function(e){return e.tagName==="CANVAS"},eM=function(e){return e.tagName==="VIDEO"},WC=function(e){return e.tagName==="IMG"},Az=function(e){return e.tagName==="IFRAME"},tM=function(e){return e.tagName==="STYLE"},jTe=function(e){return e.tagName==="SCRIPT"},rb=function(e){return e.tagName==="TEXTAREA"},ab=function(e){return e.tagName==="SELECT"},fz=function(e){return e.tagName==="SLOT"},rM=function(e){return e.tagName.indexOf("-")>0},ETe=(function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(t){var r=this.counters[t];return r&&r.length?r[r.length-1]:1},e.prototype.getCounterValues=function(t){var r=this.counters[t];return r||[]},e.prototype.pop=function(t){var r=this;t.forEach(function(a){return r.counters[a].pop()})},e.prototype.parse=function(t){var r=this,a=t.counterIncrement,s=t.counterReset,i=!0;a!==null&&a.forEach(function(o){var d=r.counters[o.counter];d&&o.increment!==0&&(i=!1,d.length||d.push(1),d[Math.max(0,d.length-1)]+=o.increment)});var l=[];return i&&s.forEach(function(o){var d=r.counters[o.counter];l.push(o.counter),d||(d=r.counters[o.counter]=[]),d.push(o.reset)}),l},e})(),aM={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},nM={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},STe={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},BTe={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},tA=function(e,t,r,a,s,i){return e<t||e>r?Sp(e,s,i.length>0):a.integers.reduce(function(l,o,d){for(;e>=o;)e-=o,l+=a.values[d];return l},"")+i},pz=function(e,t,r,a){var s="";do r||e--,s=a(e)+s,e/=t;while(e*t>=t);return s},ua=function(e,t,r,a,s){var i=r-t+1;return(e<0?"-":"")+(pz(Math.abs(e),i,a,function(l){return fa(Math.floor(l%i)+t)})+s)},fd=function(e,t,r){r===void 0&&(r=". ");var a=t.length;return pz(Math.abs(e),a,!1,function(s){return t[Math.floor(s%a)]})+r},lA=1,Ac=2,fc=4,Bf=8,eo=function(e,t,r,a,s,i){if(e<-9999||e>9999)return Sp(e,4,s.length>0);var l=Math.abs(e),o=s;if(l===0)return t[0]+o;for(var d=0;l>0&&d<=4;d++){var u=l%10;u===0&&Oa(i,lA)&&o!==""?o=t[u]+o:u>1||u===1&&d===0||u===1&&d===1&&Oa(i,Ac)||u===1&&d===1&&Oa(i,fc)&&e>100||u===1&&d>1&&Oa(i,Bf)?o=t[u]+(d>0?r[d-1]:"")+o:u===1&&d>0&&(o=r[d-1]+o),l=Math.floor(l/10)}return(e<0?a:"")+o},sM="十百千萬",iM="拾佰仟萬",lM="マイナス",tN="마이너스",Sp=function(e,t,r){var a=r?". ":"",s=r?"、":"",i=r?", ":"",l=r?" ":"";switch(t){case 0:return"•"+l;case 1:return"◦"+l;case 2:return"◾"+l;case 5:var o=ua(e,48,57,!0,a);return o.length<4?"0"+o:o;case 4:return fd(e,"〇一二三四五六七八九",s);case 6:return tA(e,1,3999,aM,3,a).toLowerCase();case 7:return tA(e,1,3999,aM,3,a);case 8:return ua(e,945,969,!1,a);case 9:return ua(e,97,122,!1,a);case 10:return ua(e,65,90,!1,a);case 11:return ua(e,1632,1641,!0,a);case 12:case 49:return tA(e,1,9999,nM,3,a);case 35:return tA(e,1,9999,nM,3,a).toLowerCase();case 13:return ua(e,2534,2543,!0,a);case 14:case 30:return ua(e,6112,6121,!0,a);case 15:return fd(e,"子丑寅卯辰巳午未申酉戌亥",s);case 16:return fd(e,"甲乙丙丁戊己庚辛壬癸",s);case 17:case 48:return eo(e,"零一二三四五六七八九",sM,"負",s,Ac|fc|Bf);case 47:return eo(e,"零壹貳參肆伍陸柒捌玖",iM,"負",s,lA|Ac|fc|Bf);case 42:return eo(e,"零一二三四五六七八九",sM,"负",s,Ac|fc|Bf);case 41:return eo(e,"零壹贰叁肆伍陆柒捌玖",iM,"负",s,lA|Ac|fc|Bf);case 26:return eo(e,"〇一二三四五六七八九","十百千万",lM,s,0);case 25:return eo(e,"零壱弐参四伍六七八九","拾百千万",lM,s,lA|Ac|fc);case 31:return eo(e,"영일이삼사오육칠팔구","십백천만",tN,i,lA|Ac|fc);case 33:return eo(e,"零一二三四五六七八九","十百千萬",tN,i,0);case 32:return eo(e,"零壹貳參四五六七八九","拾百千",tN,i,lA|Ac|fc);case 18:return ua(e,2406,2415,!0,a);case 20:return tA(e,1,19999,BTe,3,a);case 21:return ua(e,2790,2799,!0,a);case 22:return ua(e,2662,2671,!0,a);case 22:return tA(e,1,10999,STe,3,a);case 23:return fd(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return fd(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return ua(e,3302,3311,!0,a);case 28:return fd(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",s);case 29:return fd(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",s);case 34:return ua(e,3792,3801,!0,a);case 37:return ua(e,6160,6169,!0,a);case 38:return ua(e,4160,4169,!0,a);case 39:return ua(e,2918,2927,!0,a);case 40:return ua(e,1776,1785,!0,a);case 43:return ua(e,3046,3055,!0,a);case 44:return ua(e,3174,3183,!0,a);case 45:return ua(e,3664,3673,!0,a);case 46:return ua(e,3872,3881,!0,a);case 3:default:return ua(e,48,57,!0,a)}},hz="data-html2canvas-ignore",oM=(function(){function e(t,r,a){if(this.context=t,this.options=a,this.scrolledElements=[],this.referenceElement=r,this.counters=new ETe,this.quoteDepth=0,!r.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(r.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(t,r){var a=this,s=_Te(t,r);if(!s.contentWindow)return Promise.reject("Unable to find iframe window");var i=t.defaultView.pageXOffset,l=t.defaultView.pageYOffset,o=s.contentWindow,d=o.document,u=ITe(s).then(function(){return Hn(a,void 0,void 0,function(){var f,p;return Sn(this,function(x){switch(x.label){case 0:return this.scrolledElements.forEach(RTe),o&&(o.scrollTo(r.left,r.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==r.top||o.scrollX!==r.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-r.left,o.scrollY-r.top,0,0))),f=this.options.onclone,p=this.clonedReferenceElement,typeof p>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:d.fonts&&d.fonts.ready?[4,d.fonts.ready]:[3,2];case 1:x.sent(),x.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,FTe(d)]:[3,4];case 3:x.sent(),x.label=4;case 4:return typeof f=="function"?[2,Promise.resolve().then(function(){return f(d,p)}).then(function(){return s})]:[2,s]}})})});return d.open(),d.write(UTe(document.doctype)+"<html></html>"),MTe(this.referenceElement.ownerDocument,i,l),d.replaceChild(d.adoptNode(this.documentElement),d.documentElement),d.close(),u},e.prototype.createElementClone=function(t){if(VC(t,2))debugger;if(uz(t))return this.createCanvasClone(t);if(eM(t))return this.createVideoClone(t);if(tM(t))return this.createStyleClone(t);var r=t.cloneNode(!1);return WC(r)&&(WC(t)&&t.currentSrc&&t.currentSrc!==t.src&&(r.src=t.currentSrc,r.srcset=""),r.loading==="lazy"&&(r.loading="eager")),rM(r)?this.createCustomElementClone(r):r},e.prototype.createCustomElementClone=function(t){var r=document.createElement("html2canvascustomelement");return rN(t.style,r),r},e.prototype.createStyleClone=function(t){try{var r=t.sheet;if(r&&r.cssRules){var a=[].slice.call(r.cssRules,0).reduce(function(i,l){return l&&typeof l.cssText=="string"?i+l.cssText:i},""),s=t.cloneNode(!1);return s.textContent=a,s}}catch(i){if(this.context.logger.error("Unable to access cssRules property",i),i.name!=="SecurityError")throw i}return t.cloneNode(!1)},e.prototype.createCanvasClone=function(t){var r;if(this.options.inlineImages&&t.ownerDocument){var a=t.ownerDocument.createElement("img");try{return a.src=t.toDataURL(),a}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}var s=t.cloneNode(!1);try{s.width=t.width,s.height=t.height;var i=t.getContext("2d"),l=s.getContext("2d");if(l)if(!this.options.allowTaint&&i)l.putImageData(i.getImageData(0,0,t.width,t.height),0,0);else{var o=(r=t.getContext("webgl2"))!==null&&r!==void 0?r:t.getContext("webgl");if(o){var d=o.getContextAttributes();(d==null?void 0:d.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t)}l.drawImage(t,0,0)}return s}catch{this.context.logger.info("Unable to clone canvas as it is tainted",t)}return s},e.prototype.createVideoClone=function(t){var r=t.ownerDocument.createElement("canvas");r.width=t.offsetWidth,r.height=t.offsetHeight;var a=r.getContext("2d");try{return a&&(a.drawImage(t,0,0,r.width,r.height),this.options.allowTaint||a.getImageData(0,0,r.width,r.height)),r}catch{this.context.logger.info("Unable to clone video as it is tainted",t)}var s=t.ownerDocument.createElement("canvas");return s.width=t.offsetWidth,s.height=t.offsetHeight,s},e.prototype.appendChildNode=function(t,r,a){(!hA(r)||!jTe(r)&&!r.hasAttribute(hz)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(r)))&&(!this.options.copyStyles||!hA(r)||!tM(r))&&t.appendChild(this.cloneNode(r,a))},e.prototype.cloneChildNodes=function(t,r,a){for(var s=this,i=t.shadowRoot?t.shadowRoot.firstChild:t.firstChild;i;i=i.nextSibling)if(hA(i)&&fz(i)&&typeof i.assignedNodes=="function"){var l=i.assignedNodes();l.length&&l.forEach(function(o){return s.appendChildNode(r,o,a)})}else this.appendChildNode(r,i,a)},e.prototype.cloneNode=function(t,r){if(cz(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var a=t.ownerDocument.defaultView;if(a&&hA(t)&&(qC(t)||Mm(t))){var s=this.createElementClone(t);s.style.transitionProperty="none";var i=a.getComputedStyle(t),l=a.getComputedStyle(t,":before"),o=a.getComputedStyle(t,":after");this.referenceElement===t&&qC(s)&&(this.clonedReferenceElement=s),KE(s)&&LTe(s);var d=this.counters.parse(new PU(this.context,i)),u=this.resolvePseudoContent(t,s,l,zf.BEFORE);rM(t)&&(r=!0),eM(t)||this.cloneChildNodes(t,s,r),u&&s.insertBefore(u,s.firstChild);var f=this.resolvePseudoContent(t,s,o,zf.AFTER);return f&&s.appendChild(f),this.counters.pop(d),(i&&(this.options.copyStyles||Mm(t))&&!Az(t)||r)&&rN(i,s),(t.scrollTop!==0||t.scrollLeft!==0)&&this.scrolledElements.push([s,t.scrollLeft,t.scrollTop]),(rb(t)||ab(t))&&(rb(s)||ab(s))&&(s.value=t.value),s}return t.cloneNode(!1)},e.prototype.resolvePseudoContent=function(t,r,a,s){var i=this;if(a){var l=a.content,o=r.ownerDocument;if(!(!o||!l||l==="none"||l==="-moz-alt-content"||a.display==="none")){this.counters.parse(new PU(this.context,a));var d=new w_e(this.context,a),u=o.createElement("html2canvaspseudoelement");rN(a,u),d.content.forEach(function(p){if(p.type===0)u.appendChild(o.createTextNode(p.value));else if(p.type===22){var x=o.createElement("img");x.src=p.value,x.style.opacity="1",u.appendChild(x)}else if(p.type===18){if(p.name==="attr"){var m=p.values.filter(pr);m.length&&u.appendChild(o.createTextNode(t.getAttribute(m[0].value)||""))}else if(p.name==="counter"){var b=p.values.filter(MA),v=b[0],y=b[1];if(v&&pr(v)){var k=i.counters.getCounterValue(v.value),_=y&&pr(y)?$C.parse(i.context,y.value):3;u.appendChild(o.createTextNode(Sp(k,_,!1)))}}else if(p.name==="counters"){var C=p.values.filter(MA),v=C[0],E=C[1],y=C[2];if(v&&pr(v)){var T=i.counters.getCounterValues(v.value),B=y&&pr(y)?$C.parse(i.context,y.value):3,I=E&&E.type===0?E.value:"",M=T.map(function(L){return Sp(L,B,!1)}).join(I);u.appendChild(o.createTextNode(M))}}}else if(p.type===20)switch(p.value){case"open-quote":u.appendChild(o.createTextNode(OU(d.quotes,i.quoteDepth++,!0)));break;case"close-quote":u.appendChild(o.createTextNode(OU(d.quotes,--i.quoteDepth,!1)));break;default:u.appendChild(o.createTextNode(p.value))}}),u.className=YC+" "+XC;var f=s===zf.BEFORE?" "+YC:" "+XC;return Mm(r)?r.className.baseValue+=f:r.className+=f,u}}},e.destroy=function(t){return t.parentNode?(t.parentNode.removeChild(t),!0):!1},e})(),zf;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(zf||(zf={}));var _Te=function(e,t){var r=e.createElement("iframe");return r.className="html2canvas-container",r.style.visibility="hidden",r.style.position="fixed",r.style.left="-10000px",r.style.top="0px",r.style.border="0",r.width=t.width.toString(),r.height=t.height.toString(),r.scrolling="no",r.setAttribute(hz,"true"),e.body.appendChild(r),r},TTe=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},FTe=function(e){return Promise.all([].slice.call(e.images,0).map(TTe))},ITe=function(e){return new Promise(function(t,r){var a=e.contentWindow;if(!a)return r("No window assigned for iframe");var s=a.document;a.onload=e.onload=function(){a.onload=e.onload=null;var i=setInterval(function(){s.body.childNodes.length>0&&s.readyState==="complete"&&(clearInterval(i),t(e))},50)}})},DTe=["all","d","content"],rN=function(e,t){for(var r=e.length-1;r>=0;r--){var a=e.item(r);DTe.indexOf(a)===-1&&t.style.setProperty(a,e.getPropertyValue(a))}return t},UTe=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},MTe=function(e,t,r){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||r!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,r)},RTe=function(e){var t=e[0],r=e[1],a=e[2];t.scrollLeft=r,t.scrollTop=a},OTe=":before",PTe=":after",YC="___html2canvas___pseudoelement_before",XC="___html2canvas___pseudoelement_after",cM=`{
    content: "" !important;
    display: none !important;
}`,LTe=function(e){QTe(e,"."+YC+OTe+cM+`
         .`+XC+PTe+cM)},QTe=function(e,t){var r=e.ownerDocument;if(r){var a=r.createElement("style");a.textContent=t,e.appendChild(a)}},xz=(function(){function e(){}return e.getOrigin=function(t){var r=e._link;return r?(r.href=t,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e})(),HTe=(function(){function e(t,r){this.context=t,this._options=r,this._cache={}}return e.prototype.addImage=function(t){var r=Promise.resolve();return this.has(t)||(nN(t)||GTe(t))&&(this._cache[t]=this.loadImage(t)).catch(function(){}),r},e.prototype.match=function(t){return this._cache[t]},e.prototype.loadImage=function(t){return Hn(this,void 0,void 0,function(){var r,a,s,i,l=this;return Sn(this,function(o){switch(o.label){case 0:return r=xz.isSameOrigin(t),a=!aN(t)&&this._options.useCORS===!0&&hn.SUPPORT_CORS_IMAGES&&!r,s=!aN(t)&&!r&&!nN(t)&&typeof this._options.proxy=="string"&&hn.SUPPORT_CORS_XHR&&!a,!r&&this._options.allowTaint===!1&&!aN(t)&&!nN(t)&&!s&&!a?[2]:(i=t,s?[4,this.proxy(i)]:[3,2]);case 1:i=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(d,u){var f=new Image;f.onload=function(){return d(f)},f.onerror=u,(KTe(i)||a)&&(f.crossOrigin="anonymous"),f.src=i,f.complete===!0&&setTimeout(function(){return d(f)},500),l._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+l._options.imageTimeout+"ms) loading image")},l._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(t){return typeof this._cache[t]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(t){var r=this,a=this._options.proxy;if(!a)throw new Error("No proxy defined");var s=t.substring(0,256);return new Promise(function(i,l){var o=hn.SUPPORT_RESPONSE_TYPE?"blob":"text",d=new XMLHttpRequest;d.onload=function(){if(d.status===200)if(o==="text")i(d.response);else{var p=new FileReader;p.addEventListener("load",function(){return i(p.result)},!1),p.addEventListener("error",function(x){return l(x)},!1),p.readAsDataURL(d.response)}else l("Failed to proxy resource "+s+" with status code "+d.status)},d.onerror=l;var u=a.indexOf("?")>-1?"&":"?";if(d.open("GET",""+a+u+"url="+encodeURIComponent(t)+"&responseType="+o),o!=="text"&&d instanceof XMLHttpRequest&&(d.responseType=o),r._options.imageTimeout){var f=r._options.imageTimeout;d.timeout=f,d.ontimeout=function(){return l("Timed out ("+f+"ms) proxying "+s)}}d.send()})},e})(),zTe=/^data:image\/svg\+xml/i,$Te=/^data:image\/.*;base64,/i,VTe=/^data:image\/.*/i,GTe=function(e){return hn.SUPPORT_SVG_DRAWING||!qTe(e)},aN=function(e){return VTe.test(e)},KTe=function(e){return $Te.test(e)},nN=function(e){return e.substr(0,4)==="blob"},qTe=function(e){return e.substr(-3).toLowerCase()==="svg"||zTe.test(e)},tt=(function(){function e(t,r){this.type=0,this.x=t,this.y=r}return e.prototype.add=function(t,r){return new e(this.x+t,this.y+r)},e})(),rA=function(e,t,r){return new tt(e.x+(t.x-e.x)*r,e.y+(t.y-e.y)*r)},xm=(function(){function e(t,r,a,s){this.type=1,this.start=t,this.startControl=r,this.endControl=a,this.end=s}return e.prototype.subdivide=function(t,r){var a=rA(this.start,this.startControl,t),s=rA(this.startControl,this.endControl,t),i=rA(this.endControl,this.end,t),l=rA(a,s,t),o=rA(s,i,t),d=rA(l,o,t);return r?new e(this.start,a,l,d):new e(d,o,i,this.end)},e.prototype.add=function(t,r){return new e(this.start.add(t,r),this.startControl.add(t,r),this.endControl.add(t,r),this.end.add(t,r))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e})(),ui=function(e){return e.type===1},WTe=(function(){function e(t){var r=t.styles,a=t.bounds,s=Ef(r.borderTopLeftRadius,a.width,a.height),i=s[0],l=s[1],o=Ef(r.borderTopRightRadius,a.width,a.height),d=o[0],u=o[1],f=Ef(r.borderBottomRightRadius,a.width,a.height),p=f[0],x=f[1],m=Ef(r.borderBottomLeftRadius,a.width,a.height),b=m[0],v=m[1],y=[];y.push((i+d)/a.width),y.push((b+p)/a.width),y.push((l+v)/a.height),y.push((u+x)/a.height);var k=Math.max.apply(Math,y);k>1&&(i/=k,l/=k,d/=k,u/=k,p/=k,x/=k,b/=k,v/=k);var _=a.width-d,C=a.height-x,E=a.width-p,T=a.height-v,B=r.borderTopWidth,I=r.borderRightWidth,M=r.borderBottomWidth,U=r.borderLeftWidth,D=Nr(r.paddingTop,t.bounds.width),L=Nr(r.paddingRight,t.bounds.width),R=Nr(r.paddingBottom,t.bounds.width),Q=Nr(r.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||l>0?Rr(a.left+U/3,a.top+B/3,i-U/3,l-B/3,rr.TOP_LEFT):new tt(a.left+U/3,a.top+B/3),this.topRightBorderDoubleOuterBox=i>0||l>0?Rr(a.left+_,a.top+B/3,d-I/3,u-B/3,rr.TOP_RIGHT):new tt(a.left+a.width-I/3,a.top+B/3),this.bottomRightBorderDoubleOuterBox=p>0||x>0?Rr(a.left+E,a.top+C,p-I/3,x-M/3,rr.BOTTOM_RIGHT):new tt(a.left+a.width-I/3,a.top+a.height-M/3),this.bottomLeftBorderDoubleOuterBox=b>0||v>0?Rr(a.left+U/3,a.top+T,b-U/3,v-M/3,rr.BOTTOM_LEFT):new tt(a.left+U/3,a.top+a.height-M/3),this.topLeftBorderDoubleInnerBox=i>0||l>0?Rr(a.left+U*2/3,a.top+B*2/3,i-U*2/3,l-B*2/3,rr.TOP_LEFT):new tt(a.left+U*2/3,a.top+B*2/3),this.topRightBorderDoubleInnerBox=i>0||l>0?Rr(a.left+_,a.top+B*2/3,d-I*2/3,u-B*2/3,rr.TOP_RIGHT):new tt(a.left+a.width-I*2/3,a.top+B*2/3),this.bottomRightBorderDoubleInnerBox=p>0||x>0?Rr(a.left+E,a.top+C,p-I*2/3,x-M*2/3,rr.BOTTOM_RIGHT):new tt(a.left+a.width-I*2/3,a.top+a.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=b>0||v>0?Rr(a.left+U*2/3,a.top+T,b-U*2/3,v-M*2/3,rr.BOTTOM_LEFT):new tt(a.left+U*2/3,a.top+a.height-M*2/3),this.topLeftBorderStroke=i>0||l>0?Rr(a.left+U/2,a.top+B/2,i-U/2,l-B/2,rr.TOP_LEFT):new tt(a.left+U/2,a.top+B/2),this.topRightBorderStroke=i>0||l>0?Rr(a.left+_,a.top+B/2,d-I/2,u-B/2,rr.TOP_RIGHT):new tt(a.left+a.width-I/2,a.top+B/2),this.bottomRightBorderStroke=p>0||x>0?Rr(a.left+E,a.top+C,p-I/2,x-M/2,rr.BOTTOM_RIGHT):new tt(a.left+a.width-I/2,a.top+a.height-M/2),this.bottomLeftBorderStroke=b>0||v>0?Rr(a.left+U/2,a.top+T,b-U/2,v-M/2,rr.BOTTOM_LEFT):new tt(a.left+U/2,a.top+a.height-M/2),this.topLeftBorderBox=i>0||l>0?Rr(a.left,a.top,i,l,rr.TOP_LEFT):new tt(a.left,a.top),this.topRightBorderBox=d>0||u>0?Rr(a.left+_,a.top,d,u,rr.TOP_RIGHT):new tt(a.left+a.width,a.top),this.bottomRightBorderBox=p>0||x>0?Rr(a.left+E,a.top+C,p,x,rr.BOTTOM_RIGHT):new tt(a.left+a.width,a.top+a.height),this.bottomLeftBorderBox=b>0||v>0?Rr(a.left,a.top+T,b,v,rr.BOTTOM_LEFT):new tt(a.left,a.top+a.height),this.topLeftPaddingBox=i>0||l>0?Rr(a.left+U,a.top+B,Math.max(0,i-U),Math.max(0,l-B),rr.TOP_LEFT):new tt(a.left+U,a.top+B),this.topRightPaddingBox=d>0||u>0?Rr(a.left+Math.min(_,a.width-I),a.top+B,_>a.width+I?0:Math.max(0,d-I),Math.max(0,u-B),rr.TOP_RIGHT):new tt(a.left+a.width-I,a.top+B),this.bottomRightPaddingBox=p>0||x>0?Rr(a.left+Math.min(E,a.width-U),a.top+Math.min(C,a.height-M),Math.max(0,p-I),Math.max(0,x-M),rr.BOTTOM_RIGHT):new tt(a.left+a.width-I,a.top+a.height-M),this.bottomLeftPaddingBox=b>0||v>0?Rr(a.left+U,a.top+Math.min(T,a.height-M),Math.max(0,b-U),Math.max(0,v-M),rr.BOTTOM_LEFT):new tt(a.left+U,a.top+a.height-M),this.topLeftContentBox=i>0||l>0?Rr(a.left+U+Q,a.top+B+D,Math.max(0,i-(U+Q)),Math.max(0,l-(B+D)),rr.TOP_LEFT):new tt(a.left+U+Q,a.top+B+D),this.topRightContentBox=d>0||u>0?Rr(a.left+Math.min(_,a.width+U+Q),a.top+B+D,_>a.width+U+Q?0:d-U+Q,u-(B+D),rr.TOP_RIGHT):new tt(a.left+a.width-(I+L),a.top+B+D),this.bottomRightContentBox=p>0||x>0?Rr(a.left+Math.min(E,a.width-(U+Q)),a.top+Math.min(C,a.height+B+D),Math.max(0,p-(I+L)),x-(M+R),rr.BOTTOM_RIGHT):new tt(a.left+a.width-(I+L),a.top+a.height-(M+R)),this.bottomLeftContentBox=b>0||v>0?Rr(a.left+U+Q,a.top+T,Math.max(0,b-(U+Q)),v-(M+R),rr.BOTTOM_LEFT):new tt(a.left+U+Q,a.top+a.height-(M+R))}return e})(),rr;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(rr||(rr={}));var Rr=function(e,t,r,a,s){var i=4*((Math.sqrt(2)-1)/3),l=r*i,o=a*i,d=e+r,u=t+a;switch(s){case rr.TOP_LEFT:return new xm(new tt(e,u),new tt(e,u-o),new tt(d-l,t),new tt(d,t));case rr.TOP_RIGHT:return new xm(new tt(e,t),new tt(e+l,t),new tt(d,u-o),new tt(d,u));case rr.BOTTOM_RIGHT:return new xm(new tt(d,t),new tt(d,t+o),new tt(e+l,u),new tt(e,u));case rr.BOTTOM_LEFT:default:return new xm(new tt(d,u),new tt(d-l,u),new tt(e,t+o),new tt(e,t))}},nb=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},YTe=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},sb=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},XTe=(function(){function e(t,r,a){this.offsetX=t,this.offsetY=r,this.matrix=a,this.type=0,this.target=6}return e})(),mm=(function(){function e(t,r){this.path=t,this.target=r,this.type=1}return e})(),JTe=(function(){function e(t){this.opacity=t,this.type=2,this.target=6}return e})(),ZTe=function(e){return e.type===0},mz=function(e){return e.type===1},eFe=function(e){return e.type===2},dM=function(e,t){return e.length===t.length?e.some(function(r,a){return r===t[a]}):!1},tFe=function(e,t,r,a,s){return e.map(function(i,l){switch(l){case 0:return i.add(t,r);case 1:return i.add(t+a,r);case 2:return i.add(t+a,r+s);case 3:return i.add(t,r+s)}return i})},gz=(function(){function e(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e})(),bz=(function(){function e(t,r){if(this.container=t,this.parent=r,this.effects=[],this.curves=new WTe(this.container),this.container.styles.opacity<1&&this.effects.push(new JTe(this.container.styles.opacity)),this.container.styles.transform!==null){var a=this.container.bounds.left+this.container.styles.transformOrigin[0].number,s=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new XTe(a,s,i))}if(this.container.styles.overflowX!==0){var l=nb(this.curves),o=sb(this.curves);dM(l,o)?this.effects.push(new mm(l,6)):(this.effects.push(new mm(l,2)),this.effects.push(new mm(o,4)))}}return e.prototype.getEffects=function(t){for(var r=[2,3].indexOf(this.container.styles.position)===-1,a=this.parent,s=this.effects.slice(0);a;){var i=a.effects.filter(function(d){return!mz(d)});if(r||a.container.styles.position!==0||!a.parent){if(s.unshift.apply(s,i),r=[2,3].indexOf(a.container.styles.position)===-1,a.container.styles.overflowX!==0){var l=nb(a.curves),o=sb(a.curves);dM(l,o)||s.unshift(new mm(o,6))}}else s.unshift.apply(s,i);a=a.parent}return s.filter(function(d){return Oa(d.target,t)})},e})(),JC=function(e,t,r,a){e.container.elements.forEach(function(s){var i=Oa(s.flags,4),l=Oa(s.flags,2),o=new bz(s,e);Oa(s.styles.display,2048)&&a.push(o);var d=Oa(s.flags,8)?[]:a;if(i||l){var u=i||s.styles.isPositioned()?r:t,f=new gz(o);if(s.styles.isPositioned()||s.styles.opacity<1||s.styles.isTransformed()){var p=s.styles.zIndex.order;if(p<0){var x=0;u.negativeZIndex.some(function(b,v){return p>b.element.container.styles.zIndex.order?(x=v,!1):x>0}),u.negativeZIndex.splice(x,0,f)}else if(p>0){var m=0;u.positiveZIndex.some(function(b,v){return p>=b.element.container.styles.zIndex.order?(m=v+1,!1):m>0}),u.positiveZIndex.splice(m,0,f)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(f)}else s.styles.isFloating()?u.nonPositionedFloats.push(f):u.nonPositionedInlineLevel.push(f);JC(o,f,i?f:r,d)}else s.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),JC(o,t,r,d);Oa(s.flags,8)&&vz(s,d)})},vz=function(e,t){for(var r=e instanceof KC?e.start:1,a=e instanceof KC?e.reversed:!1,s=0;s<t.length;s++){var i=t[s];i.container instanceof az&&typeof i.container.value=="number"&&i.container.value!==0&&(r=i.container.value),i.listValue=Sp(r,i.container.styles.listStyleType,!0),r+=a?-1:1}},rFe=function(e){var t=new bz(e,null),r=new gz(t),a=[];return JC(t,r,r,a),vz(t.container,a),r},uM=function(e,t){switch(t){case 0:return xi(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return xi(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return xi(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return xi(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},aFe=function(e,t){switch(t){case 0:return xi(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return xi(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return xi(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return xi(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},nFe=function(e,t){switch(t){case 0:return xi(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return xi(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return xi(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return xi(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},sFe=function(e,t){switch(t){case 0:return gm(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return gm(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return gm(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return gm(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},gm=function(e,t){var r=[];return ui(e)?r.push(e.subdivide(.5,!1)):r.push(e),ui(t)?r.push(t.subdivide(.5,!0)):r.push(t),r},xi=function(e,t,r,a){var s=[];return ui(e)?s.push(e.subdivide(.5,!1)):s.push(e),ui(r)?s.push(r.subdivide(.5,!0)):s.push(r),ui(a)?s.push(a.subdivide(.5,!0).reverse()):s.push(a),ui(t)?s.push(t.subdivide(.5,!1).reverse()):s.push(t),s},yz=function(e){var t=e.bounds,r=e.styles;return t.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},ib=function(e){var t=e.styles,r=e.bounds,a=Nr(t.paddingLeft,r.width),s=Nr(t.paddingRight,r.width),i=Nr(t.paddingTop,r.width),l=Nr(t.paddingBottom,r.width);return r.add(a+t.borderLeftWidth,i+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+a+s),-(t.borderTopWidth+t.borderBottomWidth+i+l))},iFe=function(e,t){return e===0?t.bounds:e===2?ib(t):yz(t)},lFe=function(e,t){return e===0?t.bounds:e===2?ib(t):yz(t)},sN=function(e,t,r){var a=iFe(oA(e.styles.backgroundOrigin,t),e),s=lFe(oA(e.styles.backgroundClip,t),e),i=oFe(oA(e.styles.backgroundSize,t),r,a),l=i[0],o=i[1],d=Ef(oA(e.styles.backgroundPosition,t),a.width-l,a.height-o),u=cFe(oA(e.styles.backgroundRepeat,t),d,i,a,s),f=Math.round(a.left+d[0]),p=Math.round(a.top+d[1]);return[u,f,p,l,o]},aA=function(e){return pr(e)&&e.value===CA.AUTO},bm=function(e){return typeof e=="number"},oFe=function(e,t,r){var a=t[0],s=t[1],i=t[2],l=e[0],o=e[1];if(!l)return[0,0];if(ka(l)&&o&&ka(o))return[Nr(l,r.width),Nr(o,r.height)];var d=bm(i);if(pr(l)&&(l.value===CA.CONTAIN||l.value===CA.COVER)){if(bm(i)){var u=r.width/r.height;return u<i!=(l.value===CA.COVER)?[r.width,r.width/i]:[r.height*i,r.height]}return[r.width,r.height]}var f=bm(a),p=bm(s),x=f||p;if(aA(l)&&(!o||aA(o))){if(f&&p)return[a,s];if(!d&&!x)return[r.width,r.height];if(x&&d){var m=f?a:s*i,b=p?s:a/i;return[m,b]}var v=f?a:r.width,y=p?s:r.height;return[v,y]}if(d){var k=0,_=0;return ka(l)?k=Nr(l,r.width):ka(o)&&(_=Nr(o,r.height)),aA(l)?k=_*i:(!o||aA(o))&&(_=k/i),[k,_]}var C=null,E=null;if(ka(l)?C=Nr(l,r.width):o&&ka(o)&&(E=Nr(o,r.height)),C!==null&&(!o||aA(o))&&(E=f&&p?C/a*s:r.height),E!==null&&aA(l)&&(C=f&&p?E/s*a:r.width),C!==null&&E!==null)return[C,E];throw new Error("Unable to calculate background-size for element")},oA=function(e,t){var r=e[t];return typeof r>"u"?e[0]:r},cFe=function(e,t,r,a,s){var i=t[0],l=t[1],o=r[0],d=r[1];switch(e){case 2:return[new tt(Math.round(a.left),Math.round(a.top+l)),new tt(Math.round(a.left+a.width),Math.round(a.top+l)),new tt(Math.round(a.left+a.width),Math.round(d+a.top+l)),new tt(Math.round(a.left),Math.round(d+a.top+l))];case 3:return[new tt(Math.round(a.left+i),Math.round(a.top)),new tt(Math.round(a.left+i+o),Math.round(a.top)),new tt(Math.round(a.left+i+o),Math.round(a.height+a.top)),new tt(Math.round(a.left+i),Math.round(a.height+a.top))];case 1:return[new tt(Math.round(a.left+i),Math.round(a.top+l)),new tt(Math.round(a.left+i+o),Math.round(a.top+l)),new tt(Math.round(a.left+i+o),Math.round(a.top+l+d)),new tt(Math.round(a.left+i),Math.round(a.top+l+d))];default:return[new tt(Math.round(s.left),Math.round(s.top)),new tt(Math.round(s.left+s.width),Math.round(s.top)),new tt(Math.round(s.left+s.width),Math.round(s.height+s.top)),new tt(Math.round(s.left),Math.round(s.height+s.top))]}},dFe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",AM="Hidden Text",uFe=(function(){function e(t){this._data={},this._document=t}return e.prototype.parseMetrics=function(t,r){var a=this._document.createElement("div"),s=this._document.createElement("img"),i=this._document.createElement("span"),l=this._document.body;a.style.visibility="hidden",a.style.fontFamily=t,a.style.fontSize=r,a.style.margin="0",a.style.padding="0",a.style.whiteSpace="nowrap",l.appendChild(a),s.src=dFe,s.width=1,s.height=1,s.style.margin="0",s.style.padding="0",s.style.verticalAlign="baseline",i.style.fontFamily=t,i.style.fontSize=r,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(AM)),a.appendChild(i),a.appendChild(s);var o=s.offsetTop-i.offsetTop+2;a.removeChild(i),a.appendChild(this._document.createTextNode(AM)),a.style.lineHeight="normal",s.style.verticalAlign="super";var d=s.offsetTop-a.offsetTop+2;return l.removeChild(a),{baseline:o,middle:d}},e.prototype.getMetrics=function(t,r){var a=t+" "+r;return typeof this._data[a]>"u"&&(this._data[a]=this.parseMetrics(t,r)),this._data[a]},e})(),wz=(function(){function e(t,r){this.context=t,this.options=r}return e})(),AFe=1e4,fFe=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s._activeEffects=[],s.canvas=a.canvas?a.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),a.canvas||(s.canvas.width=Math.floor(a.width*a.scale),s.canvas.height=Math.floor(a.height*a.scale),s.canvas.style.width=a.width+"px",s.canvas.style.height=a.height+"px"),s.fontMetrics=new uFe(document),s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-a.x,-a.y),s.ctx.textBaseline="bottom",s._activeEffects=[],s.context.logger.debug("Canvas renderer initialized ("+a.width+"x"+a.height+") with scale "+a.scale),s}return t.prototype.applyEffects=function(r){for(var a=this;this._activeEffects.length;)this.popEffect();r.forEach(function(s){return a.applyEffect(s)})},t.prototype.applyEffect=function(r){this.ctx.save(),eFe(r)&&(this.ctx.globalAlpha=r.opacity),ZTe(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),mz(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(r){return Hn(this,void 0,void 0,function(){var a;return Sn(this,function(s){switch(s.label){case 0:return a=r.element.container.styles,a.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(r){return Hn(this,void 0,void 0,function(){return Sn(this,function(a){switch(a.label){case 0:if(Oa(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return a.sent(),[4,this.renderNodeContent(r)];case 2:a.sent(),a.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(r,a,s){var i=this;if(a===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+s);else{var l=VE(r.text);l.reduce(function(o,d){return i.ctx.fillText(d,o,r.bounds.top+s),o+i.ctx.measureText(d).width},r.bounds.left)}},t.prototype.createFontStyle=function(r){var a=r.fontVariant.filter(function(l){return l==="normal"||l==="small-caps"}).join(""),s=gFe(r.fontFamily).join(", "),i=sh(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,a,r.fontWeight,i,s].join(" "),s,i]},t.prototype.renderTextNode=function(r,a){return Hn(this,void 0,void 0,function(){var s,i,l,o,d,u,f,p,x=this;return Sn(this,function(m){return s=this.createFontStyle(a),i=s[0],l=s[1],o=s[2],this.ctx.font=i,this.ctx.direction=a.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",d=this.fontMetrics.getMetrics(l,o),u=d.baseline,f=d.middle,p=a.paintOrder,r.textBounds.forEach(function(b){p.forEach(function(v){switch(v){case 0:x.ctx.fillStyle=Ga(a.color),x.renderTextWithLetterSpacing(b,a.letterSpacing,u);var y=a.textShadow;y.length&&b.text.trim().length&&(y.slice(0).reverse().forEach(function(k){x.ctx.shadowColor=Ga(k.color),x.ctx.shadowOffsetX=k.offsetX.number*x.options.scale,x.ctx.shadowOffsetY=k.offsetY.number*x.options.scale,x.ctx.shadowBlur=k.blur.number,x.renderTextWithLetterSpacing(b,a.letterSpacing,u)}),x.ctx.shadowColor="",x.ctx.shadowOffsetX=0,x.ctx.shadowOffsetY=0,x.ctx.shadowBlur=0),a.textDecorationLine.length&&(x.ctx.fillStyle=Ga(a.textDecorationColor||a.color),a.textDecorationLine.forEach(function(k){switch(k){case 1:x.ctx.fillRect(b.bounds.left,Math.round(b.bounds.top+u),b.bounds.width,1);break;case 2:x.ctx.fillRect(b.bounds.left,Math.round(b.bounds.top),b.bounds.width,1);break;case 3:x.ctx.fillRect(b.bounds.left,Math.ceil(b.bounds.top+f),b.bounds.width,1);break}}));break;case 1:a.webkitTextStrokeWidth&&b.text.trim().length&&(x.ctx.strokeStyle=Ga(a.webkitTextStrokeColor),x.ctx.lineWidth=a.webkitTextStrokeWidth,x.ctx.lineJoin=window.chrome?"miter":"round",x.ctx.strokeText(b.text,b.bounds.left,b.bounds.top+u)),x.ctx.strokeStyle="",x.ctx.lineWidth=0,x.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(r,a,s){if(s&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var i=ib(r),l=sb(a);this.path(l),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(s,0,0,r.intrinsicWidth,r.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(r){return Hn(this,void 0,void 0,function(){var a,s,i,l,o,d,_,_,u,f,p,x,E,m,b,T,v,y,k,_,C,E,T;return Sn(this,function(B){switch(B.label){case 0:this.applyEffects(r.getEffects(4)),a=r.container,s=r.curves,i=a.styles,l=0,o=a.textNodes,B.label=1;case 1:return l<o.length?(d=o[l],[4,this.renderTextNode(d,i)]):[3,4];case 2:B.sent(),B.label=3;case 3:return l++,[3,1];case 4:if(!(a instanceof ez))return[3,8];B.label=5;case 5:return B.trys.push([5,7,,8]),[4,this.context.cache.match(a.src)];case 6:return _=B.sent(),this.renderReplacedElement(a,s,_),[3,8];case 7:return B.sent(),this.context.logger.error("Error loading image "+a.src),[3,8];case 8:if(a instanceof tz&&this.renderReplacedElement(a,s,a.canvas),!(a instanceof rz))return[3,12];B.label=9;case 9:return B.trys.push([9,11,,12]),[4,this.context.cache.match(a.svg)];case 10:return _=B.sent(),this.renderReplacedElement(a,s,_),[3,12];case 11:return B.sent(),this.context.logger.error("Error loading svg "+a.svg.substring(0,255)),[3,12];case 12:return a instanceof iz&&a.tree?(u=new t(this.context,{scale:this.options.scale,backgroundColor:a.backgroundColor,x:0,y:0,width:a.width,height:a.height}),[4,u.render(a.tree)]):[3,14];case 13:f=B.sent(),a.width&&a.height&&this.ctx.drawImage(f,0,0,a.width,a.height,a.bounds.left,a.bounds.top,a.bounds.width,a.bounds.height),B.label=14;case 14:if(a instanceof GE&&(p=Math.min(a.bounds.width,a.bounds.height),a.type===eb?a.checked&&(this.ctx.save(),this.path([new tt(a.bounds.left+p*.39363,a.bounds.top+p*.79),new tt(a.bounds.left+p*.16,a.bounds.top+p*.5549),new tt(a.bounds.left+p*.27347,a.bounds.top+p*.44071),new tt(a.bounds.left+p*.39694,a.bounds.top+p*.5649),new tt(a.bounds.left+p*.72983,a.bounds.top+p*.23),new tt(a.bounds.left+p*.84,a.bounds.top+p*.34085),new tt(a.bounds.left+p*.39363,a.bounds.top+p*.79)]),this.ctx.fillStyle=Ga(ZU),this.ctx.fill(),this.ctx.restore()):a.type===tb&&a.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(a.bounds.left+p/2,a.bounds.top+p/2,p/4,0,Math.PI*2,!0),this.ctx.fillStyle=Ga(ZU),this.ctx.fill(),this.ctx.restore())),pFe(a)&&a.value.length){switch(x=this.createFontStyle(i),E=x[0],m=x[1],b=this.fontMetrics.getMetrics(E,m).baseline,this.ctx.font=E,this.ctx.fillStyle=Ga(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=xFe(a.styles.textAlign),T=ib(a),v=0,a.styles.textAlign){case 1:v+=T.width/2;break;case 2:v+=T.width;break}y=T.add(v,0,0,-T.height/2+1),this.ctx.save(),this.path([new tt(T.left,T.top),new tt(T.left+T.width,T.top),new tt(T.left+T.width,T.top+T.height),new tt(T.left,T.top+T.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Hf(a.value,y),i.letterSpacing,b),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Oa(a.styles.display,2048))return[3,20];if(a.styles.listStyleImage===null)return[3,19];if(k=a.styles.listStyleImage,k.type!==0)return[3,18];_=void 0,C=k.url,B.label=15;case 15:return B.trys.push([15,17,,18]),[4,this.context.cache.match(C)];case 16:return _=B.sent(),this.ctx.drawImage(_,a.bounds.left-(_.width+10),a.bounds.top),[3,18];case 17:return B.sent(),this.context.logger.error("Error loading list-style-image "+C),[3,18];case 18:return[3,20];case 19:r.listValue&&a.styles.listStyleType!==-1&&(E=this.createFontStyle(i)[0],this.ctx.font=E,this.ctx.fillStyle=Ga(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",T=new Co(a.bounds.left,a.bounds.top+Nr(a.styles.paddingTop,a.bounds.width),a.bounds.width,MU(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Hf(r.listValue,T),i.letterSpacing,MU(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),B.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(r){return Hn(this,void 0,void 0,function(){var a,s,k,i,l,k,o,d,k,u,f,k,p,x,k,m,b,k,v,y,k;return Sn(this,function(_){switch(_.label){case 0:if(Oa(r.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(r.element)];case 1:_.sent(),a=0,s=r.negativeZIndex,_.label=2;case 2:return a<s.length?(k=s[a],[4,this.renderStack(k)]):[3,5];case 3:_.sent(),_.label=4;case 4:return a++,[3,2];case 5:return[4,this.renderNodeContent(r.element)];case 6:_.sent(),i=0,l=r.nonInlineLevel,_.label=7;case 7:return i<l.length?(k=l[i],[4,this.renderNode(k)]):[3,10];case 8:_.sent(),_.label=9;case 9:return i++,[3,7];case 10:o=0,d=r.nonPositionedFloats,_.label=11;case 11:return o<d.length?(k=d[o],[4,this.renderStack(k)]):[3,14];case 12:_.sent(),_.label=13;case 13:return o++,[3,11];case 14:u=0,f=r.nonPositionedInlineLevel,_.label=15;case 15:return u<f.length?(k=f[u],[4,this.renderStack(k)]):[3,18];case 16:_.sent(),_.label=17;case 17:return u++,[3,15];case 18:p=0,x=r.inlineLevel,_.label=19;case 19:return p<x.length?(k=x[p],[4,this.renderNode(k)]):[3,22];case 20:_.sent(),_.label=21;case 21:return p++,[3,19];case 22:m=0,b=r.zeroOrAutoZIndexOrTransformedOrOpacity,_.label=23;case 23:return m<b.length?(k=b[m],[4,this.renderStack(k)]):[3,26];case 24:_.sent(),_.label=25;case 25:return m++,[3,23];case 26:v=0,y=r.positiveZIndex,_.label=27;case 27:return v<y.length?(k=y[v],[4,this.renderStack(k)]):[3,30];case 28:_.sent(),_.label=29;case 29:return v++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(r){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(r.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(r){this.ctx.beginPath(),this.formatPath(r),this.ctx.closePath()},t.prototype.formatPath=function(r){var a=this;r.forEach(function(s,i){var l=ui(s)?s.start:s;i===0?a.ctx.moveTo(l.x,l.y):a.ctx.lineTo(l.x,l.y),ui(s)&&a.ctx.bezierCurveTo(s.startControl.x,s.startControl.y,s.endControl.x,s.endControl.y,s.end.x,s.end.y)})},t.prototype.renderRepeat=function(r,a,s,i){this.path(r),this.ctx.fillStyle=a,this.ctx.translate(s,i),this.ctx.fill(),this.ctx.translate(-s,-i)},t.prototype.resizeImage=function(r,a,s){var i;if(r.width===a&&r.height===s)return r;var l=(i=this.canvas.ownerDocument)!==null&&i!==void 0?i:document,o=l.createElement("canvas");o.width=Math.max(1,a),o.height=Math.max(1,s);var d=o.getContext("2d");return d.drawImage(r,0,0,r.width,r.height,0,0,a,s),o},t.prototype.renderBackgroundImage=function(r){return Hn(this,void 0,void 0,function(){var a,s,i,l,o,d;return Sn(this,function(u){switch(u.label){case 0:a=r.styles.backgroundImage.length-1,s=function(f){var p,x,m,D,W,z,Q,G,M,b,D,W,z,Q,G,v,y,k,_,C,E,T,B,I,M,U,D,L,R,Q,G,K,W,z,Z,Y,te,O,P,q,H,J;return Sn(this,function(ae){switch(ae.label){case 0:if(f.type!==0)return[3,5];p=void 0,x=f.url,ae.label=1;case 1:return ae.trys.push([1,3,,4]),[4,i.context.cache.match(x)];case 2:return p=ae.sent(),[3,4];case 3:return ae.sent(),i.context.logger.error("Error loading background-image "+x),[3,4];case 4:return p&&(m=sN(r,a,[p.width,p.height,p.width/p.height]),D=m[0],W=m[1],z=m[2],Q=m[3],G=m[4],M=i.ctx.createPattern(i.resizeImage(p,Q,G),"repeat"),i.renderRepeat(D,M,W,z)),[3,6];case 5:ZBe(f)?(b=sN(r,a,[null,null,null]),D=b[0],W=b[1],z=b[2],Q=b[3],G=b[4],v=qBe(f.angle,Q,G),y=v[0],k=v[1],_=v[2],C=v[3],E=v[4],T=document.createElement("canvas"),T.width=Q,T.height=G,B=T.getContext("2d"),I=B.createLinearGradient(k,C,_,E),DU(f.stops,y).forEach(function(oe){return I.addColorStop(oe.stop,Ga(oe.color))}),B.fillStyle=I,B.fillRect(0,0,Q,G),Q>0&&G>0&&(M=i.ctx.createPattern(T,"repeat"),i.renderRepeat(D,M,W,z))):e4e(f)&&(U=sN(r,a,[null,null,null]),D=U[0],L=U[1],R=U[2],Q=U[3],G=U[4],K=f.position.length===0?[HE]:f.position,W=Nr(K[0],Q),z=Nr(K[K.length-1],G),Z=WBe(f,W,z,Q,G),Y=Z[0],te=Z[1],Y>0&&te>0&&(O=i.ctx.createRadialGradient(L+W,R+z,0,L+W,R+z,Y),DU(f.stops,Y*2).forEach(function(oe){return O.addColorStop(oe.stop,Ga(oe.color))}),i.path(D),i.ctx.fillStyle=O,Y!==te?(P=r.bounds.left+.5*r.bounds.width,q=r.bounds.top+.5*r.bounds.height,H=te/Y,J=1/H,i.ctx.save(),i.ctx.translate(P,q),i.ctx.transform(1,0,0,H,0,0),i.ctx.translate(-P,-q),i.ctx.fillRect(L,J*(R-q)+q,Q,G*J),i.ctx.restore()):i.ctx.fill())),ae.label=6;case 6:return a--,[2]}})},i=this,l=0,o=r.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return l<o.length?(d=o[l],[5,s(d)]):[3,4];case 2:u.sent(),u.label=3;case 3:return l++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(r,a,s){return Hn(this,void 0,void 0,function(){return Sn(this,function(i){return this.path(uM(s,a)),this.ctx.fillStyle=Ga(r),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(r,a,s,i){return Hn(this,void 0,void 0,function(){var l,o;return Sn(this,function(d){switch(d.label){case 0:return a<3?[4,this.renderSolidBorder(r,s,i)]:[3,2];case 1:return d.sent(),[2];case 2:return l=aFe(i,s),this.path(l),this.ctx.fillStyle=Ga(r),this.ctx.fill(),o=nFe(i,s),this.path(o),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(r){return Hn(this,void 0,void 0,function(){var a,s,i,l,o,d,u,f,p=this;return Sn(this,function(x){switch(x.label){case 0:return this.applyEffects(r.getEffects(2)),a=r.container.styles,s=!Sc(a.backgroundColor)||a.backgroundImage.length,i=[{style:a.borderTopStyle,color:a.borderTopColor,width:a.borderTopWidth},{style:a.borderRightStyle,color:a.borderRightColor,width:a.borderRightWidth},{style:a.borderBottomStyle,color:a.borderBottomColor,width:a.borderBottomWidth},{style:a.borderLeftStyle,color:a.borderLeftColor,width:a.borderLeftWidth}],l=hFe(oA(a.backgroundClip,0),r.curves),s||a.boxShadow.length?(this.ctx.save(),this.path(l),this.ctx.clip(),Sc(a.backgroundColor)||(this.ctx.fillStyle=Ga(a.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:x.sent(),this.ctx.restore(),a.boxShadow.slice(0).reverse().forEach(function(m){p.ctx.save();var b=nb(r.curves),v=m.inset?0:AFe,y=tFe(b,-v+(m.inset?1:-1)*m.spread.number,(m.inset?1:-1)*m.spread.number,m.spread.number*(m.inset?-2:2),m.spread.number*(m.inset?-2:2));m.inset?(p.path(b),p.ctx.clip(),p.mask(y)):(p.mask(b),p.ctx.clip(),p.path(y)),p.ctx.shadowOffsetX=m.offsetX.number+v,p.ctx.shadowOffsetY=m.offsetY.number,p.ctx.shadowColor=Ga(m.color),p.ctx.shadowBlur=m.blur.number,p.ctx.fillStyle=m.inset?Ga(m.color):"rgba(0,0,0,1)",p.ctx.fill(),p.ctx.restore()}),x.label=2;case 2:o=0,d=0,u=i,x.label=3;case 3:return d<u.length?(f=u[d],f.style!==0&&!Sc(f.color)&&f.width>0?f.style!==2?[3,5]:[4,this.renderDashedDottedBorder(f.color,f.width,o,r.curves,2)]:[3,11]):[3,13];case 4:return x.sent(),[3,11];case 5:return f.style!==3?[3,7]:[4,this.renderDashedDottedBorder(f.color,f.width,o,r.curves,3)];case 6:return x.sent(),[3,11];case 7:return f.style!==4?[3,9]:[4,this.renderDoubleBorder(f.color,f.width,o,r.curves)];case 8:return x.sent(),[3,11];case 9:return[4,this.renderSolidBorder(f.color,o,r.curves)];case 10:x.sent(),x.label=11;case 11:o++,x.label=12;case 12:return d++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(r,a,s,i,l){return Hn(this,void 0,void 0,function(){var o,d,u,f,p,x,m,b,v,y,k,_,C,E,T,B,T,B;return Sn(this,function(I){return this.ctx.save(),o=sFe(i,s),d=uM(i,s),l===2&&(this.path(d),this.ctx.clip()),ui(d[0])?(u=d[0].start.x,f=d[0].start.y):(u=d[0].x,f=d[0].y),ui(d[1])?(p=d[1].end.x,x=d[1].end.y):(p=d[1].x,x=d[1].y),s===0||s===2?m=Math.abs(u-p):m=Math.abs(f-x),this.ctx.beginPath(),l===3?this.formatPath(o):this.formatPath(d.slice(0,2)),b=a<3?a*3:a*2,v=a<3?a*2:a,l===3&&(b=a,v=a),y=!0,m<=b*2?y=!1:m<=b*2+v?(k=m/(2*b+v),b*=k,v*=k):(_=Math.floor((m+v)/(b+v)),C=(m-_*b)/(_-1),E=(m-(_+1)*b)/_,v=E<=0||Math.abs(v-C)<Math.abs(v-E)?C:E),y&&(l===3?this.ctx.setLineDash([0,b+v]):this.ctx.setLineDash([b,v])),l===3?(this.ctx.lineCap="round",this.ctx.lineWidth=a):this.ctx.lineWidth=a*2+1.1,this.ctx.strokeStyle=Ga(r),this.ctx.stroke(),this.ctx.setLineDash([]),l===2&&(ui(d[0])&&(T=d[3],B=d[0],this.ctx.beginPath(),this.formatPath([new tt(T.end.x,T.end.y),new tt(B.start.x,B.start.y)]),this.ctx.stroke()),ui(d[1])&&(T=d[1],B=d[2],this.ctx.beginPath(),this.formatPath([new tt(T.end.x,T.end.y),new tt(B.start.x,B.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(r){return Hn(this,void 0,void 0,function(){var a;return Sn(this,function(s){switch(s.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Ga(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),a=rFe(r),[4,this.renderStack(a)];case 1:return s.sent(),this.applyEffects([]),[2,this.canvas]}})})},t})(wz),pFe=function(e){return e instanceof sz||e instanceof nz?!0:e instanceof GE&&e.type!==tb&&e.type!==eb},hFe=function(e,t){switch(e){case 0:return nb(t);case 2:return YTe(t);case 1:default:return sb(t)}},xFe=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},mFe=["-apple-system","system-ui"],gFe=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(t){return mFe.indexOf(t)===-1}):e},bFe=(function(e){Ji(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.canvas=a.canvas?a.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),s.options=a,s.canvas.width=Math.floor(a.width*a.scale),s.canvas.height=Math.floor(a.height*a.scale),s.canvas.style.width=a.width+"px",s.canvas.style.height=a.height+"px",s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-a.x,-a.y),s.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+a.width+"x"+a.height+" at "+a.x+","+a.y+") with scale "+a.scale),s}return t.prototype.render=function(r){return Hn(this,void 0,void 0,function(){var a,s;return Sn(this,function(i){switch(i.label){case 0:return a=GC(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,vFe(a)];case 1:return s=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Ga(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(s,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t})(wz),vFe=function(e){return new Promise(function(t,r){var a=new Image;a.onload=function(){t(a)},a.onerror=r,a.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},yFe=(function(){function e(t){var r=t.id,a=t.enabled;this.id=r,this.enabled=a,this.start=Date.now()}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Xx([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Xx([this.id,this.getTime()+"ms"],t))},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Xx([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Xx([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.instances={},e})(),wFe=(function(){function e(t,r){var a;this.windowBounds=r,this.instanceName="#"+e.instanceCount++,this.logger=new yFe({id:this.instanceName,enabled:t.logging}),this.cache=(a=t.cache)!==null&&a!==void 0?a:new HTe(this,t)}return e.instanceCount=1,e})(),Hs=function(e,t){return t===void 0&&(t={}),NFe(e,t)};typeof window<"u"&&xz.setContext(window);var NFe=function(e,t){return Hn(void 0,void 0,void 0,function(){var r,a,s,i,l,o,d,u,f,p,x,m,b,v,y,k,_,C,E,T,I,B,I,M,U,D,L,R,Q,G,K,W,z,Z,Y,te,O,P,q,H;return Sn(this,function(J){switch(J.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(r=e.ownerDocument,!r)throw new Error("Element is not attached to a Document");if(a=r.defaultView,!a)throw new Error("Document is not attached to a Window");return s={allowTaint:(M=t.allowTaint)!==null&&M!==void 0?M:!1,imageTimeout:(U=t.imageTimeout)!==null&&U!==void 0?U:15e3,proxy:t.proxy,useCORS:(D=t.useCORS)!==null&&D!==void 0?D:!1},i=TC({logging:(L=t.logging)!==null&&L!==void 0?L:!0,cache:t.cache},s),l={windowWidth:(R=t.windowWidth)!==null&&R!==void 0?R:a.innerWidth,windowHeight:(Q=t.windowHeight)!==null&&Q!==void 0?Q:a.innerHeight,scrollX:(G=t.scrollX)!==null&&G!==void 0?G:a.pageXOffset,scrollY:(K=t.scrollY)!==null&&K!==void 0?K:a.pageYOffset},o=new Co(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new wFe(i,o),u=(W=t.foreignObjectRendering)!==null&&W!==void 0?W:!1,f={allowTaint:(z=t.allowTaint)!==null&&z!==void 0?z:!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:u,copyStyles:u},d.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),p=new oM(d,e,f),x=p.clonedReferenceElement,x?[4,p.toIFrame(r,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=J.sent(),b=KE(x)||kTe(x)?tSe(x.ownerDocument):pv(d,x),v=b.width,y=b.height,k=b.left,_=b.top,C=CFe(d,x,t.backgroundColor),E={canvas:t.canvas,backgroundColor:C,scale:(Y=(Z=t.scale)!==null&&Z!==void 0?Z:a.devicePixelRatio)!==null&&Y!==void 0?Y:1,x:((te=t.x)!==null&&te!==void 0?te:0)+k,y:((O=t.y)!==null&&O!==void 0?O:0)+_,width:(P=t.width)!==null&&P!==void 0?P:Math.ceil(v),height:(q=t.height)!==null&&q!==void 0?q:Math.ceil(y)},u?(d.logger.debug("Document cloned, using foreign object rendering"),I=new bFe(d,E),[4,I.render(x)]):[3,3];case 2:return T=J.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+k+","+_+" with size "+v+"x"+y+" using computed rendering"),d.logger.debug("Starting DOM parsing"),B=oz(d,x),C===B.styles.backgroundColor&&(B.styles.backgroundColor=fo.TRANSPARENT),d.logger.debug("Starting renderer for element at "+E.x+","+E.y+" with size "+E.width+"x"+E.height),I=new fFe(d,E),[4,I.render(B)];case 4:T=J.sent(),J.label=5;case 5:return(!((H=t.removeContainer)!==null&&H!==void 0)||H)&&(oM.destroy(m)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,T]}})})},CFe=function(e,t,r){var a=t.ownerDocument,s=a.documentElement?Lf(e,getComputedStyle(a.documentElement).backgroundColor):fo.TRANSPARENT,i=a.body?Lf(e,getComputedStyle(a.body).backgroundColor):fo.TRANSPARENT,l=typeof r=="string"?Lf(e,r):r===null?fo.TRANSPARENT:4294967295;return t===a.documentElement?Sc(s)?Sc(i)?l:i:s:l};const Es=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},kFe=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},jFe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=ht(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState("selection"),[b,v]=j.useState("fee"),[y,k]=j.useState(null),[_,C]=j.useState(null),[E,T]=j.useState(null),[B,I]=j.useState([]),[M,U]=j.useState(0),[D,L]=j.useState(null),[R,Q]=j.useState(!1),[G,K]=j.useState([]),[W,z]=j.useState(!1),[Z,Y]=j.useState({}),te=j.useRef(null);j.useEffect(()=>{(async()=>{z(!0);try{const[be,me]=await Promise.all([we.getInitialDebtData(),we.getSystemSettings()]);Array.isArray(be)?K(be):be&&be.success&&K(be.data||[]),Y(me||{})}catch(be){console.error("Error fetching data",be)}finally{z(!1)}})()},[]);const O=j.useMemo(()=>t.find(pe=>pe.month===d&&pe.year===f),[t,d,f]),P=j.useMemo(()=>[...r].sort((pe,be)=>pe.code.localeCompare(be.code,void 0,{numeric:!0})),[r]),q=j.useMemo(()=>x==="report"?r.find(pe=>pe.id===y):x==="bulk"?B[M]:null,[x,r,y,B,M]),H=j.useMemo(()=>G.find(pe=>pe.id===(q==null?void 0:q.id)),[G,q]),J=j.useMemo(()=>{if(!q)return null;const pe=a.find(me=>me.propertyId===q.id&&me.isOwner),be=s.find(me=>me.cedula===(pe==null?void 0:pe.cedula));return{fullName:(pe==null?void 0:pe.fullName)||"Propietario",email:(be==null?void 0:be.email)||"",phone:(pe==null?void 0:pe.phone)||(be==null?void 0:be.phone)||"",telegramId:(be==null?void 0:be.telegramChatId)||"",propertyCode:q.code,propertyId:q.id}},[q,a,s]),ae=pe=>{if(!pe)return"";let be=pe.trim();return be.startsWith("+")?be.replace(/\D/g,""):be.startsWith("0")?"58"+be.substring(1).replace(/\D/g,""):be.length===10?"58"+be.replace(/\D/g,""):be.replace(/\D/g,"")},oe=async()=>{if(te.current){Q(!0);try{const be=(await Hs(te.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),me=document.createElement("a");me.href=be,me.download=`Aviso_${q==null?void 0:q.code}_${Ue[d]}.png`,me.click()}catch(pe){console.error("Capture failed",pe),alert("Error al capturar imagen.")}finally{Q(!1)}}},ce=async()=>{if(te.current){Q(!0);try{const pe=await Hs(te.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),be=await new Promise(Te=>pe.toBlob(Te,"image/png"));if(!be)throw new Error("Blob creation failed");const me=`Aviso_${q==null?void 0:q.code}_${Ue[d]}.png`,_e=new File([be],me,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[_e]}))await navigator.share({files:[_e],title:`Aviso de Cobro - ${q==null?void 0:q.code}`,text:`Aviso de Cobro de ${Ue[d]} ${f} para la unidad ${q==null?void 0:q.code}`});else{const Te=pe.toDataURL("image/png"),Xe=document.createElement("a");Xe.href=Te,Xe.download=me,Xe.click(),alert("La función de compartir archivos no es compatible con este navegador. La imagen se ha descargado.")}}catch(pe){console.error("Share failed",pe),alert("Error al compartir imagen.")}finally{Q(!1)}}},ne=async pe=>{if(!J||!q||!O)return;const be=O.debts.find(At=>At.propertyId===q.id),me=be?Number(be.amountUsd)-Number(be.paidAmount):0,_e=(H==null?void 0:H.current_debt)||0,Te=me+_e,Xe=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${J.fullName}*,
Unidad: *${q.type} ${q.number}* (${q.code})

📅 *Periodo:* ${Ue[d]} ${f}
------------------------------------------
💵 *Cuota del Mes:* $${Es(me)}
🤝 *Convenio de Pago:* $${Es(_e)}
------------------------------------------
🔥 *TOTAL PENDIENTE:* $${Es(Te)}

Por favor, gestione su pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${la}

¡Gracias!`;if(pe==="whatsapp"){const At=ae(J.phone);if(!At)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${At}?text=${encodeURIComponent(Xe)}`,"_blank"),x==="bulk"&&await l(O.id,q.id,"whatsapp");return}if(pe==="share"){if(navigator.share)try{await navigator.share({title:`Aviso de Cobro - ${q.code}`,text:Xe.replace(/\*/g,""),url:la})}catch(At){console.warn("Share failed",At)}else alert("La función de compartir no está disponible en este navegador.");return}L(pe);try{const At={channel:pe,messageType:"custom",subject:`Aviso de Cobro SAC 2026 - ${q.code}`,recipients:[{name:J.fullName,email:J.email,telegramChatId:J.telegramId,customMessage:Xe.replace(/\*/g,"")}]},Bt=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(At)})).json();Bt.status==="success"?(await l(O.id,q.id,pe),alert(`¡Éxito! Mensaje enviado por ${pe}.`)):alert("Error: "+Bt.message)}catch{alert("Error de red al enviar.")}finally{L(null)}},le=()=>{if(!_||!E)return;const pe=P.findIndex(_e=>_e.id===_),be=P.findIndex(_e=>_e.id===E);if(pe===-1||be===-1||pe>be)return alert("Rango inválido.");const me=P.slice(pe,be+1);I(me),U(0),m("bulk")},ge=pe=>{if(!O)return null;const be=Number(pe.aliquot)||0,me=!!pe.hasUncommonExpense,_e=r.filter(xt=>xt.hasUncommonExpense).length,Te=xt=>{var Vt,jt;const dr=Number(xt.amountUsd)||0;let rt=0,Ct="";if(xt.isSpecial){const er=((Vt=xt.specialPropertyIds)==null?void 0:Vt.length)||1,Dr=(jt=xt.specialPropertyIds)==null?void 0:jt.includes(pe.id);rt=Dr?dr/er:0,Ct=Dr?`ESP (1/${er})`:"Exento"}else xt.isUncommon?(rt=me&&_e>0?dr/_e:0,Ct=me&&_e>0?`GNC (1/${_e})`:"Exento"):(rt=dr*(be/100),Ct=`ALIQ (${be.toFixed(4)}%)`);return{...xt,global:dr,myPortion:rt,basisDesc:Ct}},Xe=[{title:"Gastos Fijos",items:O.fixedExpenses.map(Te)},{title:"Gastos Variables",items:O.variableExpenses.map(Te)},{title:"Otros Gastos",items:O.otherExpenses.map(Te)}],At=Xe.reduce((xt,dr)=>xt+dr.items.reduce((rt,Ct)=>rt+Ct.myPortion,0),0),kt=Number(O.reserveFundPercent)||10,Bt=At*(kt/100),Kr=At+Bt,qr=O.debts.find(xt=>xt.propertyId===pe.id),_t=qr?Number(qr.amountUsd)-Number(qr.paidAmount):Kr,Ir=G.find(xt=>xt.id===pe.id),vr=(Ir==null?void 0:Ir.current_debt)||0,Fa=_t+vr;return{sections:Xe,totalIndividualSubtotal:At,individualReserve:Bt,totalOwnerUsd:Kr,amountToPay:_t,agreementPending:vr,finalTotal:Fa,reserveFundPct:kt}},X=j.useMemo(()=>q?ge(q):null,[q,O,G]);return x!=="selection"&&q&&X?n.jsxs("div",{className:"max-w-5xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:()=>m("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex bg-slate-100 p-1 rounded-2xl border border-slate-200",children:[n.jsx("button",{onClick:()=>v("fee"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="fee"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Aviso"}),n.jsx("button",{onClick:()=>v("statement"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="statement"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Estado"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[x==="bulk"&&n.jsxs("div",{className:"flex items-center gap-2 mr-4 bg-slate-100 px-4 py-2 rounded-xl border border-slate-200",children:[n.jsxs("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:["Lote: ",M+1," / ",B.length]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{disabled:M===0,onClick:()=>U(pe=>pe-1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(fs,{size:16})}),n.jsx("button",{disabled:M===B.length-1,onClick:()=>U(pe=>pe+1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(Bc,{size:16})})]})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:oe,disabled:R,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:R?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Tp,{size:20})}),n.jsx("button",{onClick:ce,disabled:R,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen Directamente",children:R?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(_a,{size:20})}),n.jsx("button",{onClick:()=>ne("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp (Texto)",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>ne("telegram"),disabled:!(J!=null&&J.telegramId)||!!D,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${J!=null&&J.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Enviar Telegram",children:D==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>ne("email"),disabled:!(J!=null&&J.email)||!!D,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${J!=null&&J.email?"bg-indigo-600":"bg-slate-200"}`,title:"Enviar Email",children:D==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})})]})]}),n.jsxs("div",{ref:te,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:b==="fee"?"Aviso de Cobro Individual":"Estado de Cuenta Individual"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:[Ue[d]," ",f]}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300",children:[q.type," ",q.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400",children:[(Number(q.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400",children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:J==null?void 0:J.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsx("p",{className:"text-lg font-black text-blue-600 uppercase",children:q.code})]})]}),b==="fee"?n.jsx(n.Fragment,{children:X.sections.map((pe,be)=>pe.items.length===0?null:n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-1.5 h-4 bg-blue-600 rounded-full"})," ",pe.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Concepto"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-center",children:"Base"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-right",children:"Gasto Global ($)"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-blue-600 text-right px-4",children:"Su Cuota ($)"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:pe.items.map((me,_e)=>n.jsxs("tr",{children:[n.jsx("td",{className:"py-3 text-[11px] font-bold text-slate-600 uppercase",children:me.description}),n.jsx("td",{className:"py-3 text-center",children:n.jsx("span",{className:"px-2 py-0.5 rounded-lg text-[8px] font-black uppercase border bg-slate-50 text-slate-500",children:me.basisDesc})}),n.jsxs("td",{className:"py-3 text-[11px] font-black text-right text-slate-400",children:["$",Es(me.global)]}),n.jsxs("td",{className:"py-3 text-xs font-black text-blue-900 text-right px-4",children:["$",Es(me.myPortion)]})]},_e))})]})})]},be))}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-1.5 h-4 bg-amber-600 rounded-full"})," Resumen de Cuenta"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Periodo"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-right",children:"Monto ($)"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-right",children:"Pagado ($)"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-blue-600 text-right px-4",children:"Pendiente ($)"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-50",children:[t.filter(pe=>pe.year===f||pe.year===f-1).sort((pe,be)=>be.year*12+be.month-(pe.year*12+pe.month)).slice(0,12).map((pe,be)=>{const me=pe.debts.find(Te=>Te.propertyId===q.id);if(!me)return null;const _e=Number(me.amountUsd)-Number(me.paidAmount);return _e<=0?null:n.jsxs("tr",{children:[n.jsxs("td",{className:"py-3 text-[11px] font-bold text-slate-600 uppercase",children:[Ue[pe.month]," ",pe.year]}),n.jsxs("td",{className:"py-3 text-[11px] font-black text-right text-slate-400",children:["$",Es(me.amountUsd)]}),n.jsxs("td",{className:"py-3 text-[11px] font-black text-right text-emerald-500",children:["$",Es(me.paidAmount)]}),n.jsxs("td",{className:"py-3 text-xs font-black text-blue-900 text-right px-4",children:["$",Es(_e)]})]},be)}),H&&H.current_debt>0&&n.jsxs("tr",{className:"bg-amber-50/50",children:[n.jsx("td",{className:"py-3 text-[11px] font-black text-amber-600 uppercase px-2",children:"CONVENIO DE PAGO"}),n.jsx("td",{className:"py-3 text-[11px] font-black text-right text-slate-400",children:"-"}),n.jsx("td",{className:"py-3 text-[11px] font-black text-right text-emerald-500",children:"-"}),n.jsxs("td",{className:"py-3 text-xs font-black text-amber-700 text-right px-4",children:["$",Es(H.current_debt)]})]})]})]})})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block text-[8px] font-black text-slate-400 uppercase mb-1",children:"Subtotal Mes"}),n.jsxs("span",{className:"text-sm font-black text-slate-800",children:["$",Es(X.totalIndividualSubtotal)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsxs("span",{className:"block text-[8px] font-black text-blue-400 uppercase mb-1",children:["Reserva (",X.reserveFundPct,"%)"]}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:["$",Es(X.individualReserve)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block text-[8px] font-black text-amber-400 uppercase mb-1",children:"Convenio"}),n.jsxs("span",{className:"text-sm font-black text-amber-600",children:["$",Es(X.agreementPending)]})]}),n.jsxs("div",{className:"p-4 bg-slate-900 rounded-2xl text-center",children:[n.jsx("span",{className:"block text-[8px] font-black text-blue-300 uppercase mb-1",children:"Total a Pagar"}),n.jsxs("span",{className:"text-sm font-black text-white",children:["$",Es(X.finalTotal)]})]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600 p-6 rounded-3xl text-white shadow-lg",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-blue-200 tracking-widest mb-1",children:"Equivalente en Bolívares"}),n.jsxs("p",{className:"text-3xl font-black tracking-tighter",children:["Bs. ",kFe(X.finalTotal*o)]})]}),n.jsx($i,{size:40,className:"opacity-40"})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(xr,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase",children:[Z.payment_bank_name||"BanPlus"," ",Z.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider",children:["# ",Z.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["RIF: ",Z.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["Pago Móvil: ",Z.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Qr,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Enviar comprobante a:"}),(Z.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((pe,be)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:pe.trim()},be)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1",children:["WhatsApp: ",Z.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2",children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"SAC 2026 • Kernel V4.1.85 MC/MB • Generado Digitalmente"})})]})]})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Cuota Individual ",n.jsx("span",{className:"text-blue-600",children:"HTML Pro"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Envío de avisos de cobro y estados de cuenta en formato HTML/Imagen."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:pe=>u(Number(pe.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((pe,be)=>n.jsx("option",{value:be,children:pe},be))}),n.jsx("input",{type:"number",value:f,onChange:pe=>p(Number(pe.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-50 text-blue-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(PA,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío Individual"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Seleccione una propiedad específica para procesar."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:y||"",onChange:pe=>k(Number(pe.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),P.map(pe=>n.jsxs("option",{value:pe.id,children:[pe.code," - ",pe.type," ",pe.number]},pe.id))]})]}),n.jsx("button",{disabled:!y||!O,onClick:()=>m("report"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:O?n.jsxs(n.Fragment,{children:["PROCESAR INDIVIDUAL ",n.jsx(Os,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-indigo-50 text-indigo-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(wM,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío por Lote (Rango)"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Procese múltiples unidades en secuencia."})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Desde"}),n.jsxs("select",{value:_||"",onChange:pe=>C(Number(pe.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Inicio..."}),P.map(pe=>n.jsx("option",{value:pe.id,children:pe.code},pe.id))]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Hasta"}),n.jsxs("select",{value:E||"",onChange:pe=>T(Number(pe.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Fin..."}),P.map(pe=>n.jsx("option",{value:pe.id,children:pe.code},pe.id))]})]})]}),n.jsx("button",{disabled:!_||!E||!O,onClick:le,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-indigo-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:O?n.jsxs(n.Fragment,{children:["INICIAR PROCESO POR LOTE ",n.jsx(Os,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]})]}),!O&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-6 rounded-[2rem] flex items-center gap-4 text-amber-700 max-w-2xl mx-auto",children:[n.jsx(Cr,{size:24,className:"shrink-0"}),n.jsx("p",{className:"text-xs font-bold leading-relaxed uppercase tracking-tight",children:'Debe generar primero la relación de gastos global para este periodo en el módulo de "Generar Cuotas".'})]})]})},Ss=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},EFe=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},SFe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=ht(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState("selection"),[b,v]=j.useState("fee"),[y,k]=j.useState(null),[_,C]=j.useState(null),[E,T]=j.useState(null),[B,I]=j.useState([]),[M,U]=j.useState(0),[D,L]=j.useState(null),[R,Q]=j.useState(!1),[G,K]=j.useState([]),[W,z]=j.useState(!1),[Z,Y]=j.useState({}),[te,O]=j.useState(16),P=j.useRef(null);j.useEffect(()=>{(async()=>{z(!0);try{const[_e,Te]=await Promise.all([we.getInitialDebtData(),we.getSystemSettings()]);Array.isArray(_e)?K(_e):_e&&_e.success&&K(_e.data||[]),Y(Te||{})}catch(_e){console.error("Error fetching data",_e)}finally{z(!1)}})()},[]);const q=j.useMemo(()=>t.find(me=>me.month===d&&me.year===f),[t,d,f]),H=j.useMemo(()=>[...r].sort((me,_e)=>me.code.localeCompare(_e.code,void 0,{numeric:!0})),[r]),J=j.useMemo(()=>x==="report"?r.find(me=>me.id===y):x==="bulk"?B[M]:null,[x,r,y,B,M]),ae=j.useMemo(()=>G.find(me=>me.id===(J==null?void 0:J.id)),[G,J]),oe=j.useMemo(()=>{if(!J)return null;const me=a.find(Te=>Te.propertyId===J.id&&Te.isOwner),_e=s.find(Te=>Te.cedula===(me==null?void 0:me.cedula));return{fullName:(me==null?void 0:me.fullName)||"Propietario",email:(_e==null?void 0:_e.email)||"",phone:(me==null?void 0:me.phone)||(_e==null?void 0:_e.phone)||"",telegramId:(_e==null?void 0:_e.telegramChatId)||"",propertyCode:J.code,propertyId:J.id}},[J,a,s]),ce=me=>{if(!me)return"";let _e=me.trim();return _e.startsWith("+")?_e.replace(/\D/g,""):_e.startsWith("0")?"58"+_e.substring(1).replace(/\D/g,""):_e.length===10?"58"+_e.replace(/\D/g,""):_e.replace(/\D/g,"")},ne=async()=>{if(P.current){Q(!0);try{const _e=(await Hs(P.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),Te=document.createElement("a");Te.href=_e,Te.download=`Aviso_Grande_${J==null?void 0:J.code}_${Ue[d]}.png`,Te.click()}catch(me){console.error("Capture failed",me),alert("Error al capturar imagen.")}finally{Q(!1)}}},le=async()=>{if(P.current){Q(!0);try{const me=await Hs(P.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),_e=await new Promise(At=>me.toBlob(At,"image/png"));if(!_e)throw new Error("Blob creation failed");const Te=`Aviso_Grande_${J==null?void 0:J.code}_${Ue[d]}.png`,Xe=new File([_e],Te,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[Xe]}))await navigator.share({files:[Xe],title:`Aviso de Cobro - ${J==null?void 0:J.code}`,text:`Aviso de Cobro de ${Ue[d]} ${f} para la unidad ${J==null?void 0:J.code}`});else{const At=me.toDataURL("image/png"),kt=document.createElement("a");kt.href=At,kt.download=Te,kt.click(),alert("La función de compartir archivos no es compatible con este navegador. La imagen se ha descargado.")}}catch(me){console.error("Share failed",me),alert("Error al compartir imagen.")}finally{Q(!1)}}},ge=async me=>{if(!oe||!J||!q)return;const _e=q.debts.find(Bt=>Bt.propertyId===J.id),Te=_e?Number(_e.amountUsd)-Number(_e.paidAmount):0,Xe=(ae==null?void 0:ae.current_debt)||0,At=Te+Xe,kt=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${oe.fullName}*,
Unidad: *${J.type} ${J.number}* (${J.code})

📅 *Periodo:* ${Ue[d]} ${f}
------------------------------------------
💵 *Cuota del Mes:* $${Ss(Te)}
🤝 *Convenio de Pago:* $${Ss(Xe)}
------------------------------------------
🔥 *TOTAL PENDIENTE:* $${Ss(At)}

Por favor, gestione su pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${la}

¡Gracias!`;{const Bt=ce(oe.phone);if(!Bt)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${Bt}?text=${encodeURIComponent(kt)}`,"_blank"),x==="bulk"&&await l(q.id,J.id,"whatsapp");return}},X=()=>{if(!_||!E)return;const me=H.findIndex(Xe=>Xe.id===_),_e=H.findIndex(Xe=>Xe.id===E);if(me===-1||_e===-1||me>_e)return alert("Rango inválido.");const Te=H.slice(me,_e+1);I(Te),U(0),m("bulk")},pe=me=>{if(!q)return null;const _e=Number(me.aliquot)||0,Te=!!me.hasUncommonExpense,Xe=r.filter(rt=>rt.hasUncommonExpense).length,At=rt=>{var er,Dr;const Ct=Number(rt.amountUsd)||0;let Vt=0,jt="";if(rt.isSpecial){const zr=((er=rt.specialPropertyIds)==null?void 0:er.length)||1,Jn=(Dr=rt.specialPropertyIds)==null?void 0:Dr.includes(me.id);Vt=Jn?Ct/zr:0,jt=Jn?`ESP (1/${zr})`:"Exento"}else rt.isUncommon?(Vt=Te&&Xe>0?Ct/Xe:0,jt=Te&&Xe>0?`GNC (1/${Xe})`:"Exento"):(Vt=Ct*(_e/100),jt=`ALIQ (${_e.toFixed(4)}%)`);return{...rt,global:Ct,myPortion:Vt,basisDesc:jt}},kt=[{title:"Gastos Fijos",items:q.fixedExpenses.map(At)},{title:"Gastos Variables",items:q.variableExpenses.map(At)},{title:"Otros Gastos",items:q.otherExpenses.map(At)}],Bt=kt.reduce((rt,Ct)=>rt+Ct.items.reduce((Vt,jt)=>Vt+jt.myPortion,0),0),Kr=Number(q.reserveFundPercent)||10,qr=Bt*(Kr/100),_t=Bt+qr,Ir=q.debts.find(rt=>rt.propertyId===me.id),vr=Ir?Number(Ir.amountUsd)-Number(Ir.paidAmount):_t,Fa=G.find(rt=>rt.id===me.id),xt=(Fa==null?void 0:Fa.current_debt)||0,dr=vr+xt;return{sections:kt,totalIndividualSubtotal:Bt,individualReserve:qr,totalOwnerUsd:_t,amountToPay:vr,agreementPending:xt,finalTotal:dr,reserveFundPct:Kr}},be=j.useMemo(()=>J?pe(J):null,[J,q,G]);return x!=="selection"&&J&&be?n.jsxs("div",{className:"max-w-5xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:()=>m("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex bg-slate-100 p-1 rounded-2xl border border-slate-200",children:[n.jsx("button",{onClick:()=>v("fee"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="fee"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Aviso"}),n.jsx("button",{onClick:()=>v("statement"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="statement"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Estado"})]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-2 bg-white px-4 py-2 rounded-2xl border border-slate-200 shadow-sm",children:[n.jsx(QK,{size:16,className:"text-slate-400"}),n.jsx("button",{onClick:()=>O(me=>Math.max(12,me-2)),className:"p-1 text-slate-500 hover:text-blue-600 font-black",children:"-"}),n.jsxs("span",{className:"text-[10px] font-black w-8 text-center",children:[te,"px"]}),n.jsx("button",{onClick:()=>O(me=>Math.min(32,me+2)),className:"p-1 text-slate-500 hover:text-blue-600 font-black",children:"+"})]}),x==="bulk"&&n.jsxs("div",{className:"flex items-center gap-2 bg-slate-100 px-4 py-2 rounded-xl border border-slate-200",children:[n.jsxs("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:["Lote: ",M+1," / ",B.length]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{disabled:M===0,onClick:()=>U(me=>me-1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(fs,{size:16})}),n.jsx("button",{disabled:M===B.length-1,onClick:()=>U(me=>me+1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(Bc,{size:16})})]})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:ne,disabled:R,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:R?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Tp,{size:20})}),n.jsx("button",{onClick:le,disabled:R,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen Directamente",children:R?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(_a,{size:20})}),n.jsx("button",{onClick:()=>ge(),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp (Texto)",children:n.jsx(vn,{size:20})})]})]}),n.jsxs("div",{ref:P,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",style:{fontSize:`${te}px`},children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",style:{fontSize:`${te*1.5}px`},children:b==="fee"?"Aviso de Cobro Individual":"Estado de Cuenta Individual"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",style:{fontSize:`${te*.7}px`},children:[Ue[d]," ",f]}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",style:{fontSize:`${te*.5}px`},children:"Inmueble"}),n.jsxs("p",{className:"font-black text-blue-300",style:{fontSize:`${te*1.2}px`},children:[J.type," ",J.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",style:{fontSize:`${te*.5}px`},children:"Alícuota"}),n.jsxs("p",{className:"font-black text-emerald-400",style:{fontSize:`${te*1.2}px`},children:[(Number(J.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",style:{fontSize:`${te*.5}px`},children:"Tasa del Día"}),n.jsxs("p",{className:"font-black text-amber-400",style:{fontSize:`${te*1.2}px`},children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",style:{fontSize:`${te*.6}px`},children:"Propietario"}),n.jsx("p",{className:"font-black text-slate-900 uppercase",style:{fontSize:`${te*1.2}px`},children:oe==null?void 0:oe.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",style:{fontSize:`${te*.6}px`},children:"Unidad"}),n.jsx("p",{className:"font-black text-blue-600 uppercase",style:{fontSize:`${te*1.2}px`},children:J.code})]})]}),b==="fee"?n.jsx(n.Fragment,{children:be.sections.map((me,_e)=>me.items.length===0?null:n.jsxs("div",{children:[n.jsxs("h3",{className:"font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",style:{fontSize:`${te*.9}px`},children:[n.jsx("div",{className:"w-1.5 h-4 bg-blue-600 rounded-full"})," ",me.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 tracking-widest",style:{fontSize:`${te*.6}px`},children:"Concepto"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-center",style:{fontSize:`${te*.6}px`},children:"Base"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${te*.6}px`},children:"Gasto Global ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-blue-600 text-right px-4",style:{fontSize:`${te*.6}px`},children:"Su Cuota ($)"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:me.items.map((Te,Xe)=>n.jsxs("tr",{children:[n.jsx("td",{className:"py-3 font-bold text-slate-600 uppercase",style:{fontSize:`${te*.7}px`},children:Te.description}),n.jsx("td",{className:"py-3 text-center",children:n.jsx("span",{className:"px-2 py-0.5 rounded-lg font-black uppercase border bg-slate-50 text-slate-500",style:{fontSize:`${te*.5}px`},children:Te.basisDesc})}),n.jsxs("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${te*.7}px`},children:["$",Ss(Te.global)]}),n.jsxs("td",{className:"py-3 font-black text-blue-900 text-right px-4",style:{fontSize:`${te*.8}px`},children:["$",Ss(Te.myPortion)]})]},Xe))})]})})]},_e))}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("h3",{className:"font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",style:{fontSize:`${te*.9}px`},children:[n.jsx("div",{className:"w-1.5 h-4 bg-amber-600 rounded-full"})," Resumen de Cuenta"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 tracking-widest",style:{fontSize:`${te*.6}px`},children:"Periodo"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${te*.6}px`},children:"Monto ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${te*.6}px`},children:"Pagado ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-blue-600 text-right px-4",style:{fontSize:`${te*.6}px`},children:"Pendiente ($)"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-50",children:[t.filter(me=>me.year===f||me.year===f-1).sort((me,_e)=>_e.year*12+_e.month-(me.year*12+me.month)).slice(0,12).map((me,_e)=>{const Te=me.debts.find(At=>At.propertyId===J.id);if(!Te)return null;const Xe=Number(Te.amountUsd)-Number(Te.paidAmount);return Xe<=0?null:n.jsxs("tr",{children:[n.jsxs("td",{className:"py-3 font-bold text-slate-600 uppercase",style:{fontSize:`${te*.7}px`},children:[Ue[me.month]," ",me.year]}),n.jsxs("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${te*.7}px`},children:["$",Ss(Te.amountUsd)]}),n.jsxs("td",{className:"py-3 font-black text-right text-emerald-500",style:{fontSize:`${te*.7}px`},children:["$",Ss(Te.paidAmount)]}),n.jsxs("td",{className:"py-3 font-black text-blue-900 text-right px-4",style:{fontSize:`${te*.8}px`},children:["$",Ss(Xe)]})]},_e)}),ae&&ae.current_debt>0&&n.jsxs("tr",{className:"bg-amber-50/50",children:[n.jsx("td",{className:"py-3 font-black text-amber-600 uppercase px-2",style:{fontSize:`${te*.7}px`},children:"CONVENIO DE PAGO"}),n.jsx("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${te*.7}px`},children:"-"}),n.jsx("td",{className:"py-3 font-black text-right text-emerald-500",style:{fontSize:`${te*.7}px`},children:"-"}),n.jsxs("td",{className:"py-3 font-black text-amber-700 text-right px-4",style:{fontSize:`${te*.8}px`},children:["$",Ss(ae.current_debt)]})]})]})]})})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block font-black text-slate-400 uppercase mb-1",style:{fontSize:`${te*.5}px`},children:"Subtotal Mes"}),n.jsxs("span",{className:"font-black text-slate-800",style:{fontSize:`${te*.9}px`},children:["$",Ss(be.totalIndividualSubtotal)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsxs("span",{className:"block font-black text-blue-400 uppercase mb-1",style:{fontSize:`${te*.5}px`},children:["Reserva (",be.reserveFundPct,"%)"]}),n.jsxs("span",{className:"font-black text-blue-600",style:{fontSize:`${te*.9}px`},children:["$",Ss(be.individualReserve)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block font-black text-amber-400 uppercase mb-1",style:{fontSize:`${te*.5}px`},children:"Convenio"}),n.jsxs("span",{className:"font-black text-amber-600",style:{fontSize:`${te*.9}px`},children:["$",Ss(be.agreementPending)]})]}),n.jsxs("div",{className:"p-4 bg-slate-900 rounded-2xl text-center",children:[n.jsx("span",{className:"block font-black text-blue-300 uppercase mb-1",style:{fontSize:`${te*.5}px`},children:"Total a Pagar"}),n.jsxs("span",{className:"font-black text-white",style:{fontSize:`${te*.9}px`},children:["$",Ss(be.finalTotal)]})]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600 p-6 rounded-3xl text-white shadow-lg",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-black uppercase text-blue-200 tracking-widest mb-1",style:{fontSize:`${te*.6}px`},children:"Equivalente en Bolívares"}),n.jsxs("p",{className:"font-black tracking-tighter",style:{fontSize:`${te*1.8}px`},children:["Bs. ",EFe(be.finalTotal*o)]})]}),n.jsx($i,{size:40,className:"opacity-40"})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",style:{fontSize:`${te*.6}px`},children:[n.jsx(xr,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"font-bold text-slate-700 uppercase",style:{fontSize:`${te*.7}px`},children:[Z.payment_bank_name||"BanPlus"," ",Z.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"font-black text-blue-900 tracking-wider",style:{fontSize:`${te*.7}px`},children:["# ",Z.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"font-bold text-slate-600 uppercase",style:{fontSize:`${te*.7}px`},children:["RIF: ",Z.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"font-bold text-slate-600 uppercase",style:{fontSize:`${te*.7}px`},children:["Pago Móvil: ",Z.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",style:{fontSize:`${te*.6}px`},children:[n.jsx(Qr,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"font-black text-slate-400 uppercase",style:{fontSize:`${te*.6}px`},children:"Enviar comprobante a:"}),(Z.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((me,_e)=>n.jsx("p",{className:"font-bold text-slate-700",style:{fontSize:`${te*.7}px`},children:me.trim()},_e)),n.jsxs("p",{className:"font-bold text-slate-600 uppercase mt-1",style:{fontSize:`${te*.7}px`},children:["WhatsApp: ",Z.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"font-black text-amber-600 uppercase italic mt-2",style:{fontSize:`${te*.6}px`},children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"font-black text-slate-300 uppercase tracking-[0.5em]",style:{fontSize:`${te*.5}px`},children:"SAC 2026 • Kernel V4.1.85 MC/MB • Generado Digitalmente"})})]})]})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Cuota Individual ",n.jsx("span",{className:"text-blue-600",children:"HTML Grande"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Versión con tamaño de letra ajustable para mejor legibilidad."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:me=>u(Number(me.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((me,_e)=>n.jsx("option",{value:_e,children:me},_e))}),n.jsx("input",{type:"number",value:f,onChange:me=>p(Number(me.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-50 text-blue-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(PA,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío Individual"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Seleccione una propiedad específica para procesar."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:y||"",onChange:me=>k(Number(me.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),H.map(me=>n.jsxs("option",{value:me.id,children:[me.code," - ",me.type," ",me.number]},me.id))]})]}),n.jsx("button",{disabled:!y||!q,onClick:()=>m("report"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:q?n.jsxs(n.Fragment,{children:["PROCESAR INDIVIDUAL ",n.jsx(Os,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-indigo-50 text-indigo-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(wM,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío por Lote (Rango)"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Procese múltiples unidades en secuencia."})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Desde"}),n.jsxs("select",{value:_||"",onChange:me=>C(Number(me.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Inicio..."}),H.map(me=>n.jsx("option",{value:me.id,children:me.code},me.id))]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Hasta"}),n.jsxs("select",{value:E||"",onChange:me=>T(Number(me.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Fin..."}),H.map(me=>n.jsx("option",{value:me.id,children:me.code},me.id))]})]})]}),n.jsx("button",{disabled:!_||!E||!q,onClick:X,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-indigo-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:q?n.jsxs(n.Fragment,{children:["INICIAR PROCESO POR LOTE ",n.jsx(Os,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]})]}),!q&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-6 rounded-[2rem] flex items-center gap-4 text-amber-700 max-w-2xl mx-auto",children:[n.jsx(Cr,{size:24,className:"shrink-0"}),n.jsx("p",{className:"text-xs font-bold leading-relaxed uppercase tracking-tight",children:'Debe generar primero la relación de gastos global para este periodo en el módulo de "Generar Cuotas".'})]})]})},BFe=({user:e})=>{const{moduleStatus:t,updateModuleStatus:r,loading:a}=ht(),[s,i]=j.useState(null),l=async(o,d)=>{if(!(s||a)){i(o);try{await r(o,!d)}catch(u){console.error("Kernel Sync Error:",u);const f=u.message||"Error desconocido de red.";alert(`ALERTA DE SISTEMA (Kernel V4.1.51)

Fallo en la sincronización del módulo: ${o}

Detalle: ${f}

Si el error persiste, verifique que los archivos .md se subieron correctamente como .php al servidor.`)}finally{i(null)}}};return e.role!=="programmer"?n.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh] animate-in fade-in duration-500",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] border border-red-100 text-center shadow-2xl max-w-lg",children:[n.jsx(kM,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Bloqueado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Este módulo de configuración SaaS es de uso exclusivo para el Arquitecto de Sistemas."})]})}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[3.5rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-indigo-500/20 w-fit px-4 py-1.5 rounded-full border border-indigo-500/30 flex items-center gap-2 mb-4",children:[n.jsx(Om,{size:14,className:"text-indigo-400"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-indigo-400",children:"SaaS Package Manager v4.1.67"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Configuración de ",n.jsx("span",{className:"text-indigo-500 italic",children:"Módulos"})]}),n.jsx("p",{className:"text-slate-400 mt-4 text-lg font-medium max-w-lg",children:"Kernel V4.1.67: Active o desactive funciones para ajustar la versión de renta del cliente."})]}),n.jsx(Om,{size:220,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),t.length===0?n.jsxs("div",{className:"bg-white p-20 rounded-[3rem] text-center border-2 border-dashed border-slate-200",children:[n.jsx(ot,{className:"animate-spin mx-auto mb-4 text-slate-300",size:40}),n.jsx("p",{className:"text-slate-400 font-black uppercase tracking-widest text-[10px]",children:"Consultando registros del sistema..."})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(o=>n.jsxs("div",{className:`p-8 rounded-[2.5rem] border-2 transition-all duration-300 flex flex-col justify-between group ${o.isActive?"bg-white border-indigo-100 shadow-xl":"bg-slate-50 border-slate-200 opacity-60 grayscale"}`,children:[n.jsxs("div",{className:"flex justify-between items-start mb-8",children:[n.jsx("div",{className:`p-4 rounded-2xl transition-all ${o.isActive?"bg-indigo-600 text-white shadow-lg shadow-indigo-200":"bg-slate-200 text-slate-400"}`,children:_Fe(o.id)}),n.jsxs("button",{disabled:s===o.id||a,onClick:()=>l(o.id,o.isActive),className:`w-16 h-8 rounded-full transition-all relative flex items-center ${o.isActive?"bg-indigo-600":"bg-slate-300"}`,children:[n.jsx("div",{className:`absolute w-6 h-6 bg-white rounded-full transition-all shadow-md ${o.isActive?"right-1":"left-1"}`}),s===o.id&&n.jsx(ot,{size:10,className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 animate-spin text-indigo-600"})]})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-black text-slate-900 uppercase tracking-tight text-lg mb-1",children:o.label}),n.jsx("p",{className:`text-[10px] font-black uppercase tracking-widest ${o.isActive?"text-indigo-600":"text-slate-400"}`,children:o.isActive?"ESTADO: ACTIVO (ON)":"ESTADO: RESTRINGIDO (OFF)"})]})]},o.id))}),n.jsxs("div",{className:"p-10 bg-blue-50 border border-blue-100 rounded-[3.5rem] flex items-start gap-8 shadow-sm",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-lg shrink-0",children:n.jsx(Ea,{size:32})}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-black text-blue-900 uppercase text-sm tracking-widest",children:"Protocolo de Integridad SaaS 2026"}),n.jsx("p",{className:"text-blue-800/70 text-sm font-medium leading-relaxed italic uppercase",children:"Cualquier cambio realizado en este panel se propaga instantáneamente a todos los usuarios del sistema. Al desactivar un módulo, este dejará de ser visible en el menú lateral y sus rutas de acceso quedarán inhabilitadas preventivamente."})]})]})]})},_Fe=e=>({"prefill-simulator":n.jsx(sa,{size:24}),"bank-reconciliation":n.jsx(kA,{size:24}),"bank-reconciliation-bnc":n.jsx(kA,{size:24}),"statement-analyzer":n.jsx($f,{size:24}),"statement-analyzer-bnc":n.jsx(xr,{size:24}),"statement-detailed":n.jsx(Pc,{size:24}),"banplus-commissions":n.jsx(ps,{size:24}),commissions:n.jsx(ps,{size:24}),audit:n.jsx(po,{size:24}),currency:n.jsx(La,{size:24}),messages:n.jsx(Gi,{size:24}),polls:n.jsx(Md,{size:24}),"data-forms":n.jsx(Xd,{size:24}),"live-voting":n.jsx(Kf,{size:24}),reservations:n.jsx(gM,{size:24}),announcements:n.jsx(Gf,{size:24}),services:n.jsx(qf,{size:24}),assemblies:n.jsx(mM,{size:24}),"recaudacion-detallada":n.jsx(xr,{size:24}),"historial-pagos-egresos":n.jsx(aa,{size:24}),"expediente-digital":n.jsx(Rm,{size:24}),"payment-agreements":n.jsx(Zd,{size:24}),"history-agreements":n.jsx(Ba,{size:24}),"excel-reports":n.jsx(gl,{size:24}),"detailed-excel-reports":n.jsx(gl,{size:24}),"html-reports":n.jsx(gr,{size:24}),calculator:n.jsx(mi,{size:24}),statistics:n.jsx(bM,{size:24}),"payment-status":n.jsx(zt,{size:24}),"payment-receipt":n.jsx(aa,{size:24}),"individual-fee-view":n.jsx(PA,{size:24}),"individual-fee-html":n.jsx(ja,{size:24}),"individual-fee-html-large":n.jsx(ja,{size:24}),"individual-account-status":n.jsx(aa,{size:24}),"detailed-account-status":n.jsx(Ba,{size:24}),"monthly-debt-status":n.jsx(aa,{size:24}),"monthly-debt-status-massive":n.jsx(Gi,{size:24}),"credit-balances":n.jsx(wn,{size:24}),"monthly-collection":n.jsx(ha,{size:24}),"debt-list":n.jsx(gr,{size:24}),"solvent-list":n.jsx(zt,{size:24}),"payment-report":n.jsx(aa,{size:24}),"bank-precise":n.jsx(zt,{size:24}),"saldo-desglosado":n.jsx(aa,{size:24}),"saldo-desglosado-avanzado":n.jsx(yl,{size:24})})[e]||n.jsx(cb,{size:24}),Va=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},TFe=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},FFe=({user:e})=>{const{properties:t,residents:r,refreshData:a}=ht(),[s,i]=j.useState(!0),[l,o]=j.useState(""),[d,u]=j.useState([]),[f,p]=j.useState(null);["admin","programmer","board"].includes(e.role);const x=async()=>{i(!0);try{const k=await we.getInitialDebtData();Array.isArray(k)?u(k):k&&k.success?u(k.data||[]):console.error("Kernel Response Error:",k)}catch(k){console.error("Kernel Sync Failed:",k)}finally{i(!1)}};j.useEffect(()=>{x()},[]);const m=j.useMemo(()=>d.filter(k=>(k.code||"").toLowerCase().includes(l.toLowerCase())||(k.ownerName||"").toLowerCase().includes(l.toLowerCase())),[d,l]),b=k=>{const _=window.open("","","width=900,height=900");if(!_)return;const C=(k.history||[]).map(E=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${E.date}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-size:10px;">${E.description}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-family:monospace;">${E.reference}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Va(E.amount_usd)}</td>
            </tr>
        `).join("");_.document.write(`
            <html>
            <head>
                <title>Convenio de Pago - ${k.code}</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.6; }
                    .header { text-align: center; border-bottom: 5px solid #0f172a; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; }
                    .stats { display: flex; justify-content: space-between; margin: 30px 0; background: #f8fafc; padding: 20px; border-radius: 15px; border: 1px solid #e2e8f0; }
                    .stat-box { text-align: center; }
                    .stat-label { font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b; }
                    .stat-val { font-size: 20px; font-weight: 900; color: #0f172a; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 10px; background: #0f172a; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>ESTADO DE CUENTA - DEUDA HISTÓRICA</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <div style="margin-bottom: 20px;">
                    <p><b>UNIDAD:</b> ${k.code}</p>
                    <p><b>TITULAR:</b> ${k.ownerName}</p>
                    <p><b>FECHA DE EMISIÓN:</b> ${new Date().toLocaleDateString()}</p>
                </div>
                <div class="stats">
                    <div class="stat-box"><div class="stat-label">Deuda Original</div><div class="stat-val">$${Va(k.original_debt)}</div></div>
                    <div class="stat-box"><div class="stat-label">Total Abonado</div><div class="stat-val" style="color: #10b981;">$${Va(k.total_paid)}</div></div>
                    <div class="stat-box"><div class="stat-label">Saldo Pendiente</div><div class="stat-val" style="color: #ef4444;">$${Va(k.current_debt)}</div></div>
                </div>
                <h3>DETALLE DE ABONOS REGISTRADOS</h3>
                <table>
                    <thead><tr><th>Fecha</th><th>Concepto Bancario</th><th>Referencia</th><th>Monto USD</th></tr></thead>
                    <tbody>${C||'<tr><td colspan="4" style="text-align:center; padding:30px;">No se registran abonos a la deuda histórica aún.</td></tr>'}</tbody>
                </table>
                <div class="footer">Este documento es una certificación digital del Kernel V4.1.12 • Powered by TecnoMath</div>
            </body>
            </html>
        `),_.document.close(),_.print()},v=()=>{const k=window.open("","","width=900,height=900");if(!k)return;const _=m.map(C=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.code}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.ownerName}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Va(C.original_debt)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Va(C.total_paid)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right; font-weight:bold;">$${Va(C.current_debt)}</td>
            </tr>
        `).join("");k.document.write(`
            <html>
            <head>
                <title>Listado de Convenios de Pago</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #2563eb; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #1e3a8a; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #1e3a8a; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>MONITOR DE CONVENIOS DE PAGO</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Deuda Original</th>
                            <th>Total Abonado</th>
                            <th>Saldo Pendiente</th>
                        </tr>
                    </thead>
                    <tbody>${_}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.12</div>
            </body>
            </html>
        `),k.document.close(),k.print()},y=()=>{const k=m.map(B=>`
            <tr>
                <td>${B.code}</td>
                <td>${B.ownerName}</td>
                <td>$${Va(B.original_debt)}</td>
                <td>$${Va(B.total_paid)}</td>
                <td>$${Va(B.current_debt)}</td>
            </tr>
        `).join(""),_=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Convenios de Pago - Exportación</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #1e3a8a; border-bottom: 2px solid #2563eb; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Listado de Convenios de Pago</h1>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Deuda Original</th>
                            <th>Total Abonado</th>
                            <th>Saldo Pendiente</th>
                        </tr>
                    </thead>
                    <tbody>${k}</tbody>
                </table>
            </body>
            </html>
        `,C=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(C),T=document.createElement("a");T.href=E,T.download=`Convenios_Pago_${new Date().toISOString().split("T")[0]}.html`,T.click(),URL.revokeObjectURL(E)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Zd,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Protocolo de Recuperación V4.1.12"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Convenios ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"de Pago"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:"Monitor de rastro histórico para deudas migradas al inicio de gestión."})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px] text-slate-900",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-3xl flex items-center justify-center mb-6 shadow-inner",children:n.jsx(ha,{size:40})}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Recuperación Total"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter",children:["$",Va(d.reduce((k,_)=>k+(_.total_paid||0),0))]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:x,className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2",children:[n.jsx(ot,{size:14,className:s?"animate-spin":""})," Sincronizar Kernel"]})]})]}),n.jsx(La,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center bg-slate-50/30 gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar unidad o propietario...",className:"w-full bg-white border border-slate-200 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-blue-600",value:l,onChange:k=>o(k.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:v,className:"flex items-center gap-3 px-6 py-4 bg-slate-800 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-900 transition-all shadow-xl active:scale-95",children:[n.jsx(yt,{size:18})," Imprimir Lista"]}),n.jsxs("button",{onClick:y,className:"flex items-center gap-3 px-6 py-4 bg-blue-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-blue-700 transition-all shadow-xl shadow-blue-200 active:scale-95",children:[n.jsx(Jd,{size:18})," HTML"]})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Titular / Convenio"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Deuda Original"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Abonado"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Saldo Restante"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:s?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-20 text-center",children:n.jsx(ot,{className:"animate-spin mx-auto text-blue-600",size:32})})}):m.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-20 text-center text-slate-300 italic",children:"No se detectaron convenios históricos."})}):m.map((k,_)=>{const C=k.original_debt>0?k.total_paid/k.original_debt*100:0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg",children:k.code})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-700 text-xs uppercase leading-tight",children:k.ownerName}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-tighter mt-1 italic",children:"Convenio Permanente"})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-sm font-black text-slate-400 font-mono",children:["$ ",Va(k.original_debt)]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("span",{className:"text-sm font-black text-emerald-600 font-mono",children:["$ ",Va(k.total_paid)]}),n.jsx("div",{className:"w-24 h-1.5 bg-slate-100 rounded-full overflow-hidden mx-auto border border-slate-200",children:n.jsx("div",{className:"h-full bg-emerald-500 transition-all duration-1000",style:{width:`${C}%`}})})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-lg font-black tracking-tighter ${k.current_debt>0?"text-rose-600":"text-emerald-500"}`,children:["$ ",Va(k.current_debt)]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>p(k),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",title:"Ver Línea de Tiempo",children:n.jsx(Ba,{size:18})}),n.jsx("button",{onClick:()=>b(k),className:"p-3 bg-slate-100 text-slate-500 rounded-xl hover:bg-slate-900 hover:text-white transition-all shadow-sm",children:n.jsx(yt,{size:18})})]})})]},_)})})]})})]}),f&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[400] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] w-full max-w-4xl max-h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-slate-100 flex justify-between items-center bg-white shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl shadow-blue-100",children:n.jsx(Ba,{size:28})}),"tube ",f.code,n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:f.code}),n.jsx("p",{className:"text-blue-600 font-black text-[10px] uppercase tracking-[0.2em] mt-2",children:"Línea de Tiempo de Recuperación"})]})]}),n.jsx("button",{onClick:()=>p(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-8 lg:p-12 bg-slate-50 custom-scrollbar",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[n.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm text-center",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-2",children:"Original"}),n.jsxs("p",{className:"text-2xl font-black text-slate-800",children:["$ ",Va(f.original_debt)]})]}),n.jsxs("div",{className:"bg-emerald-50 p-6 rounded-3xl border border-emerald-100 shadow-sm text-center",children:[n.jsx("p",{className:"text-[9px] font-black text-emerald-600 uppercase mb-2",children:"Total Pagado"}),n.jsxs("p",{className:"text-2xl font-black text-emerald-700",children:["$ ",Va(f.total_paid)]})]}),n.jsxs("div",{className:"bg-rose-50 p-6 rounded-3xl border border-rose-100 shadow-sm text-center",children:[n.jsx("p",{className:"text-[9px] font-black text-rose-600 uppercase mb-2",children:"Restante"}),n.jsxs("p",{className:"text-2xl font-black text-rose-700",children:["$ ",Va(f.current_debt)]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest px-2 mb-4",children:"Registro Cronológico de Operaciones"}),(f.history||[]).length===0?n.jsxs("div",{className:"py-16 text-center bg-white rounded-3xl border-2 border-dashed border-slate-200",children:[n.jsx(Cr,{className:"mx-auto mb-4 text-slate-300",size:32}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-xs",children:"Sin abonos registrados en el sistema"})]}):f.history.map((k,_)=>n.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm flex items-center justify-between group hover:border-blue-300 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-50 text-blue-600 flex items-center justify-center font-black text-[10px]",children:k.date.split("-")[2]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-xs uppercase leading-tight",children:k.description}),n.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["REF: ",k.reference]}),n.jsx("span",{className:"text-[9px] font-black text-blue-500 bg-blue-50 px-2 rounded",children:"CONTABLE"})]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-lg font-black text-emerald-600 tracking-tighter",children:["$ ",Va(k.amount_usd)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Bs. ",TFe(k.amount_bs)]})]})]},_))]})]}),n.jsxs("div",{className:"p-8 bg-white border-t border-slate-100 flex justify-between items-center shrink-0",children:[n.jsxs("button",{onClick:()=>b(f),className:"bg-slate-900 text-white px-8 py-4 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-xl flex items-center gap-2 active:scale-95",children:[n.jsx(yt,{size:16})," IMPRIMIR CERTIFICADO DE PAGO"]}),n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.4em]",children:"Audit Trail Kernel V4.1.12"})]})]})})]})},uc=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},IFe=({user:e})=>{const[t,r]=j.useState(!0),[a,s]=j.useState(""),[i,l]=j.useState([]),[o,d]=j.useState(null),u=async()=>{r(!0);try{const v=await(await fetch(`${ye}/get_archived_agreements.php`,{credentials:"include"})).json();v.success&&l(v.data||[])}catch(b){console.error("Archive Sync Failed:",b)}finally{r(!1)}};j.useEffect(()=>{u()},[]);const f=j.useMemo(()=>i.filter(b=>(b.code||"").toLowerCase().includes(a.toLowerCase())||(b.owner_name||"").toLowerCase().includes(a.toLowerCase())),[i,a]),p=b=>{const v=window.open("","","width=900,height=900");if(!v)return;const _=JSON.parse(b.payment_history_json||"[]").filter(C=>{const E=C.description||"";return new RegExp(`RECUPERACIÓN DEUDA (HISTÓRICA|ANTERIOR): ${b.code}([^0-9]|$)`,"i").test(E)}).map(C=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.date}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-size:10px;">${C.description}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-family:monospace;">${C.reference}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${uc(C.amount_usd)}</td>
            </tr>
        `).join("");v.document.write(`
            <html>
            <head>
                <title>Acta de Solvencia Histórica - ${b.code}</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.6; }
                    .header { text-align: center; border-bottom: 5px solid #10b981; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #065f46; }
                    .stats { display: flex; justify-content: space-between; margin: 30px 0; background: #ecfdf5; padding: 20px; border-radius: 15px; border: 1px solid #d1fae5; }
                    .stat-box { text-align: center; }
                    .stat-label { font-size: 10px; font-weight: 900; text-transform: uppercase; color: #059669; }
                    .stat-val { font-size: 20px; font-weight: 900; color: #065f46; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 10px; background: #065f46; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>CERTIFICACIÓN DE SOLVENCIA HISTÓRICA</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <div style="margin-bottom: 20px;">
                    <p><b>UNIDAD:</b> ${b.code}</p>
                    <p><b>TITULAR AL CIERRE:</b> ${b.owner_name}</p>
                    <p><b>FECHA DE LIQUIDACIÓN:</b> ${b.completion_date}</p>
                    <p><b>ID SESIÓN:</b> ARC-${b.id}</p>
                </div>
                <div class="stats">
                    <div class="stat-box"><div class="stat-label">Deuda Recuperada</div><div class="stat-val">$${uc(b.original_amount)}</div></div>
                    <div class="stat-box"><div class="stat-label">Estatus Final</div><div class="stat-val">SOLVENTE</div></div>
                </div>
                <h3>DESGLOSE DE OPERACIONES QUE SALDARON EL COMPROMISO</h3>
                <table>
                    <thead><tr><th>Fecha</th><th>Concepto</th><th>Referencia</th><th>Monto USD</th></tr></thead>
                    <tbody>${_}</tbody>
                </table>
                <div class="footer">Este documento es una certificación digital del Kernel V4.1.12 • Powered by TecnoMath</div>
            </body>
            </html>
        `),v.document.close(),v.print()},x=()=>{const b=window.open("","","width=900,height=900");if(!b)return;const v=f.map(y=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${y.code}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${y.owner_name}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${uc(y.original_amount)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:center;">${y.completion_date}</td>
            </tr>
        `).join("");b.document.write(`
            <html>
            <head>
                <title>Histórico de Convenios Finalizados</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #059669; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #064e3b; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #064e3b; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>ARCHIVO HISTÓRICO DE CONVENIOS FINALIZADOS</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario al Cierre</th>
                            <th>Monto Liquidado</th>
                            <th>Fecha de Cierre</th>
                        </tr>
                    </thead>
                    <tbody>${v}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.12</div>
            </body>
            </html>
        `),b.document.close(),b.print()},m=()=>{const b=f.map(C=>`
            <tr>
                <td>${C.code}</td>
                <td>${C.owner_name}</td>
                <td>$${uc(C.original_amount)}</td>
                <td>${C.completion_date}</td>
            </tr>
        `).join(""),v=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Histórico de Convenios - Exportación</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #064e3b; border-bottom: 2px solid #059669; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Histórico de Convenios Finalizados</h1>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario al Cierre</th>
                            <th>Monto Liquidado</th>
                            <th>Fecha de Cierre</th>
                        </tr>
                    </thead>
                    <tbody>${b}</tbody>
                </table>
            </body>
            </html>
        `,y=new Blob([v],{type:"text/html"}),k=URL.createObjectURL(y),_=document.createElement("a");_.href=k,_.download=`Historico_Convenios_${new Date().toISOString().split("T")[0]}.html`,_.click(),URL.revokeObjectURL(k)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-emerald-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-emerald-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-emerald-600 w-fit px-5 py-2 rounded-full border border-emerald-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Ba,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Archivo Histórico de Solvencias"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Histórico ",n.jsx("br",{}),n.jsx("span",{className:"text-emerald-400 italic",children:"de Convenios"})]}),n.jsx("p",{className:"text-emerald-100/60 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Memoria institucional de deudas recuperadas exitosamente. El rastro de la buena gestión."'})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px] text-slate-900",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-3xl flex items-center justify-center mb-6 shadow-inner",children:n.jsx(zt,{size:40})}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Total Recuperado Archivado"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter text-emerald-600",children:["$",uc(i.reduce((b,v)=>b+Number(v.original_amount),0))]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:u,className:"w-full bg-emerald-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2",children:[n.jsx(ot,{size:14,className:t?"animate-spin":""})," Sincronizar Archivo"]})]})]}),n.jsx(La,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por inmueble o propietario...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-emerald-600",value:a,onChange:b=>s(b.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:x,className:"flex items-center gap-3 px-6 py-4 bg-slate-800 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-900 transition-all shadow-xl active:scale-95",children:[n.jsx(yt,{size:18})," Imprimir Lista"]}),n.jsxs("button",{onClick:m,className:"flex items-center gap-3 px-6 py-4 bg-emerald-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-emerald-700 transition-all shadow-xl shadow-emerald-200 active:scale-95",children:[n.jsx(Jd,{size:18})," HTML"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Propietario al Cierre"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Monto Liquidado"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Fecha Cierre"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Detalle"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:t?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center",children:n.jsx(ot,{className:"animate-spin mx-auto text-emerald-600",size:32})})}):f.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic uppercase font-black text-xs",children:"Sin registros históricos archivados"})}):f.map((b,v)=>n.jsxs("tr",{className:"hover:bg-emerald-50/20 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg",children:b.code})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-700 text-xs uppercase",children:b.owner_name}),n.jsx("p",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-tighter mt-1 italic",children:"Convenio Finalizado"})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-sm font-black text-emerald-600 font-mono",children:["$ ",uc(b.original_amount)]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("span",{className:"text-xs font-black text-slate-400",children:b.completion_date})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>d(b),className:"p-3 bg-emerald-50 text-emerald-600 rounded-xl hover:bg-emerald-600 hover:text-white transition-all shadow-sm",children:n.jsx(_c,{size:18})}),n.jsx("button",{onClick:()=>p(b),className:"p-3 bg-slate-100 text-slate-500 rounded-xl hover:bg-slate-900 hover:text-white transition-all shadow-sm",children:n.jsx(yt,{size:18})})]})})]},v))})]})})}),o&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[400] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] w-full max-w-4xl max-h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-emerald-100 flex justify-between items-center bg-white shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(Ba,{size:28})}),n.jsxs("div",{children:[n.jsxs("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:["Rastro de Solvencia: ",o.code]}),n.jsx("p",{className:"text-emerald-600 font-black text-[10px] uppercase tracking-[0.2em] mt-2",children:"Archivo Digital Permanente"})]})]}),n.jsx("button",{onClick:()=>d(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-8 lg:p-12 bg-slate-50 custom-scrollbar",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-10",children:[n.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-2",children:"Total Recuperado"}),n.jsxs("p",{className:"text-3xl font-black text-emerald-600",children:["$ ",uc(o.original_amount)]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-2",children:"Fecha de Finalización"}),n.jsx("p",{className:"text-xl font-black text-slate-800",children:o.completion_date})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest px-2 mb-4",children:"Abonos que consolidaron la deuda"}),JSON.parse(o.payment_history_json||"[]").filter(y=>{const k=y.description||"";return new RegExp(`RECUPERACIÓN DEUDA (HISTÓRICA|ANTERIOR): ${o.code}([^0-9]|$)`,"i").test(k)}).map((y,k)=>n.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm flex items-center justify-between group hover:border-emerald-300 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center font-black text-[10px]",children:y.date.split("-")[2]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-xs uppercase leading-tight",children:y.description}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase mt-1",children:["REF: ",y.reference," • BANPLUS VET"]})]})]}),n.jsx("div",{className:"text-right",children:n.jsxs("p",{className:"text-lg font-black text-emerald-600 tracking-tighter",children:["$ ",uc(y.amount_usd)]})})]},k))]})]}),n.jsxs("div",{className:"p-8 bg-white border-t border-slate-100 flex justify-between items-center shrink-0",children:[n.jsxs("button",{onClick:()=>p(o),className:"bg-emerald-900 text-white px-8 py-4 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-xl flex items-center gap-2 active:scale-95",children:[n.jsx(yt,{size:16})," IMPRIMIR CERTIFICADO HISTÓRICO"]}),n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.4em]",children:"Permanent Audit V4.1.12"})]})]})})]})},DFe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(null),[i,l]=j.useState([]),[o,d]=j.useState(!0),[u,f]=j.useState(""),[p,x]=j.useState(null),[m,b]=j.useState(1),[v,y]=j.useState(0),k=async()=>{d(!0);try{const U=await(await fetch(`${ye}/get_vault_files.php`,{credentials:"include"})).json();U.success&&r(U.folders||[])}catch(M){console.error("Vault Sync Error",M)}finally{d(!1)}};j.useEffect(()=>{k()},[]);const _=async M=>{d(!0),s(M);try{const D=await(await fetch(`${ye}/get_vault_files.php?folder=${M}`,{credentials:"include"})).json();D.success&&l(D.files||[])}catch(U){console.error("Folder Fetch Error",U)}finally{d(!1)}},C=j.useMemo(()=>{if(!u)return i;const M=u.toLowerCase();return i.filter(U=>U.name.toLowerCase().includes(M)||U.provider&&U.provider.toLowerCase().includes(M)||U.ref&&U.ref.toLowerCase().includes(M))},[i,u]),E=()=>{s(null),l([]),f("")},T=()=>{b(1),y(0)},B=()=>{if(!a)return;const M=window.open("","","width=900,height=900");if(!M)return;const U=C.map(D=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.name}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.provider||"S/I"}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.ref||"S/R"}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.id||"?"}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${D.amount||"0.00"}</td>
            </tr>
        `).join("");M.document.write(`
            <html>
            <head>
                <title>Listado de Facturas - ${a}</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #4f46e5; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #3730a3; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #3730a3; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>EXPEDIENTE DIGITAL - LISTADO DE FACTURAS</h1>
                    <p>Periodo: ${a.replace("_"," / ")}</p>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Archivo</th>
                            <th>Proveedor</th>
                            <th>Referencia</th>
                            <th>ID Sistema</th>
                            <th>Monto USD</th>
                        </tr>
                    </thead>
                    <tbody>${U}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V1.0</div>
            </body>
            </html>
        `),M.document.close(),M.print()},I=()=>{if(!a)return;const M=C.map(Q=>`
            <tr>
                <td>${Q.name}</td>
                <td>${Q.provider||"S/I"}</td>
                <td>${Q.ref||"S/R"}</td>
                <td>${Q.id||"?"}</td>
                <td>$${Q.amount||"0.00"}</td>
                <td>${Q.size}</td>
            </tr>
        `).join(""),U=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Expediente Digital - ${a}</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #3730a3; border-bottom: 2px solid #4f46e5; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Listado de Facturas Digitalizadas</h1>
                <p>Periodo: ${a.replace("_"," / ")}</p>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Archivo</th>
                            <th>Proveedor</th>
                            <th>Referencia</th>
                            <th>ID Sistema</th>
                            <th>Monto USD</th>
                            <th>Tamaño</th>
                        </tr>
                    </thead>
                    <tbody>${M}</tbody>
                </table>
            </body>
            </html>
        `,D=new Blob([U],{type:"text/html"}),L=URL.createObjectURL(D),R=document.createElement("a");R.href=L,R.download=`Expediente_${a}.html`,R.click(),URL.revokeObjectURL(L)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Rm,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Expediente Digital v1.0"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Archivo de ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Comprobantes"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Kernel V4.0.81: Transparencia total. Visualización de facturas digitalizadas de proveedores."'})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px] text-slate-900",children:[n.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-3xl flex items-center justify-center mb-6 shadow-inner",children:n.jsx(gr,{size:40})}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Estatus del Repositorio"}),n.jsx("h4",{className:"text-3xl font-black tracking-tighter text-indigo-600",children:a?a.replace("_"," / "):`${t.length} Periodos`}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:k,className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2",children:[n.jsx(ot,{size:14,className:o?"animate-spin":""})," Sincronizar Archivo"]})]})]}),n.jsx(Rm,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),a?n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-500",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("button",{onClick:E,className:"flex items-center gap-3 px-6 py-3.5 bg-slate-100 text-slate-600 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all",children:[n.jsx(fs,{size:16})," Volver al Archivo"]}),n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por Proveedor, Ref o ID...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-indigo-600",value:u,onChange:M=>f(M.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:B,className:"flex items-center gap-3 px-6 py-3.5 bg-slate-800 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-900 transition-all",children:[n.jsx(yt,{size:16})," Imprimir Lista"]}),n.jsxs("button",{onClick:I,className:"flex items-center gap-3 px-6 py-3.5 bg-blue-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-blue-700 transition-all",children:[n.jsx(Jd,{size:16})," HTML"]})]})]}),o?n.jsx("div",{className:"py-20 text-center",children:n.jsx(ot,{className:"animate-spin text-indigo-500 mx-auto",size:40})}):C.length===0?n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx(Cr,{size:48,className:"mx-auto mb-4 text-slate-200"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"No se encontraron archivos indexados."}),n.jsx("p",{className:"text-[10px] text-slate-300 mt-2 uppercase",children:"Asegúrese de subir archivos .JPG o .PNG a la carpeta."})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:C.map((M,U)=>n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden group hover:border-indigo-500 transition-all",children:[n.jsxs("div",{className:"aspect-[4/3] bg-slate-100 relative overflow-hidden flex items-center justify-center",children:[n.jsx("img",{src:M.path,alt:M.name,className:"w-full h-full object-cover opacity-60 group-hover:opacity-100 group-hover:scale-110 transition-all duration-700 cursor-zoom-in",onClick:()=>{x(M),T()}}),n.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-6 pointer-events-none",children:n.jsxs("div",{className:"text-white",children:[n.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest text-blue-400",children:["Ref: ",M.ref||"S/R"]}),n.jsx("p",{className:"font-black uppercase truncate",children:M.provider||"S/I"})]})})]}),n.jsxs("div",{className:"p-6 space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-tighter truncate max-w-[120px]",children:M.name}),n.jsxs("p",{className:"text-[10px] font-bold text-indigo-600 mt-1 uppercase",children:["ID SISTEMA: ",M.id||"?"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{x(M),T()},className:"p-2 bg-slate-50 hover:bg-indigo-600 hover:text-white rounded-lg transition-all text-slate-400",children:n.jsx(_c,{size:16})}),n.jsx("a",{href:M.path,download:!0,className:"p-2 bg-slate-50 hover:bg-emerald-600 hover:text-white rounded-lg transition-all text-slate-400",children:n.jsx(Yi,{size:16})})]})]}),n.jsxs("div",{className:"pt-4 border-t border-slate-50 flex justify-between items-center",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-300 uppercase tracking-widest",children:M.size}),n.jsxs("span",{className:"text-sm font-black text-slate-900",children:["$",M.amount||"0.00"]})]})]})]},U))})]}):n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-6",children:o?Array(6).fill(0).map((M,U)=>n.jsx("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 animate-pulse h-48"},U)):t.length===0?n.jsxs("div",{className:"col-span-full py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx(q_,{size:64,className:"mx-auto mb-6 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"No hay carpetas de facturación configuradas."}),n.jsx("p",{className:"text-[10px] text-slate-300 mt-2",children:"Cree directorios tipo MM_YYYY dentro de /facturas/ en su servidor."})]}):t.map(M=>n.jsxs("button",{onClick:()=>_(M),className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm hover:border-indigo-500 hover:shadow-xl hover:-translate-y-2 transition-all flex flex-col items-center group text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-50 text-slate-400 group-hover:bg-indigo-600 group-hover:text-white rounded-3xl flex items-center justify-center mb-6 transition-all shadow-inner",children:n.jsx(q_,{size:32})}),n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] mb-1",children:"Periodo"}),n.jsx("span",{className:"font-black text-slate-900 uppercase tracking-tighter text-lg",children:M.replace("_"," / ")})]},M))}),p&&n.jsxs("div",{className:"fixed inset-0 bg-slate-900/95 backdrop-blur-xl flex items-center justify-center z-[500] p-4",children:[n.jsx("button",{onClick:()=>x(null),className:"absolute top-8 right-8 p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all z-[510]",children:n.jsx(ft,{size:32})}),n.jsxs("div",{className:"absolute top-8 left-8 flex gap-4 z-[510]",children:[n.jsxs("div",{className:"bg-white/10 backdrop-blur-md px-6 py-3 rounded-2xl border border-white/10 text-white",children:[n.jsx("p",{className:"text-[8px] font-black uppercase tracking-[0.2em] text-blue-400 mb-1",children:"Expediente Digital"}),n.jsx("h3",{className:"text-xl font-black uppercase tracking-tight",children:p.provider||"Sin Datos"}),n.jsxs("p",{className:"text-[10px] font-bold opacity-60",children:["ID Ref: ",p.ref," • ",p.name]})]}),n.jsxs("div",{className:"flex gap-2 items-center bg-white/10 backdrop-blur-md px-4 rounded-2xl border border-white/10",children:[n.jsx("button",{onClick:()=>b(M=>Math.max(.5,M-.2)),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(lq,{size:20})}),n.jsxs("span",{className:"text-xs font-black text-white w-12 text-center",children:[Math.round(m*100),"%"]}),n.jsx("button",{onClick:()=>b(M=>Math.min(3,M+.2)),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(sq,{size:20})}),n.jsx("div",{className:"w-px h-6 bg-white/10 mx-2"}),n.jsx("button",{onClick:()=>y(M=>M+90),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(lK,{size:20})})]})]}),n.jsx("div",{className:"w-full h-full flex items-center justify-center overflow-hidden cursor-move p-20",children:n.jsx("img",{src:p.path,alt:"Preview",style:{transform:`scale(${m}) rotate(${v}deg)`,transition:"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},className:"max-w-[90vw] max-h-[90vh] object-contain shadow-2xl rounded-sm"})}),n.jsx("div",{className:"absolute bottom-8 left-1/2 -translate-x-1/2 flex gap-4 z-[510]",children:n.jsxs("button",{onClick:()=>window.print(),className:"bg-white text-slate-900 px-8 py-4 rounded-2xl font-black text-xs uppercase tracking-widest flex items-center gap-3 shadow-2xl active:scale-95",children:[n.jsx(yt,{size:18})," Imprimir Comprobante"]})})]})]})},UFe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState("banco"),[o,d]=j.useState(""),[u,f]=j.useState({month:new Date().getMonth(),year:new Date().getFullYear()}),p=async()=>{s(!0);try{const v=await(await fetch(`${ye}/get_recaudacion_detallada.php`,{credentials:"include"})).json();v.success&&r(v.data||[])}catch(b){console.error("Fetch Recaudacion Error",b)}finally{s(!1)}};j.useEffect(()=>{p()},[]);const x=j.useMemo(()=>t.filter(b=>{const v=b.metodo.toLowerCase().includes("efectivo")||b.metodo.toLowerCase().includes("divisa"),y=i==="efectivo"?v:!v,k=o.toLowerCase(),_=!o||b.prop_code.toLowerCase().includes(k)||b.owner_name.toLowerCase().includes(k)||b.referencia.toLowerCase().includes(k),[C,E]=b.fecha.split("-").map(Number),T=C===u.year&&E-1===u.month;return y&&_&&T}),[t,i,o,u]),m=j.useMemo(()=>{const b=t.filter(k=>{const[_,C]=k.fecha.split("-").map(Number);return _===u.year&&C-1===u.month}),v=b.filter(k=>!(k.metodo.toLowerCase().includes("efectivo")||k.metodo.toLowerCase().includes("divisa"))),y=b.filter(k=>k.metodo.toLowerCase().includes("efectivo")||k.metodo.toLowerCase().includes("divisa"));return{total_banco:v.reduce((k,_)=>k+Number(_.monto_usd),0),total_efectivo:y.reduce((k,_)=>k+Number(_.monto_usd),0),count_banco:v.length,count_efectivo:y.length}},[t,u]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(xr,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Auditoría de Recaudación Digital"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Monitor de ",n.jsx("br",{}),n.jsx("span",{className:"text-indigo-500 italic",children:"Vouchers"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Visualización detallada de todos los abonos certificados por la administración."'})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl flex flex-col items-center text-slate-900 min-w-[200px]",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Recaudado Banco"}),n.jsxs("h4",{className:"text-3xl font-black text-blue-600 tracking-tighter",children:["$ ",m.total_banco.toFixed(2)]}),n.jsxs("span",{className:"text-[9px] font-bold text-slate-300 mt-2",children:[m.count_banco," Ops"]})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl flex flex-col items-center text-slate-900 min-w-[200px]",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Recaudado Cash"}),n.jsxs("h4",{className:"text-3xl font-black text-emerald-600 tracking-tighter",children:["$ ",m.total_efectivo.toFixed(2)]}),n.jsxs("span",{className:"text-[9px] font-bold text-slate-300 mt-2",children:[m.count_efectivo," Ops"]})]})]})]}),n.jsx(ha,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex p-1.5 bg-slate-100 rounded-3xl w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>l("banco"),className:`flex-1 lg:flex-none px-8 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all ${i==="banco"?"bg-white text-blue-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Depósitos / Transf"}),n.jsx("button",{onClick:()=>l("efectivo"),className:`flex-1 lg:flex-none px-8 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all ${i==="efectivo"?"bg-white text-emerald-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Caja Física (USD)"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-4 w-full lg:w-auto justify-center",children:[n.jsxs("div",{className:"flex gap-2 bg-slate-50 p-2 rounded-2xl border",children:[n.jsx("select",{className:"bg-transparent border-none text-[10px] font-black uppercase text-slate-500 outline-none px-4",value:u.month,onChange:b=>f({...u,month:parseInt(b.target.value)}),children:Ue.map((b,v)=>n.jsx("option",{value:v,children:b},v))}),n.jsx("input",{type:"number",className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-16 text-center",value:u.year,onChange:b=>f({...u,year:parseInt(b.target.value)})})]}),n.jsxs("div",{className:"relative flex-1 lg:w-64",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{type:"text",placeholder:"Buscar voucher...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-3 text-xs font-bold focus:ring-2 focus:ring-indigo-600 outline-none",value:o,onChange:b=>d(b.target.value)})]}),n.jsx("button",{onClick:p,className:"p-3.5 bg-slate-50 rounded-2xl text-slate-400 hover:text-indigo-600 transition-all border border-slate-200",children:n.jsx(ot,{size:20,className:a?"animate-spin":""})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Operación"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad / Inmueble"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Propietario / Titular"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia / Seriales"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto $"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Método"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-32 text-center",children:n.jsx(ot,{className:"animate-spin text-blue-600 mx-auto",size:40})})}):x.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:6,className:"py-32 text-center",children:[n.jsx(Ba,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-300 font-black uppercase tracking-widest text-xs italic",children:"No hay rastro contable para este periodo o criterio"})]})}):x.map((b,v)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-400 text-xs",children:b.fecha})}),n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg uppercase",children:b.prop_code})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-700 text-xs uppercase truncate max-w-[180px]",children:b.owner_name}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:["Vía: ",b.is_historical?"Abono Histórico":"Cuota Mes"]})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"px-4 py-1.5 bg-slate-100 rounded-xl text-[11px] font-mono font-black text-indigo-600 border border-slate-200",children:["#",b.referencia]})}),n.jsxs("td",{className:"px-10 py-6 text-right",children:[n.jsxs("span",{className:`text-xl font-black tracking-tighter ${i==="efectivo"?"text-emerald-600":"text-blue-600"}`,children:["$ ",Number(b.monto_usd).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 uppercase mt-0.5",children:["Bs. ",Number(b.monto_bs).toLocaleString("es-VE")]})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${i==="efectivo"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-blue-50 text-blue-600 border-blue-100"}`,children:b.metodo})})]},v))})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-white rounded-2xl shadow-sm border border-slate-200",children:n.jsx(Ea,{className:"text-emerald-500",size:24})}),n.jsxs("div",{children:[n.jsxs("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:["Protocolo de Integridad ",Ps]}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase",children:"Datos verificados contra Libro Diario y Caja Física"})]})]}),n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("button",{onClick:()=>{const b=["Fecha","Unidad","Propietario","Referencia","Monto $","Método"],v=x.map(y=>[y.fecha,y.prop_code,y.owner_name,y.referencia,`$ ${Number(y.monto_usd).toFixed(2)}`,y.metodo]);zc(`Recaudación Digital - ${Ue[u.month]} ${u.year}`,b,v)},className:"px-8 py-3 bg-indigo-600 text-white hover:bg-indigo-700 transition-all border border-indigo-500 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(gr,{size:16})," Exportar HTML"]}),n.jsxs("button",{onClick:()=>window.print(),className:"px-8 py-3 bg-white hover:bg-slate-900 hover:text-white transition-all border border-slate-200 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(yt,{size:16})," Imprimir Reporte"]})]})]})]})]})},MFe=({user:e})=>{const{exchangeRateHistory:t,refreshData:r}=ht(),[a,s]=j.useState([]),[i,l]=j.useState(!0),[o,d]=j.useState(""),[u,f]=j.useState({month:new Date().getMonth(),year:new Date().getFullYear()}),[p,x]=j.useState(null),[m,b]=j.useState(!1),v=async()=>{l(!0);try{const E=await(await fetch(`${ye}/get_bill_payments_history.php`,{credentials:"include"})).json();E.success&&s(E.data||[])}catch(C){console.error("Fetch Bill Payments Error",C)}finally{l(!1)}};j.useEffect(()=>{v()},[]);const y=j.useMemo(()=>a.filter(C=>{const E=o.toLowerCase(),T=!o||C.provider.toLowerCase().includes(E)||C.reference.toLowerCase().includes(E)||C.bill_desc.toLowerCase().includes(E),[B,I]=C.payment_date.split("-").map(Number),M=B===u.year&&I-1===u.month;return T&&M}),[a,o,u]),k=async C=>{C.preventDefault(),b(!0);try{const T=await(await fetch(`${ye}/update_bill_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)})).json();T.success?(alert("¡Pago actualizado y sincronizado en Banco y Balance!"),x(null),v(),r()):alert("Error: "+T.error)}catch{alert("Error de conexión con el Kernel.")}finally{b(!1)}},_=async C=>{if(confirm(`¿ANULAR ABONO? Esta acción eliminará el rastro en el Libro Diario de Banco y devolverá la deuda a la factura de ${C.provider}. ¿Proceder?`)){b(!0);try{const T=await(await fetch(`${ye}/delete_bill_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:C.id,bill_id:C.bill_id})})).json();T.success?(alert("¡Abono revertido con éxito!"),v(),r()):alert("Error: "+T.error)}catch{alert("Error de red al intentar anular egreso.")}finally{b(!1)}}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-rose-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-rose-600 w-fit px-5 py-2 rounded-full border border-rose-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(aa,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Auditoría Maestra de Egresos"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Historial ",n.jsx("br",{}),n.jsx("span",{className:"text-rose-500 italic",children:"de Abonos"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Visualización, corrección y anulación de pagos realizados a proveedores. Trazabilidad Kernel V4.0.91."'})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl flex flex-col items-center text-slate-900 min-w-[340px]",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Pagado en el Periodo"}),n.jsxs("h4",{className:"text-4xl font-black text-rose-600 tracking-tighter",children:["$ ",y.reduce((C,E)=>C+Number(E.amount_usd),0).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 mt-2",children:["Bs. ",y.reduce((C,E)=>C+Number(E.amount_bs),0).toLocaleString("es-VE")]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:v,className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2 active:scale-95",children:[n.jsx(ot,{size:16,className:i?"animate-spin":""})," Sincronizar Auditoría"]})]})]}),n.jsx(aa,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex gap-2 bg-slate-50 p-2 rounded-2xl border",children:[n.jsx("select",{className:"bg-transparent border-none text-[10px] font-black uppercase text-slate-500 outline-none px-4",value:u.month,onChange:C=>f({...u,month:parseInt(C.target.value)}),children:Ue.map((C,E)=>n.jsx("option",{value:E,children:C},E))}),n.jsx("input",{type:"number",className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-16 text-center",value:u.year,onChange:C=>f({...u,year:parseInt(C.target.value)})})]}),n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por proveedor o referencia...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-rose-600",value:o,onChange:C=>d(C.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const C=["Fecha","Proveedor","Concepto","Referencia","Monto USD","Monto VES"],E=y.map(T=>[T.payment_date,T.provider,T.bill_desc,T.reference,`$${Number(T.amount_usd).toFixed(2)}`,`Bs. ${Number(T.amount_bs).toLocaleString("es-VE",{minimumFractionDigits:2})}`]);zc("Auditoría de Egresos",C,E)},className:"p-4 bg-slate-100 text-slate-400 hover:text-indigo-600 rounded-2xl transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(gr,{size:20})}),n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-slate-100 text-slate-400 hover:text-indigo-600 rounded-2xl transition-all shadow-sm",children:n.jsx(yt,{size:20})})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Pago"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Proveedor / Concepto"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia / Vía"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Importe Abono"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:i?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-24 text-center",children:n.jsx(ot,{className:"animate-spin text-rose-600 mx-auto",size:40})})}):y.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"py-32 text-center",children:[n.jsx(Ba,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-300 font-black uppercase tracking-widest text-xs italic",children:"No hay rastro de abonos en este periodo"})]})}):y.map((C,E)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-400 text-xs",children:C.payment_date})}),n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-50 text-slate-400 rounded-xl flex items-center justify-center group-hover:bg-rose-50 group-hover:text-rose-600 transition-all",children:n.jsx(ub,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[13px] uppercase leading-none",children:C.provider}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase mt-1 truncate max-w-[200px]",children:C.bill_desc})]})]})}),n.jsxs("td",{className:"px-10 py-6 text-center",children:[n.jsxs("span",{className:"px-4 py-1.5 bg-slate-100 rounded-xl text-[11px] font-mono font-black text-rose-600 border border-slate-200",children:["#",C.reference]}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase mt-1",children:C.source})]}),n.jsxs("td",{className:"px-10 py-6 text-right",children:[n.jsxs("span",{className:"text-xl font-black tracking-tighter text-slate-900",children:["$ ",Number(C.amount_usd).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 uppercase mt-0.5",children:["Bs. ",Number(C.amount_bs).toLocaleString("es-VE")]})]}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>x(C),className:"p-3 bg-slate-50 text-slate-400 hover:bg-rose-600 hover:text-white rounded-xl shadow-sm transition-all",title:"Editar",children:n.jsx(vl,{size:18})}),n.jsx("button",{disabled:m,onClick:()=>_(C),className:"p-3 bg-slate-50 text-slate-400 hover:bg-red-600 hover:text-white rounded-xl shadow-sm transition-all disabled:opacity-30",title:"Eliminar / Revertir",children:m?n.jsx(ot,{size:18,className:"animate-spin"}):n.jsx(Ta,{size:18})})]})})]},E))})]})})}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 relative",children:[n.jsx("button",{onClick:()=>x(null),className:"absolute top-8 right-8 p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-white transition-all",children:n.jsx(ft,{size:24})}),n.jsxs("div",{className:"mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Editar Abono"}),n.jsxs("p",{className:"text-[10px] font-black text-rose-600 uppercase tracking-widest mt-1",children:["Proveedor: ",p.provider]})]}),n.jsxs("form",{onSubmit:k,className:"space-y-6",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 block mb-4 ml-1",children:"Importe del Pago (Bolívares)"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:p.amount_bs,onChange:C=>x({...p,amount_bs:parseFloat(C.target.value)})})]}),n.jsxs("div",{className:"mt-6 flex justify-between items-center bg-slate-800 text-white p-4 rounded-xl shadow-lg",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Ajuste USD Proyectado:"}),n.jsxs("span",{className:"text-xl font-black",children:["$",(p.amount_bs/45).toFixed(2)]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1 mb-1 block",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:p.reference,onChange:C=>x({...p,reference:C.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1 mb-1 block",children:"Fecha de Pago"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:p.payment_date,onChange:C=>x({...p,payment_date:C.target.value})})]})]}),n.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-100 rounded-2xl flex items-start gap-4",children:[n.jsx(Cr,{className:"text-amber-600 shrink-0 mt-0.5",size:18}),n.jsx("p",{className:"text-[10px] text-amber-800 font-bold uppercase leading-relaxed tracking-tight",children:"Esta edición actualizará el Libro de Banco y el balance de la factura automáticamente."})]}),n.jsxs("button",{disabled:m,type:"submit",className:"w-full bg-rose-600 hover:bg-rose-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95",children:[m?n.jsx(ot,{className:"animate-spin"}):n.jsx(qn,{size:24})," GUARDAR CAMBIOS"]})]})]})})]})},RFe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState({start:"",end:""}),[i,l]=j.useState([]),[o,d]=j.useState(!1),[u,f]=j.useState({type:null,message:""}),[p,x]=j.useState([]);Bp.useEffect(()=>{i.includes("fondo-reserva")&&we.getReserveFundHistory(a.start,a.end).then(y=>x(y.history)).catch(y=>console.error("Error fetching reserve history",y))},[i,a]);const m=[{id:"banco",label:"Libro de Banco / Movimientos",icon:xr,description:"Todos los movimientos bancarios registrados."},{id:"balance",label:"Balance General",icon:mi,description:"Estado actual de cuentas y fondos."},{id:"recaudacion",label:"Recaudación Digital",icon:Tc,description:"Detalle de cobros y pagos de propietarios."},{id:"egresos",label:"Auditoría de Egresos",icon:aa,description:"Pagos realizados a proveedores y gastos."},{id:"convenios",label:"Convenios de Pago Activos",icon:Zd,description:"Estatus de convenios vigentes."},{id:"historico-convenios",label:"Histórico de Convenios",icon:Ba,description:"Registro de convenios finalizados."},{id:"comisiones",label:"Cálculo de Comisiones",icon:ps,description:"Reporte de comisiones por gestión."},{id:"cobro-propietario",label:"Control Cobro Propietario",icon:Oi,description:"Detalle de pagos por cada propietario."},{id:"auditoria",label:"Informes y Auditoría",icon:po,description:"Resumen ejecutivo para auditoría."},{id:"fondo-reserva",label:"Fondo de Reserva (Histórico)",icon:ha,description:"Resumen de acumulación mensual del fondo."},{id:"efectivo-recibido",label:"Efectivo Recibido (Oficina)",icon:wn,description:"Control de ingresos en efectivo."},{id:"efectivo-pagado",label:"Efectivo Pagado (Proveedores)",icon:wn,description:"Control de egresos en efectivo."}],b=y=>{l(k=>k.includes(y)?k.filter(_=>_!==y):[...k,y])},v=async()=>{if(i.length===0){f({type:"error",message:"Seleccione al menos un reporte para generar."});return}r(!0),f({type:null,message:""});try{const y=pi.book_new();for(const k of i){let _=[],C="";switch(k){case"banco":_=(await we.getBankTransactions()).map(z=>({Fecha:z.date,Descripción:z.description,Tipo:z.type,Categoría:z.category,Referencia:z.reference||"","Monto ($)":z.amount,"Monto (Bs)":z.amountBs||0})),C="Banco";break;case"balance":const T=await we.getFinancialTotals();_=[{Concepto:"Saldo Caja (Bs)",Valor:T.cashBalanceBs},{Concepto:"Cuentas por Pagar (USD)",Valor:T.accountsPayableUsd},{Concepto:"Cuentas por Cobrar (USD)",Valor:T.receivablesUsd},{Concepto:"Total Facturado (USD)",Valor:T.totalBilledUsd},{Concepto:"Total Recaudado (USD)",Valor:T.totalCollectedUsd},{Concepto:"Fondo de Reserva (USD)",Valor:T.reserveFundUsd},{Concepto:"Fondo de Reserva (Bs)",Valor:T.reserveFundBs},{Concepto:"Fondo en Divisa (USD)",Valor:T.initialCashUsd||0}],C="Balance General";break;case"recaudacion":_=(await we.getFees()).flatMap(z=>z.debts.flatMap(Z=>Z.payments.map(Y=>({Mes:`${z.month}/${z.year}`,Propiedad:Z.propertyId,Fecha:Y.date,Referencia:Y.reference,Método:Y.method,"Monto ($)":Y.amount,Turno:Y.slot||""})))),C="Recaudación";break;case"egresos":_=(await we.getPendingBills()).map(z=>({Fecha:z.creationDate,Proveedor:z.provider,Descripción:z.description,"Monto ($)":z.amount,"Monto (Bs)":z.amountBs,Estatus:z.status,"Fecha Pago":z.paidDate||"","Fuente Pago":z.paymentSource||"",Referencia:z.paymentReference||""})),C="Auditoría Egresos";break;case"convenios":_=(await we.getInitialDebtData()).map(z=>({Propiedad:z.code,Propietario:z.ownerName,"Deuda Original ($)":z.original_debt,"Total Pagado ($)":z.total_paid,"Deuda Pendiente ($)":z.current_debt,"Cant. Pagos":z.history?z.history.length:0})),C="Convenios Activos";break;case"historico-convenios":_=(await we.getArchivedAgreements()).map(z=>({Propiedad:z.code,Propietario:z.owner_name,"Monto Original ($)":z.original_amount,"Fecha Finalización":z.completion_date,Estatus:"Finalizado"})),C="Histórico Convenios";break;case"efectivo-recibido":_=(await we.getFees()).flatMap(z=>z.debts.flatMap(Z=>Z.payments.filter(Y=>Y.method.toLowerCase().includes("efectivo")).map(Y=>({Fecha:Y.date,Propiedad:Z.propertyId,Referencia:Y.reference,"Monto ($)":Y.amount,Concepto:`Pago Cuota ${z.month}/${z.year}`})))),C="Efectivo Recibido";break;case"efectivo-pagado":_=(await we.getPendingBills()).filter(z=>z.paymentSource==="Efectivo").map(z=>({Fecha:z.paidDate||z.creationDate,Proveedor:z.provider,Descripción:z.description,"Monto ($)":z.amount,Referencia:z.paymentReference||""})),C="Efectivo Pagado";break;case"comisiones":_=(await we.getBankTransactions()).filter(z=>z.category==="Comisiones"&&z.type==="Egreso").map(z=>({Fecha:z.date,Descripción:z.description,Referencia:z.reference||"","Monto ($)":z.amount,"Monto (Bs)":z.amountBs||0})),C="Comisiones";break;case"cobro-propietario":const Q=await we.getProperties();_=(await we.getFees()).flatMap(z=>z.debts.flatMap(Z=>{const Y=Q.find(te=>te.id===Z.propertyId);return Z.payments.map(te=>({Mes:`${z.month}/${z.year}`,Propiedad:Y?Y.code:Z.propertyId,Propietario:Y?Y.number:"",Fecha:te.date,Referencia:te.reference,Método:te.method,"Monto ($)":te.amount}))})),C="Cobro Propietario";break;case"auditoria":_=(await we.getAuditLogs()).logs.map(z=>({Fecha:z.created_at,Usuario:z.username,Rol:z.user_role,Acción:z.action,Módulo:z.module,IP:z.ip_address})),C="Auditoría Sistema";break;case"fondo-reserva":_=(await we.getReserveFundHistory(a.start,a.end)).history.map(z=>({Periodo:z.period,"Aporte Mensual (Bs)":z.monthly_bs,"Aporte Mensual ($)":z.monthly_usd,"Acumulado (Bs)":z.accumulated_bs,"Acumulado ($)":z.accumulated_usd})),C="Fondo de Reserva";break}if(_.length>0){a.start&&a.end&&(_=_.filter(T=>{const B=T.Fecha||T["Fecha Pago"]||T["Fecha Inicio"];return B?B>=a.start&&B<=a.end:!0}));const E=pi.json_to_sheet(_);pi.book_append_sheet(y,E,C)}}if(y.SheetNames.length===0)f({type:"error",message:"No se encontraron datos para los criterios seleccionados."});else if(o){for(const k of y.SheetNames){const _=y.Sheets[k],C=pi.sheet_to_csv(_),E=new Blob([C],{type:"text/csv;charset=utf-8;"}),T=URL.createObjectURL(E),B=document.createElement("a");B.href=T,B.setAttribute("download",`Reporte_${k.replace(/\s+/g,"_")}_${new Date().toISOString().split("T")[0]}.csv`),document.body.appendChild(B),B.click(),document.body.removeChild(B)}f({type:"success",message:"Archivos CSV generados exitosamente."})}else ME(y,`Reporte_SAC_2026_${new Date().toISOString().split("T")[0]}.xlsx`),f({type:"success",message:"Reporte generado exitosamente."})}catch(y){console.error("Excel Generation Error",y),f({type:"error",message:`Error al generar Excel: ${y.message}`})}finally{r(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter flex items-center gap-3",children:[n.jsx(gl,{className:"text-blue-600",size:40}),"Informes en ",n.jsx("span",{className:"text-blue-600 italic",children:"Excel"})]}),n.jsx("p",{className:"text-slate-500 font-medium mt-1",children:"Generación de reportes detallados para auditoría y gestión."})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-2 rounded-2xl shadow-sm border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Lr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.start,onChange:y=>s(k=>({...k,start:y.target.value}))})]}),n.jsx("span",{className:"text-slate-300 font-bold",children:"al"}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Lr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.end,onChange:y=>s(k=>({...k,end:y.target.value}))})]})]})]}),u.type&&n.jsxs("div",{className:`p-4 rounded-2xl flex items-center gap-3 animate-in slide-in-from-top duration-300 ${u.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100"}`,children:[u.type==="success"?n.jsx(zt,{size:20}):n.jsx(Cr,{size:20}),n.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:u.message})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map(y=>{const k=i.includes(y.id),_=y.icon;return n.jsxs("button",{onClick:()=>b(y.id),className:`flex flex-col p-6 rounded-[2.5rem] border-2 transition-all text-left relative overflow-hidden group ${k?"bg-blue-600 border-blue-600 shadow-xl shadow-blue-200":"bg-white border-slate-100 hover:border-blue-200 hover:shadow-lg"}`,children:[n.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center mb-4 transition-colors ${k?"bg-white/20 text-white":"bg-blue-50 text-blue-600"}`,children:n.jsx(_,{size:24})}),n.jsx("h3",{className:`font-black text-sm uppercase tracking-widest mb-2 ${k?"text-white":"text-slate-900"}`,children:y.label}),n.jsx("p",{className:`text-[10px] font-medium leading-relaxed ${k?"text-blue-100":"text-slate-500"}`,children:y.description}),k&&n.jsx("div",{className:"absolute top-4 right-4",children:n.jsx(zt,{className:"text-white",size:20})}),n.jsx("div",{className:`absolute -right-4 -bottom-4 opacity-10 transition-transform group-hover:scale-110 ${k?"text-white":"text-blue-600"}`,children:n.jsx(_,{size:80})})]},y.id)})}),i.includes("fondo-reserva")&&n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-100 shadow-xl animate-in zoom-in duration-500",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tighter uppercase",children:"Crecimiento del Fondo de Reserva"}),n.jsx("p",{className:"text-slate-500 text-xs font-bold uppercase tracking-widest mt-1",children:"Proyección y Acumulación Histórica (Bs)"})]}),n.jsx("div",{className:"bg-blue-50 text-blue-600 px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest border border-blue-100",children:"Vista Previa del Reporte"})]}),n.jsx("div",{className:"h-[300px] w-full",children:n.jsx(jk,{width:"100%",height:"100%",children:n.jsxs(Qj,{data:p,children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"colorAcc",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.3}),n.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]})}),n.jsx(Xb,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(Jb,{dataKey:"period",hide:!0}),n.jsx(Zb,{hide:!0}),n.jsx(Bj,{contentStyle:{borderRadius:"1rem",border:"none",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1)",fontSize:"10px",fontWeight:"bold"}}),n.jsx(FA,{type:"monotone",dataKey:"accumulated_bs",stroke:"#2563eb",strokeWidth:4,fillOpacity:1,fill:"url(#colorAcc)"})]})})}),n.jsxs("div",{className:"mt-6 p-4 bg-slate-50 rounded-2xl border border-slate-100 flex items-center gap-3",children:[n.jsx(Cr,{size:16,className:"text-blue-600"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"La gráfica anterior es una representación visual. El archivo Excel contendrá la tabla de datos completa para su análisis detallado."})]})]}),n.jsxs("div",{className:"flex flex-col items-center gap-6 pt-8",children:[n.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group bg-white px-6 py-3 rounded-2xl border border-slate-100 shadow-sm hover:border-blue-200 transition-all",children:[n.jsx("div",{className:`w-5 h-5 rounded-lg border-2 flex items-center justify-center transition-all ${o?"bg-blue-600 border-blue-600":"bg-slate-50 border-slate-200 group-hover:border-blue-400"}`,children:o&&n.jsx(zt,{size:12,className:"text-white"})}),n.jsx("input",{type:"checkbox",className:"hidden",checked:o,onChange:y=>d(y.target.checked)}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-500 group-hover:text-blue-600 transition-colors",children:"Exportar como archivos CSV"})]}),n.jsx("button",{onClick:v,disabled:t||i.length===0,className:"bg-slate-900 hover:bg-slate-800 text-white px-12 py-5 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl shadow-slate-200 transition-all active:scale-95 flex items-center gap-4 disabled:opacity-50 disabled:cursor-not-allowed",children:t?n.jsxs(n.Fragment,{children:[n.jsx(Vi,{className:"animate-spin",size:20}),"Procesando Datos..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Yi,{size:20}),o?"Generar Reportes CSV":"Generar Reporte Excel"]})})]}),n.jsx("div",{className:"bg-blue-50 border border-blue-100 p-8 rounded-[3rem] mt-12",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-600 text-white rounded-xl flex items-center justify-center shrink-0",children:n.jsx(ko,{size:20})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-blue-900 font-black text-sm uppercase tracking-widest mb-2",children:"Nota de Auditoría"}),n.jsx("p",{className:"text-blue-700 text-xs font-medium leading-relaxed",children:"Los archivos generados contienen la data oficial asentada en el sistema hasta el momento de la descarga. Puede seleccionar múltiples reportes para generar un único archivo Excel con varias hojas de cálculo, facilitando la visualización integral de la gestión del condominio."})]})]})})]})},OFe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState("receivable"),[i,l]=j.useState(new Date().getMonth()+1),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState(!1),[p,x]=j.useState({type:null,message:""}),m=[{value:1,label:"Enero"},{value:2,label:"Febrero"},{value:3,label:"Marzo"},{value:4,label:"Abril"},{value:5,label:"Mayo"},{value:6,label:"Junio"},{value:7,label:"Julio"},{value:8,label:"Agosto"},{value:9,label:"Septiembre"},{value:10,label:"Octubre"},{value:11,label:"Noviembre"},{value:12,label:"Diciembre"}],b=Array.from({length:5},(y,k)=>new Date().getFullYear()-k),v=async()=>{r(!0),x({type:null,message:""});try{const y=await we.getDetailedExcelReport(i,o,a);if(y.length===0){x({type:"error",message:"No se encontraron registros para el periodo seleccionado."}),r(!1);return}const k=pi.book_new(),_=pi.json_to_sheet(y),C=a==="receivable"?"Cuentas por Cobrar":"Cuentas por Pagar";pi.book_append_sheet(k,_,C);const E=`Reporte_Detallado_${C.replace(/\s+/g,"_")}_${i}_${o}`;if(u){const T=pi.sheet_to_csv(_),B=new Blob([T],{type:"text/csv;charset=utf-8;"}),I=URL.createObjectURL(B),M=document.createElement("a");M.href=I,M.setAttribute("download",`${E}.csv`),document.body.appendChild(M),M.click(),document.body.removeChild(M),x({type:"success",message:"Archivo CSV generado exitosamente."})}else ME(k,`${E}.xlsx`),x({type:"success",message:"Reporte Excel generado exitosamente."})}catch(y){console.error("Detailed Report Error",y),x({type:"error",message:`Error al generar reporte: ${y.message}`})}finally{r(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsx("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter flex items-center gap-3",children:[n.jsx(gl,{className:"text-indigo-600",size:40}),"Informes ",n.jsx("span",{className:"text-indigo-600 italic",children:"Detallados"})," Excel"]}),n.jsx("p",{className:"text-slate-500 font-medium mt-1",children:"Detalle completo de transacciones, liquidaciones y estatus por periodo."})]})}),p.type&&n.jsxs("div",{className:`p-4 rounded-2xl flex items-center gap-3 animate-in slide-in-from-top duration-300 ${p.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100"}`,children:[p.type==="success"?n.jsx(zt,{size:20}):n.jsx(Cr,{size:20}),n.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:p.message})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsx("div",{className:"lg:col-span-1 space-y-6",children:n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-100 shadow-xl",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-900 uppercase tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(nk,{size:16,className:"text-indigo-600"}),"Parámetros del Reporte"]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Tipo de Información"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsxs("button",{onClick:()=>s("receivable"),className:`px-4 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${a==="receivable"?"bg-indigo-600 text-white shadow-lg shadow-indigo-200":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(xr,{size:14}),"CxC (Ingresos)"]}),n.jsxs("button",{onClick:()=>s("payable"),className:`px-4 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${a==="payable"?"bg-indigo-600 text-white shadow-lg shadow-indigo-200":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(aa,{size:14}),"CxP (Egresos)"]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Mes"}),n.jsx("select",{value:i,onChange:y=>l(parseInt(y.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:m.map(y=>n.jsx("option",{value:y.value,children:y.label},y.value))})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Año"}),n.jsx("select",{value:o,onChange:y=>d(parseInt(y.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:b.map(y=>n.jsx("option",{value:y,children:y},y))})]})]}),n.jsx("div",{className:"pt-4 border-t border-slate-100",children:n.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[n.jsx("div",{className:`w-5 h-5 rounded-lg border-2 flex items-center justify-center transition-all ${u?"bg-indigo-600 border-indigo-600":"bg-slate-50 border-slate-200 group-hover:border-indigo-400"}`,children:u&&n.jsx(zt,{size:12,className:"text-white"})}),n.jsx("input",{type:"checkbox",className:"hidden",checked:u,onChange:y=>f(y.target.checked)}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-500 group-hover:text-indigo-600 transition-colors",children:"Exportar como CSV"})]})}),n.jsxs("button",{onClick:v,disabled:t,className:"w-full bg-slate-900 hover:bg-slate-800 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[t?n.jsx(Vi,{className:"animate-spin",size:16}):n.jsx(Yi,{size:16}),t?"Procesando...":"Generar Informe"]})]})]})}),n.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[n.jsxs("div",{className:"bg-indigo-600 p-10 rounded-[3rem] text-white relative overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("h2",{className:"text-3xl font-black tracking-tighter leading-tight mb-4",children:["Reporte de ",n.jsx("br",{}),n.jsx("span",{className:"text-indigo-200 italic",children:"Trazabilidad Total"})]}),n.jsx("p",{className:"text-indigo-100 font-medium text-sm leading-relaxed max-w-md",children:"Este informe extrae cada registro de pago asociado a las deudas o facturas del periodo seleccionado, permitiendo ver la conciliación exacta entre lo facturado y lo liquidado."}),n.jsxs("div",{className:"mt-8 grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-white/10 backdrop-blur-md border border-white/20 p-4 rounded-2xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-indigo-200 mb-1",children:"Detalle Incluido"}),n.jsx("p",{className:"text-xs font-bold",children:"Referencias, Tasas, Fechas y Métodos de Pago."})]}),n.jsxs("div",{className:"bg-white/10 backdrop-blur-md border border-white/20 p-4 rounded-2xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-indigo-200 mb-1",children:"Compatibilidad"}),n.jsx("p",{className:"text-xs font-bold",children:"Formato Excel (XLSX) y CSV para sistemas contables."})]})]})]}),n.jsx(Xt,{size:200,className:"absolute right-[-40px] top-[-40px] text-white/10 pointer-events-none"})]}),n.jsx("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-100 shadow-sm",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-amber-50 text-amber-600 rounded-xl flex items-center justify-center shrink-0",children:n.jsx(Cr,{size:24})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-slate-900 font-black text-sm uppercase tracking-widest mb-2",children:"Instrucciones de Uso"}),n.jsxs("ul",{className:"text-slate-500 text-xs font-medium space-y-2 list-disc ml-4",children:[n.jsxs("li",{children:["Seleccione el tipo de reporte: ",n.jsx("b",{children:"CxC"})," para ingresos de propietarios o ",n.jsx("b",{children:"CxP"})," para egresos a proveedores."]}),n.jsx("li",{children:"Elija el mes y año que desea auditar."}),n.jsx("li",{children:"El sistema buscará todas las liquidaciones (pagos) registradas en ese periodo específico."}),n.jsxs("li",{children:["Si una deuda no tiene pagos, aparecerá como ",n.jsx("b",{children:"PENDIENTE"})," con sus montos originales."]})]})]})]})})]})]})]})},PFe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState({start:"",end:""}),[i,l]=j.useState(null),[o,d]=j.useState(null),[u,f]=j.useState({type:null,message:""}),p=[{id:"banco",label:"Libro de Banco / Movimientos",icon:xr,description:"Todos los movimientos bancarios registrados."},{id:"balance",label:"Balance General",icon:mi,description:"Estado actual de cuentas y fondos."},{id:"recaudacion",label:"Recaudación Digital",icon:Tc,description:"Detalle de cobros y pagos de propietarios."},{id:"egresos",label:"Auditoría de Egresos",icon:aa,description:"Pagos realizados a proveedores y gastos."},{id:"convenios",label:"Convenios de Pago Activos",icon:Zd,description:"Estatus de convenios vigentes."},{id:"historico-convenios",label:"Histórico de Convenios",icon:Ba,description:"Registro de convenios finalizados."},{id:"comisiones",label:"Cálculo de Comisiones",icon:ps,description:"Reporte de comisiones por gestión."},{id:"cobro-propietario",label:"Control Cobro Propietario",icon:Oi,description:"Detalle de pagos por cada propietario."},{id:"auditoria",label:"Informes y Auditoría",icon:po,description:"Resumen ejecutivo para auditoría."},{id:"fondo-reserva",label:"Fondo de Reserva (Histórico)",icon:ha,description:"Resumen de acumulación mensual del fondo."},{id:"efectivo-recibido",label:"Efectivo Recibido (Oficina)",icon:wn,description:"Control de ingresos en efectivo."},{id:"efectivo-pagado",label:"Efectivo Pagado (Proveedores)",icon:wn,description:"Control de egresos en efectivo."}],x=async b=>{r(!0),f({type:null,message:""}),l(b);try{let v=[],y="",k=[];switch(b){case"banco":const _=await we.getBankTransactions();y="Libro de Banco / Movimientos",k=["Fecha","Descripción","Tipo","Categoría","Referencia","Monto ($)","Monto (Bs)"],v=_.map(K=>[K.date,K.description,K.type,K.category,K.reference||"",K.amount,K.amountBs||0]);break;case"balance":const C=await we.getFinancialTotals();y="Balance General",k=["Concepto","Valor"],v=[["Saldo Caja (Bs)",C.cashBalanceBs],["Cuentas por Pagar (USD)",C.accountsPayableUsd],["Cuentas por Cobrar (USD)",C.receivablesUsd],["Total Facturado (USD)",C.totalBilledUsd],["Total Recaudado (USD)",C.totalCollectedUsd],["Fondo de Reserva (USD)",C.reserveFundUsd],["Fondo de Reserva (Bs)",C.reserveFundBs],["Fondo en Divisa (USD)",C.initialCashUsd||0]];break;case"recaudacion":const E=await we.getFees();y="Recaudación Digital",k=["Mes","Propiedad","Fecha","Referencia","Método","Monto ($)","Turno"],v=E.flatMap(K=>K.debts.flatMap(W=>W.payments.map(z=>[`${K.month}/${K.year}`,W.propertyId,z.date,z.reference,z.method,z.amount,z.slot||""])));break;case"egresos":const T=await we.getPendingBills();y="Auditoría de Egresos",k=["Fecha","Proveedor","Descripción","Monto ($)","Monto (Bs)","Estatus","Fecha Pago","Fuente Pago","Referencia"],v=T.map(K=>[K.creationDate,K.provider,K.description,K.amount,K.amountBs,K.status,K.paidDate||"",K.paymentSource||"",K.paymentReference||""]);break;case"convenios":const B=await we.getInitialDebtData();y="Convenios de Pago Activos",k=["Propiedad","Propietario","Deuda Original ($)","Total Pagado ($)","Deuda Pendiente ($)","Cant. Pagos"],v=B.map(K=>[K.code,K.ownerName,K.original_debt,K.total_paid,K.current_debt,K.history?K.history.length:0]);break;case"historico-convenios":const I=await we.getArchivedAgreements();y="Histórico de Convenios",k=["Propiedad","Propietario","Monto Original ($)","Fecha Finalización","Estatus"],v=I.map(K=>[K.code,K.owner_name,K.original_amount,K.completion_date,"Finalizado"]);break;case"efectivo-recibido":const M=await we.getFees();y="Efectivo Recibido (Oficina)",k=["Fecha","Propiedad","Referencia","Monto ($)","Concepto"],v=M.flatMap(K=>K.debts.flatMap(W=>W.payments.filter(z=>z.method.toLowerCase().includes("efectivo")).map(z=>[z.date,W.propertyId,z.reference,z.amount,`Pago Cuota ${K.month}/${K.year}`])));break;case"efectivo-pagado":const U=await we.getPendingBills();y="Efectivo Pagado (Proveedores)",k=["Fecha","Proveedor","Descripción","Monto ($)","Referencia"],v=U.filter(K=>K.paymentSource==="Efectivo").map(K=>[K.paidDate||K.creationDate,K.provider,K.description,K.amount,K.paymentReference||""]);break;case"comisiones":const D=await we.getBankTransactions();y="Cálculo de Comisiones",k=["Fecha","Descripción","Referencia","Monto ($)","Monto (Bs)"],v=D.filter(K=>K.category==="Comisiones"&&K.type==="Egreso").map(K=>[K.date,K.description,K.reference||"",K.amount,K.amountBs||0]);break;case"cobro-propietario":const L=await we.getProperties(),R=await we.getFees();y="Control Cobro Propietario",k=["Mes","Propiedad","Propietario","Fecha","Referencia","Método","Monto ($)"],v=R.flatMap(K=>K.debts.flatMap(W=>{const z=L.find(Z=>Z.id===W.propertyId);return W.payments.map(Z=>[`${K.month}/${K.year}`,z?z.code:W.propertyId,z?z.number:"",Z.date,Z.reference,Z.method,Z.amount])}));break;case"auditoria":const Q=await we.getAuditLogs();y="Informes y Auditoría",k=["Fecha","Usuario","Rol","Acción","Módulo","IP"],v=Q.logs.map(K=>[K.created_at,K.username,K.user_role,K.action,K.module,K.ip_address]);break;case"fondo-reserva":const G=await we.getReserveFundHistory(a.start,a.end);y="Fondo de Reserva (Histórico)",k=["Periodo","Aporte Mensual (Bs)","Aporte Mensual ($)","Acumulado (Bs)","Acumulado ($)"],v=G.history.map(K=>[K.period,K.monthly_bs,K.monthly_usd,K.accumulated_bs,K.accumulated_usd]);break}a.start&&a.end&&(v=v.filter(_=>{const C=_[0];return typeof C=="string"&&C.match(/^\d{4}-\d{2}-\d{2}/)?C>=a.start&&C<=a.end:!0})),v.length===0?f({type:"error",message:"No se encontraron datos para los criterios seleccionados."}):d({title:y,headers:k,rows:v})}catch(v){console.error("HTML Report Generation Error",v),f({type:"error",message:`Error al generar reporte: ${v.message}`})}finally{r(!1)}},m=()=>{window.print()};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter flex items-center gap-3",children:[n.jsx(gr,{className:"text-indigo-600",size:40}),"Informes en ",n.jsx("span",{className:"text-indigo-600 italic",children:"HTML"})]}),n.jsx("p",{className:"text-slate-500 font-medium mt-1",children:"Visualización y exportación de reportes en formato web de alta fidelidad."})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-2 rounded-2xl shadow-sm border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Lr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.start,onChange:b=>s(v=>({...v,start:b.target.value}))})]}),n.jsx("span",{className:"text-slate-300 font-bold",children:"al"}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Lr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.end,onChange:b=>s(v=>({...v,end:b.target.value}))})]})]})]}),u.type&&n.jsxs("div",{className:`p-4 rounded-2xl flex items-center gap-3 animate-in slide-in-from-top duration-300 ${u.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100"}`,children:[u.type==="success"?n.jsx(zt,{size:20}):n.jsx(Cr,{size:20}),n.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:u.message})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map(b=>{const v=i===b.id,y=b.icon;return n.jsxs("button",{onClick:()=>x(b.id),className:`flex flex-col p-6 rounded-[2.5rem] border-2 transition-all text-left relative overflow-hidden group ${v?"bg-indigo-600 border-indigo-600 shadow-xl shadow-indigo-200":"bg-white border-slate-100 hover:border-indigo-200 hover:shadow-lg"}`,children:[n.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center mb-4 transition-colors ${v?"bg-white/20 text-white":"bg-indigo-50 text-indigo-600"}`,children:n.jsx(y,{size:24})}),n.jsx("h3",{className:`font-black text-sm uppercase tracking-widest mb-2 ${v?"text-white":"text-slate-900"}`,children:b.label}),n.jsx("p",{className:`text-[10px] font-medium leading-relaxed ${v?"text-indigo-100":"text-slate-500"}`,children:b.description}),v&&n.jsx("div",{className:"absolute top-4 right-4",children:n.jsx(_c,{className:"text-white",size:20})}),n.jsx("div",{className:`absolute -right-4 -bottom-4 opacity-10 transition-transform group-hover:scale-110 ${v?"text-white":"text-indigo-600"}`,children:n.jsx(y,{size:80})})]},b.id)})}),o&&n.jsx("div",{className:"fixed inset-0 z-[100] bg-slate-900/80 backdrop-blur-sm flex items-center justify-center p-4 lg:p-12 no-print",children:n.jsxs("div",{className:"bg-white w-full max-w-7xl h-full rounded-[3rem] overflow-hidden flex flex-col shadow-2xl animate-in zoom-in duration-300",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tighter uppercase",children:o.title}),n.jsx("p",{className:"text-slate-500 text-[10px] font-black uppercase tracking-widest mt-1",children:"Vista Previa del Reporte HTML"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("button",{onClick:m,className:"bg-indigo-600 hover:bg-indigo-700 text-white px-6 py-3 rounded-2xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2 transition-all",children:[n.jsx(yt,{size:16})," Imprimir / PDF"]}),n.jsx("button",{onClick:()=>d(null),className:"bg-slate-100 hover:bg-slate-200 text-slate-500 p-3 rounded-2xl transition-all",children:n.jsx(ft,{size:24})})]})]}),n.jsx("div",{className:"flex-1 overflow-auto p-8 custom-scrollbar",children:n.jsx("div",{className:"bg-white border border-slate-200 rounded-3xl overflow-hidden",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsx("tr",{className:"bg-slate-50 border-b border-slate-200",children:o.headers.map((b,v)=>n.jsx("th",{className:"p-4 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:b},v))})}),n.jsx("tbody",{children:o.rows.map((b,v)=>n.jsx("tr",{className:"border-b border-slate-100 hover:bg-slate-50/50 transition-colors",children:b.map((y,k)=>n.jsx("td",{className:"p-4 text-xs font-bold text-slate-700",children:typeof y=="number"?y.toLocaleString("en-US",{minimumFractionDigits:2}):y},k))},v))})]})})}),n.jsxs("div",{className:"p-8 border-t border-slate-100 bg-slate-50 flex items-center justify-between",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:["Generado por SAC 2026 Kernel V4.1.51 MC/MB - ",new Date().toLocaleString()]}),n.jsxs("div",{className:"flex items-center gap-2 text-indigo-600 font-black text-[10px] uppercase tracking-widest",children:[n.jsx(ko,{size:14}),"Data Certificada"]})]})]})}),o&&n.jsxs("div",{className:"hidden print:block print-visible p-0 m-0",children:[n.jsxs("div",{className:"mb-8 text-center",children:[n.jsx("h1",{className:"text-3xl font-black uppercase tracking-tighter",children:o.title}),n.jsx("p",{className:"text-sm font-bold uppercase tracking-widest text-slate-500 mt-2",children:"Condominio El Tejar - Reporte Oficial de Gestión"}),n.jsx("div",{className:"w-24 h-1 bg-indigo-600 mx-auto mt-4"})]}),n.jsxs("table",{className:"w-full border-collapse border border-slate-300",children:[n.jsx("thead",{children:n.jsx("tr",{className:"bg-slate-100",children:o.headers.map((b,v)=>n.jsx("th",{className:"border border-slate-300 p-2 text-[10px] font-black uppercase tracking-widest text-slate-600",children:b},v))})}),n.jsx("tbody",{children:o.rows.map((b,v)=>n.jsx("tr",{children:b.map((y,k)=>n.jsx("td",{className:"border border-slate-300 p-2 text-[10px] font-medium text-slate-800",children:typeof y=="number"?y.toLocaleString("en-US",{minimumFractionDigits:2}):y},k))},v))})]}),n.jsxs("div",{className:"mt-12 pt-8 border-t border-slate-200 flex justify-between items-end",children:[n.jsxs("div",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-[0.2em]",children:["SAC 2026 Kernel V4.1.51 MC/MB",n.jsx("br",{}),"ID Auditoría: ",Math.random().toString(36).substring(2,15).toUpperCase()]}),n.jsxs("div",{className:"text-right",children:[n.jsx("div",{className:"w-48 h-px bg-slate-300 mb-2 mx-auto"}),n.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-slate-400",children:"Firma Autorizada / Sello"})]})]})]}),n.jsx("div",{className:"bg-indigo-50 border border-indigo-100 p-8 rounded-[3rem] mt-12",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-indigo-600 text-white rounded-xl flex items-center justify-center shrink-0",children:n.jsx(_c,{size:20})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-indigo-900 font-black text-sm uppercase tracking-widest mb-2",children:"Visualización Interactiva"}),n.jsx("p",{className:"text-indigo-700 text-xs font-medium leading-relaxed",children:"Los reportes HTML permiten una visualización rápida sin necesidad de descargar archivos. Utilice el botón de impresión para generar un PDF profesional o imprimir directamente con el formato optimizado para auditoría."})]})]})})]})},to=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},vm=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},LFe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,latestRate:l}=ht(),[o,d]=j.useState(new Date().getMonth()),[u,f]=j.useState(new Date().getFullYear()),[p,x]=j.useState(e.role==="owner"&&e.propertyId||null),[m,b]=j.useState("selection"),[v,y]=j.useState([]),[k,_]=j.useState(!1),[C,E]=j.useState(null),[T,B]=j.useState({});j.useEffect(()=>{(async()=>{_(!0);try{const[K,W]=await Promise.all([we.getInitialDebtData(),we.getSystemSettings()]);Array.isArray(K)?y(K):K&&K.success&&y(K.data||[]),B(W||{})}catch(K){console.error("Error fetching data",K)}finally{_(!1)}})()},[]);const I=j.useMemo(()=>t.find(G=>G.month===o&&G.year===u),[t,o,u]),M=j.useMemo(()=>r.find(G=>G.id===p),[r,p]),U=j.useMemo(()=>v.find(G=>G.id===p),[v,p]),D=j.useMemo(()=>{if(!M)return null;const G=a.find(W=>W.propertyId===M.id&&W.isOwner),K=s.find(W=>W.cedula===(G==null?void 0:G.cedula));return{fullName:(G==null?void 0:G.fullName)||"Propietario",email:(K==null?void 0:K.email)||"",phone:(G==null?void 0:G.phone)||(K==null?void 0:K.phone)||"",telegramId:(K==null?void 0:K.telegramChatId)||"",propertyCode:M.code,propertyId:M.id}},[M,a,s]),L=G=>{if(!G)return"";let K=G.trim();return K.startsWith("+")?K.replace(/\D/g,""):K.startsWith("0")?"58"+K.substring(1).replace(/\D/g,""):K.length===10?"58"+K.replace(/\D/g,""):K.replace(/\D/g,"")},R=async G=>{if(!D||!M)return;const K=I==null?void 0:I.debts.find(te=>te.propertyId===p),W=K?Number(K.amountUsd)-Number(K.paidAmount):0,z=(U==null?void 0:U.current_debt)||0,Z=W+z,Y=`🏢 *ESTADO DE CUENTA INDIVIDUAL - SAC 2026*

Estimado(a) *${D.fullName}*,
Unidad: *${M.type} ${M.number}* (${M.code})

📅 *Periodo:* ${Ue[o]} ${u}
------------------------------------------
💵 *Cuota del Mes:* $${to(W)}
🤝 *Convenio de Pago:* $${to(z)}
------------------------------------------
🔥 *TOTAL PENDIENTE:* $${to(Z)}

Por favor, gestione su pago en nuestro portal digital:
🌐 ${la}

¡Gracias!`;if(G==="whatsapp"){const te=L(D.phone);if(!te)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${te}?text=${encodeURIComponent(Y)}`,"_blank");return}if(G==="share"){if(navigator.share)try{await navigator.share({title:`Estado de Cuenta Individual - ${M.code}`,text:Y.replace(/\*/g,""),url:la})}catch(te){console.warn("Share failed",te)}else alert("La función de compartir no está disponible en este navegador.");return}E(G);try{const te={channel:G,messageType:"custom",subject:`Estado de Cuenta SAC 2026 - ${M.code}`,recipients:[{name:D.fullName,email:D.email,telegramChatId:D.telegramId,customMessage:Y.replace(/\*/g,"")}]},P=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(te)})).json();P.status==="success"?alert(`¡Éxito! Mensaje enviado por ${G}.`):alert("Error: "+P.message)}catch{alert("Error de red al enviar.")}finally{E(null)}},Q=()=>{if(!M||!D)return;const G=I==null?void 0:I.debts.find(P=>P.propertyId===p),K=G?Number(G.amountUsd)-Number(G.paidAmount):0,W=(U==null?void 0:U.current_debt)||0,z=K+W,Z=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Estado de Cuenta - ${M.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f1f5f9; }
        .container { max-width: 800px; margin: 0 auto; background: white; padding: 60px; border-radius: 30px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 40px; border-bottom: 2px solid #f1f5f9; padding-bottom: 20px; }
        .title { font-size: 24px; font-weight: 900; text-transform: uppercase; color: #0f172a; }
        .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
        .label { font-size: 10px; font-weight: 900; color: #64748b; text-transform: uppercase; }
        .value { font-size: 16px; font-weight: 700; color: #1e293b; }
        .amount-box { background: #0f172a; padding: 30px; border-radius: 20px; text-align: center; margin-bottom: 40px; color: white; }
        .amount-label { font-size: 12px; font-weight: 900; color: #94a3b8; text-transform: uppercase; }
        .amount-value { font-size: 48px; font-weight: 900; color: #38bdf8; }
        .detail-row { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f1f5f9; }
        .detail-label { font-weight: 700; color: #475569; }
        .detail-value { font-weight: 900; color: #0f172a; }
        .payment-info { margin-top: 40px; padding-top: 20px; border-top: 2px solid #f1f5f9; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
        .payment-title { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 10px; }
        .payment-card { background: #f8fafc; padding: 15px; border-radius: 15px; font-size: 11px; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 40px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Estado de Cuenta Individual</div>
            <div style="font-size: 12px; color: #64748b; font-weight: 700; margin-top: 5px;">SAC 2026 - ${Ue[o]} ${u}</div>
        </div>
        <div class="info-grid">
            <div>
                <div class="label">Propietario</div>
                <div class="value">${D.fullName}</div>
            </div>
            <div style="text-align: right;">
                <div class="label">Unidad</div>
                <div class="value">${M.code} (${M.type} ${M.number})</div>
            </div>
        </div>
        <div class="detail-row">
            <span class="detail-label">Cuota del Mes</span>
            <span class="detail-value">$ ${to(K)}</span>
        </div>
        <div class="detail-row">
            <span class="detail-label">Convenio de Pago</span>
            <span class="detail-value">$ ${to(W)}</span>
        </div>
        <div class="amount-box">
            <div class="amount-label">Total Pendiente</div>
            <div class="amount-value">$ ${to(z)}</div>
            <div style="font-size: 18px; font-weight: 700; color: #94a3b8; margin-top: 10px;">Bs. ${vm(z*l)}</div>
        </div>

        <div class="payment-info">
            <div>
                <div class="payment-title">Datos para el Pago</div>
                <div class="payment-card">
                    <div style="font-weight: 700; color: #334155; text-transform: uppercase;">${T.payment_bank_name||"BanPlus"} ${T.payment_account_type||"Cta Cte"}</div>
                    <div style="font-weight: 900; color: #1e3a8a; margin: 2px 0;"># ${T.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                    <div style="color: #475569;">RIF: ${T.payment_rif||"J-313266507"}</div>
                    <div style="color: #475569;">Pago Móvil: ${T.payment_mobile_phone||"0424-4910040"}</div>
                </div>
            </div>
            <div>
                <div class="payment-title" style="color: #059669;">Reportar Pago</div>
                <div class="payment-card">
                    <div style="font-size: 9px; font-weight: 900; color: #94a3b8; text-transform: uppercase; margin-bottom: 4px;">Enviar comprobante a:</div>
                    ${(T.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map(P=>`<div style="font-weight: 700; color: #334155;">${P.trim()}</div>`).join("")}
                    <div style="font-weight: 700; color: #475569; margin-top: 4px;">WhatsApp: ${T.payment_whatsapp||"0412-8213310"}</div>
                    <div style="font-size: 9px; font-weight: 900; color: #d97706; font-style: italic; margin-top: 8px;">Indicar #casa y nombre para identificar</div>
                </div>
            </div>
        </div>

        <div class="footer">
            Generado digitalmente por SAC 2026 • ${Ps} • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,Y=new Blob([Z],{type:"text/html"}),te=URL.createObjectURL(Y),O=document.createElement("a");O.href=te,O.download=`EstadoCuenta_${M.code}.html`,O.click(),URL.revokeObjectURL(te)};if(m==="report"&&M&&D){const G=I==null?void 0:I.debts.find(Z=>Z.propertyId===p),K=G?Number(G.amountUsd)-Number(G.paidAmount):0,W=(U==null?void 0:U.current_debt)||0,z=K+W;return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsx("style",{children:`
                    @media print {
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                    }
                `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>b("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:Q,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(ja,{size:20})}),n.jsx("button",{onClick:()=>R("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>R("telegram"),disabled:!D.telegramId||!!C,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${D.telegramId?"bg-sky-500":"bg-slate-200"}`,children:C==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>R("email"),disabled:!D.email||!!C,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${D.email?"bg-indigo-600":"bg-slate-200"}`,children:C==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>R("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(_a,{size:20})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative print-header",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Estado de Cuenta Individual"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4 print:flex",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[M.type," ",M.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[(Number(M.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[l.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:D.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[M.type," ",M.number," (",M.code,")"]})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(Lr,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:"Cuota del Mes"}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[Ue[o]," ",u]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",to(K)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",vm(K*l)]})]})]}),n.jsxs("div",{className:"flex justify-between items-center p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-amber-600 shadow-sm",children:n.jsx(Zd,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:"Convenio de Pago"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Saldo Histórico Pendiente"})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",to(W)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",vm(W*l)]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-xl flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Total Pendiente de Pago"}),n.jsxs("h3",{className:"text-5xl font-black tracking-tighter",children:["$ ",to(z)]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Equivalente en Bolívares"}),n.jsxs("p",{className:"text-2xl font-black text-blue-300 tracking-tight",children:["Bs. ",vm(z*l)]})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx($i,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase",children:[T.payment_bank_name||"BanPlus"," ",T.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider",children:["# ",T.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["RIF: ",T.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["Pago Móvil: ",T.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Qr,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Enviar comprobante a:"}),(T.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((Z,Y)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:Z.trim()},Y)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1",children:["WhatsApp: ",T.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2",children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:["SAC 2026 • ",Ps," • Generado Digitalmente"]})})]})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado de Cuenta ",n.jsx("span",{className:"text-blue-600",children:"Individual"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Consolidado de cuota mensual y convenios de pago."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:o,onChange:G=>d(Number(G.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((G,K)=>n.jsx("option",{value:K,children:G},K))}),n.jsx("input",{type:"number",value:u,onChange:G=>f(Number(G.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(PA,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Seleccione Propiedad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Visualice el saldo total pendiente incluyendo convenios."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:p||"",onChange:G=>x(Number(G.target.value)),disabled:e.role==="owner",className:`w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer ${e.role==="owner"?"opacity-75 cursor-not-allowed":""}`,children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),r.filter(G=>e.role!=="owner"||G.id===e.propertyId).sort((G,K)=>G.code.localeCompare(K.code,void 0,{numeric:!0})).map(G=>n.jsxs("option",{value:G.id,children:[G.code," - ",G.type," ",G.number]},G.id))]})]}),n.jsxs("button",{disabled:!p,onClick:()=>b("report"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:["GENERAR ESTADO DE CUENTA ",n.jsx(Os,{size:18})]}),k&&n.jsx("div",{className:"flex justify-center py-4",children:n.jsx(Qt,{className:"animate-spin text-blue-600",size:24})})]})})]})},ul=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},ym=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},QFe=({user:e})=>{var L,R;const{properties:t,residents:r,users:a,latestRate:s}=ht(),[i,l]=j.useState(new Date().getMonth()),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState(null),[p,x]=j.useState("selection"),[m,b]=j.useState(!1),[v,y]=j.useState(null),[k,_]=j.useState(null),[C,E]=j.useState({});j.useEffect(()=>{(async()=>{try{const G=await we.getSystemSettings();E(G||{})}catch(G){console.error("Error fetching settings",G)}})()},[]);const T=j.useMemo(()=>t.find(Q=>Q.id===u),[t,u]),B=j.useMemo(()=>{if(!T)return null;const Q=r.find(K=>K.propertyId===T.id&&K.isOwner),G=a.find(K=>K.cedula===(Q==null?void 0:Q.cedula));return{fullName:(Q==null?void 0:Q.fullName)||"Propietario",email:(G==null?void 0:G.email)||"",phone:(Q==null?void 0:Q.phone)||(G==null?void 0:G.phone)||"",telegramId:(G==null?void 0:G.telegramChatId)||"",propertyCode:T.code,propertyId:T.id}},[T,r,a]),I=async()=>{if(u){b(!0);try{const G=await(await fetch(`${ye}/get_detailed_account_status.php?propertyId=${u}&month=${i}&year=${o}`,{credentials:"include"})).json();G.success?(y(G),x("report")):alert("Error: "+G.error)}catch{alert("Error de red al obtener el reporte.")}finally{b(!1)}}},M=Q=>{if(!Q)return"";let G=Q.trim();return G.startsWith("+")?G.replace(/\D/g,""):G.startsWith("0")?"58"+G.substring(1).replace(/\D/g,""):G.length===10?"58"+G.replace(/\D/g,""):G.replace(/\D/g,"")},U=async Q=>{var z;if(!B||!T||!v)return;const G=Ue[i],K=v.movements.reduce((Z,Y)=>Z+Y.amount,0);let W=`🏢 *ESTADO DE CUENTA DETALLADO - SAC 2026*

Estimado(a) *${B.fullName}*,
Unidad: *${T.type} ${T.number}* (${T.code})

📅 *Periodo:* ${G} ${o}
------------------------------------------
💵 *Cuota del Mes:* $${ul(((z=v.currentMonthFee)==null?void 0:z.billed)||0)}
✅ *Pagado en el Mes:* $${ul(K)}
------------------------------------------
🔥 *TOTAL DEUDA ACTUAL:* $${ul(v.totalDebt)}

*DETALLE DE MOVIMIENTOS:* 
`;if(v.movements.forEach(Z=>{W+=`• ${Z.date}: $${ul(Z.amount)} (${Z.description})
`}),W+=`
Consulte más detalles en:
🌐 ${la}

¡Gracias!`,Q==="whatsapp"){const Z=M(B.phone);if(!Z)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${Z}?text=${encodeURIComponent(W)}`,"_blank");return}if(Q==="share"){if(navigator.share)try{await navigator.share({title:`Estado de Cuenta Detallado - ${T.code}`,text:W.replace(/\*/g,""),url:la})}catch(Z){console.warn("Share failed",Z)}else alert("La función de compartir no está disponible en este navegador.");return}_(Q);try{const Z={channel:Q,messageType:"custom",subject:`Estado de Cuenta Detallado SAC 2026 - ${T.code}`,recipients:[{name:B.fullName,email:B.email,telegramChatId:B.telegramId,customMessage:W.replace(/\*/g,"")}]},te=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)})).json();te.status==="success"?alert(`¡Éxito! Mensaje enviado por ${Q}.`):alert("Error: "+te.message)}catch{alert("Error de red al enviar.")}finally{_(null)}},D=()=>{if(!T||!B||!v)return;v.movements.reduce((z,Z)=>z+Z.amount,0);const Q=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Estado Detallado - ${T.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 900px; margin: 0 auto; background: white; padding: 50px; border-radius: 24px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 30px; }
        .title { font-size: 20px; font-weight: 900; text-transform: uppercase; color: #0f172a; letter-spacing: 2px; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th { text-align: left; font-size: 10px; text-transform: uppercase; color: #64748b; padding: 12px; border-bottom: 2px solid #f1f5f9; }
        td { padding: 12px; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
        .total-box { margin-top: 30px; padding: 20px; background: #0f172a; color: white; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; }
        .payment-info { margin-top: 40px; padding-top: 20px; border-top: 2px solid #f1f5f9; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; text-align: left; }
        .payment-title { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 10px; }
        .payment-card { background: #f8fafc; padding: 15px; border-radius: 15px; font-size: 11px; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 30px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Estado de Cuenta Detallado</div>
            <div style="font-size: 11px; color: #64748b; font-weight: 700; margin-top: 4px;">SAC 2026 - ${Ue[i]} ${o}</div>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 30px; font-size: 13px;">
            <div><strong>Propietario:</strong> ${B.fullName}</div>
            <div><strong>Unidad:</strong> ${T.code}</div>
        </div>
        
        <div style="font-size: 12px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 10px;">Movimientos del Mes</div>
        <table>
            <thead>
                <tr>
                    <th>Fecha</th>
                    <th>Descripción</th>
                    <th style="text-align: right;">Monto ($)</th>
                </tr>
            </thead>
            <tbody>
                ${v.movements.map(z=>`
                    <tr>
                        <td>${z.date}</td>
                        <td>${z.description}</td>
                        <td style="text-align: right;">$ ${ul(z.amount)}</td>
                    </tr>
                `).join("")}
                ${v.movements.length===0?'<tr><td colspan="3" style="text-align: center; color: #94a3b8;">No hay abonos registrados</td></tr>':""}
            </tbody>
        </table>

        <div class="total-box">
            <div>
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Saldo Total Pendiente</div>
                <div style="font-size: 24px; font-weight: 900;">$ ${ul(v.totalDebt)}</div>
            </div>
            <div style="text-align: right;">
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Equivalente VES</div>
                <div style="font-size: 18px; font-weight: 700;">Bs. ${ym(v.totalDebt*s)}</div>
            </div>
        </div>

        <div class="payment-info">
            <div>
                <div class="payment-title">Datos para el Pago</div>
                <div class="payment-card">
                    <div style="font-weight: 700; color: #334155; text-transform: uppercase;">${C.payment_bank_name||"BanPlus"} ${C.payment_account_type||"Cta Cte"}</div>
                    <div style="font-weight: 900; color: #1e3a8a; margin: 2px 0;"># ${C.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                    <div style="color: #475569;">RIF: ${C.payment_rif||"J-313266507"}</div>
                    <div style="color: #475569;">Pago Móvil: ${C.payment_mobile_phone||"0424-4910040"}</div>
                </div>
            </div>
            <div>
                <div class="payment-title" style="color: #059669;">Reportar Pago</div>
                <div class="payment-card">
                    <div style="font-size: 9px; font-weight: 900; color: #94a3b8; text-transform: uppercase; margin-bottom: 4px;">Enviar comprobante a:</div>
                    ${(C.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map(z=>`<div style="font-weight: 700; color: #334155;">${z.trim()}</div>`).join("")}
                    <div style="font-weight: 700; color: #475569; margin-top: 4px;">WhatsApp: ${C.payment_whatsapp||"0412-8213310"}</div>
                    <div style="font-size: 9px; font-weight: 900; color: #d97706; font-style: italic; margin-top: 8px;">Indicar #casa y nombre para identificar</div>
                </div>
            </div>
        </div>
        
        <div class="footer">
            Generado por SAC 2026 • Kernel V4.1.61 MC/MB • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,G=new Blob([Q],{type:"text/html"}),K=URL.createObjectURL(G),W=document.createElement("a");W.href=K,W.download=`DetalleCuenta_${T.code}.html`,W.click(),URL.revokeObjectURL(K)};if(p==="report"&&T&&B&&v){const Q=v.movements.reduce((G,K)=>G+K.amount,0);return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsx("style",{children:`
                    @media print {
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                    }
                `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>x("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:D,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(ja,{size:20})}),n.jsx("button",{onClick:()=>U("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>U("telegram"),disabled:!B.telegramId||!!k,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.telegramId?"bg-sky-500":"bg-slate-200"}`,children:k==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>U("email"),disabled:!B.email||!!k,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.email?"bg-indigo-600":"bg-slate-200"}`,children:k==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>U("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(_a,{size:20})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative print-header",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Estado de Cuenta Detallado"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4 print:flex",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[T.type," ",T.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[(Number(T.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[s.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:B.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[T.type," ",T.number," (",T.code,")"]})]})]}),n.jsxs("section",{className:"space-y-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(gr,{size:14,className:"text-blue-600"})," Cargos del Periodo (",Ue[i]," ",o,")"]}),n.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100 flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(aa,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:"Cuota Mensual de Condominio"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Facturación del Mes"})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",ul(((L=v.currentMonthFee)==null?void 0:L.billed)||0)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",ym((((R=v.currentMonthFee)==null?void 0:R.billed)||0)*s)]})]})]})]}),n.jsxs("section",{className:"space-y-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(zt,{size:14,className:"text-emerald-600"})," Abonos Registrados en el Mes"]}),v.movements.length>0?n.jsxs("div",{className:"space-y-3",children:[v.movements.map((G,K)=>n.jsxs("div",{className:"p-5 bg-white border border-slate-100 rounded-2xl flex justify-between items-center shadow-sm",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-emerald-50 text-emerald-600 rounded-xl flex items-center justify-center",children:n.jsx($i,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-black text-slate-900 uppercase",children:G.description}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:[G.date," • Ref: ",G.reference]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-sm font-black text-emerald-600",children:["+ $ ",ul(G.amount)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Bs. ",ym(G.amount*s)]})]})]},K)),n.jsxs("div",{className:"p-5 bg-emerald-50 border border-emerald-100 rounded-2xl flex justify-between items-center",children:[n.jsx("p",{className:"text-xs font-black text-emerald-700 uppercase",children:"Total Abonos del Mes"}),n.jsxs("p",{className:"text-lg font-black text-emerald-700",children:["$ ",ul(Q)]})]})]}):n.jsxs("div",{className:"p-10 bg-slate-50 rounded-3xl border border-dashed border-slate-200 text-center",children:[n.jsx(Oc,{size:32,className:"text-slate-300 mx-auto mb-3"}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"No se detectaron abonos en este periodo"})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-xl flex flex-col md:flex-row justify-between items-center gap-8",children:[n.jsxs("div",{className:"text-center md:text-left",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Estatus de Cuenta"}),n.jsx("div",{className:"flex items-center gap-3 justify-center md:justify-start",children:v.totalDebt<=0?n.jsx("div",{className:"px-4 py-2 bg-emerald-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"SOLVENTE"}):n.jsx("div",{className:"px-4 py-2 bg-red-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"DEUDA PENDIENTE"})})]}),n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Saldo Total a la Fecha"}),n.jsxs("h3",{className:"text-5xl font-black tracking-tighter",children:["$ ",ul(v.totalDebt)]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-1",children:["Bs. ",ym(v.totalDebt*s)]})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx($i,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase",children:[C.payment_bank_name||"BanPlus"," ",C.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider",children:["# ",C.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["RIF: ",C.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["Pago Móvil: ",C.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Qr,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Enviar comprobante a:"}),(C.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((G,K)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:G.trim()},K)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1",children:["WhatsApp: ",C.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2",children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"SAC 2026 • Kernel V4.1.62 MC/MB • Generado Digitalmente"})})]})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado de Cuenta ",n.jsx("span",{className:"text-blue-600",children:"Detallado"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Desglose exhaustivo de movimientos y abonos mensuales."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:i,onChange:Q=>l(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((Q,G)=>n.jsx("option",{value:G,children:Q},G))}),n.jsx("input",{type:"number",value:o,onChange:Q=>d(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Ba,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Auditoría de Movimientos"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Seleccione la unidad para detallar todos los pagos y cargos del mes."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:u||"",onChange:Q=>f(Number(Q.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),t.sort((Q,G)=>Q.code.localeCompare(G.code,void 0,{numeric:!0})).map(Q=>n.jsxs("option",{value:Q.id,children:[Q.code," - ",Q.type," ",Q.number]},Q.id))]})]}),n.jsxs("button",{disabled:!u||m,onClick:I,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[m?n.jsx(Qt,{className:"animate-spin",size:20}):n.jsx(Os,{size:18}),"GENERAR REPORTE DETALLADO"]})]})})]})},is=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},iN=({user:e,initialMode:t,onNavigate:r})=>{const{fees:a,properties:s,residents:i,users:l,latestRate:o}=ht(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState(null),[b,v]=j.useState("selection"),[y,k]=j.useState(null),[_,C]=j.useState(!1),[E,T]=j.useState([]),[B,I]=j.useState(!1),M=j.useRef(null);j.useEffect(()=>{(async()=>{I(!0);try{const ge=await we.getInitialDebtData();T(Array.isArray(ge)?ge:[])}catch(ge){console.error("Error fetching agreements:",ge)}finally{I(!1)}})()},[]);const U=j.useMemo(()=>a.find(le=>le.month===d&&le.year===f),[a,d,f]),D=j.useMemo(()=>s.find(le=>le.id===x),[s,x]),L=j.useMemo(()=>{if(!D)return null;const le=i.find(X=>X.propertyId===D.id&&X.isOwner),ge=l.find(X=>X.cedula===(le==null?void 0:le.cedula));return{fullName:(le==null?void 0:le.fullName)||"Propietario",email:(ge==null?void 0:ge.email)||"",phone:(le==null?void 0:le.phone)||(ge==null?void 0:ge.phone)||"",telegramId:(ge==null?void 0:ge.telegramChatId)||"",propertyCode:D.code}},[D,i,l]),R=j.useMemo(()=>!U||!x?null:U.debts.find(le=>le.propertyId===x),[U,x]),Q=j.useMemo(()=>{if(!x)return{totalDebt:0,isFullySolvent:!0};let le=0;return a.forEach(ge=>{const X=ge.debts.find(pe=>pe.propertyId===x);X&&(le+=Number(X.amountUsd)-Number(X.paidAmount))}),{totalDebt:le,isFullySolvent:le<=0}},[a,x]),[G,K]=j.useState(!1),[W,z]=j.useState({date:new Date().toLocaleDateString("es-ES",{day:"numeric",month:"long",year:"numeric"}),city:"San Diego",recipientName:"",recipientId:"",mode:"html"}),[Z,Y]=j.useState(null);j.useEffect(()=>{t&&x&&b==="receipt"&&(z(le=>({...le,mode:t})),K(!0))},[t,x,b]),j.useEffect(()=>{!["admin","programmer"].includes(e.role)&&e.propertyId&&m(e.propertyId)},[e]),j.useEffect(()=>{(async()=>{try{const ge=await we.getSystemSettings();Y(ge)}catch(ge){console.error("Error fetching settings",ge)}})()},[]);const te=j.useMemo(()=>D?E.find(le=>le.code===D.code):null,[E,D]),O=j.useMemo(()=>R?Number(R.paidAmount)>=Number(R.amountUsd):!1,[R]),P=()=>{if(!D||!L)return;const le=Math.random().toString(36).substring(2,10).toUpperCase(),ge=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Solvencia de Condominio - ${D.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.6; background-color: #f1f5f9; }
        .container { max-width: 800px; margin: 0 auto; background: white; border: 1px solid #e2e8f0; padding: 80px; border-radius: 40px; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1); overflow: hidden; }
        .container::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 15px; background: linear-gradient(to right, #2563eb, #3b82f6); }
        .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; border-bottom: 1px solid #f1f5f9; padding-bottom: 30px; }
        .logo { font-size: 32px; font-weight: 900; letter-spacing: -1.5px; margin-bottom: 5px; color: #0f172a; }
        .logo span { color: #2563eb; }
        .condo-name { text-transform: uppercase; font-weight: 900; color: #ea580c; font-size: 11px; letter-spacing: 3px; }
        .doc-meta { text-align: right; }
        .doc-id { font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
        .title { text-align: center; font-size: 32px; font-weight: 900; text-transform: uppercase; margin: 60px 0; letter-spacing: 4px; color: #0f172a; }
        .content { font-size: 17px; text-align: justify; margin-bottom: 80px; color: #334155; }
        .content strong { color: #0f172a; font-weight: 900; }
        .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 50px; background: #f8fafc; padding: 30px; border-radius: 25px; border: 1px solid #f1f5f9; }
        .info-item { font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b; margin-bottom: 5px; letter-spacing: 1px; }
        .info-value { font-size: 18px; font-weight: 900; color: #0f172a; }
        .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 120px; text-align: center; }
        .sig-line { width: 100%; border-top: 2px solid #0f172a; padding-top: 15px; font-weight: 900; font-size: 13px; text-transform: uppercase; color: #0f172a; }
        .sig-label { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 2px; margin-top: 5px; }
        .footer { margin-top: 100px; text-align: center; font-size: 10px; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 30px; font-weight: 500; }
        .watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-30deg); font-size: 150px; font-weight: 900; color: rgba(37, 99, 235, 0.04); pointer-events: none; white-space: nowrap; z-index: 0; text-transform: uppercase; }
        .stamp { position: absolute; bottom: 150px; right: 80px; width: 120px; height: 120px; border: 4px double #2563eb; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; color: #2563eb; font-size: 10px; font-weight: 900; transform: rotate(-15deg); opacity: 0.2; padding: 10px; text-transform: uppercase; }
        @media print { .no-print { display: none; } body { padding: 0; background: white; } .container { border: none; box-shadow: none; padding: 40px; } }
        .btn-print { background: #0f172a; color: white; border: none; padding: 15px 30px; border-radius: 15px; cursor: pointer; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; transition: all 0.3s ease; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .btn-print:hover { transform: translateY(-2px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); background: #1e293b; }
    </style>
</head>
<body>
    <div class="container">
        <div class="watermark">SOLVENTE</div>
        <div class="stamp">Certificación Digital<br>SAC 2026</div>
        <div class="header">
            <div class="logo-section">
                <div class="logo">SAC <span>2026</span></div>
                <div class="condo-name">CONDOMINIO EL TEJAR</div>
            </div>
            <div class="doc-meta">
                <div class="doc-id">Documento: SOLV-2026-${D.code}</div>
                <div class="doc-id">Verificación: ${le}</div>
            </div>
        </div>
        <div class="info-grid">
            <div>
                <div class="info-item">Ciudad y Fecha de Emisión</div>
                <div class="info-value">${W.city}, ${W.date}</div>
            </div>
            <div style="text-align: right;">
                <div class="info-item">Unidad Inmobiliaria</div>
                <div class="info-value">${D.code}</div>
            </div>
        </div>
        <div class="title">Solvencia de Condominio</div>
        <div class="content">
            Por medio de la presente se hace constar que el ciudadano(a) <strong>${W.recipientName.toUpperCase()||L.fullName.toUpperCase()}</strong>, 
            titular de la Cédula de Identidad N° <strong>${W.recipientId.toUpperCase()||"S/D"}</strong>, se encuentra 
            <strong>SOLVENTE</strong> con sus obligaciones de condominio correspondientes a la Unidad Inmobiliaria N° 
            <strong>${D.code}</strong> (${D.type} ${D.number}), 
            hasta el periodo de <strong>${Ue[d].toUpperCase()} ${f}</strong>.
            <br><br>
            Se expide la presente a petición de la parte interesada, en la ciudad de ${W.city}, a los ${W.date}.
        </div>
        <div class="signatures">
            <div class="sig-box">
                <div class="sig-line">${(Z==null?void 0:Z.board_president)||"PRESIDENTE"}</div>
                <div class="sig-label">Presidente de la Junta</div>
            </div>
            <div class="sig-box">
                <div class="sig-line">${(Z==null?void 0:Z.board_secretary)||"SECRETARIO(A)"}</div>
                <div class="sig-label">Secretario(a) de la Junta</div>
            </div>
        </div>
        <div class="footer">
            Urb. Valle de Oro, C.R. El Tejar, ${W.city}, Correo: tejarcondominio@gmail.com<br>
            ESTE DOCUMENTO ES UNA CERTIFICACIÓN DIGITAL EMITIDA POR EL SISTEMA DE ADMINISTRACIÓN DE CONDOMINIOS (SAC 2026)
        </div>
    </div>
    <div style="text-align: center; margin-top: 40px;" class="no-print">
        <button onclick="window.print()" class="btn-print">Imprimir Documento Oficial</button>
    </div>
</body>
</html>
        `,X=window.open("","_blank");X&&(X.document.write(ge),X.document.close())},q=()=>{if(!D||!L)return;const le=`
URBANIZACION VALLE DE ORO
CONJUNTO RESIDENCIAL EL TEJAR
SOLVENCIA DE CONDOMINIO
SAC 2026 - KERNEL V4.1.60

CIUDAD: ${W.city.toUpperCase()}
FECHA: ${W.date.toUpperCase()}

A QUIEN PUEDA INTERESAR:

Por medio de la presente se hace constar que el ciudadano(a) ${W.recipientName.toUpperCase()||L.fullName.toUpperCase()}, titular de la Cédula de Identidad N° ${W.recipientId.toUpperCase()||"S/D"}, se encuentra SOLVENTE con sus obligaciones de condominio correspondientes a la Unidad Inmobiliaria N° ${D.code} (${D.type} ${D.number}), hasta el periodo de ${Ue[d].toUpperCase()} ${f}.

Se expide la presente a petición de la parte interesada.

Atentamente,

__________________________          __________________________
${((Z==null?void 0:Z.board_president)||"PRESIDENTE").toUpperCase()}          ${((Z==null?void 0:Z.board_secretary)||"SECRETARIO(A)").toUpperCase()}
PRESIDENTE                          SECRETARIO(A)

Urb. Valle de Oro, C.R. El Tejar, ${W.city.toUpperCase()}, ${W.date.toUpperCase()}, correo: tejarcondominio@gmail.com
----------------------------------------------------------
ESTE DOCUMENTO ES UNA CERTIFICACIÓN DIGITAL EMITIDA POR EL
SISTEMA DE ADMINISTRACIÓN DE CONDOMINIOS (SAC 2026).
VERIFIQUE LA AUTENTICIDAD MEDIANTE EL CÓDIGO DE PROPIEDAD.
----------------------------------------------------------
        `,ge=new Blob([le],{type:"text/plain"}),X=URL.createObjectURL(ge),pe=document.createElement("a");pe.href=X,pe.download=`Solvencia_${D.code}_${Ue[d]}.txt`,pe.click(),URL.revokeObjectURL(X)},H=le=>{if(!le)return"";let ge=le.trim();return ge.startsWith("+")?ge.replace(/\D/g,""):ge.startsWith("0")?"58"+ge.substring(1).replace(/\D/g,""):ge.length===10?"58"+ge.replace(/\D/g,""):ge.replace(/\D/g,"")},J=()=>{if(!L||!D||!R)return"";const le=O?"✅ SOLVENTE":"⚠️ PENDIENTE",ge=Number(R.paidAmount),X=Number(R.amountUsd),pe=X-ge;return`📄 *ACUSE DE RECIBO - SAC 2026*

Unidad: *${D.code}* (${D.type} ${D.number})
Propietario: *${L.fullName}*
------------------------------------------
📅 *Periodo:* ${Ue[d]} ${f}
💰 *Monto Cuota:* $${is(X)}
💵 *Monto Pagado:* $${is(ge)}
------------------------------------------
📊 *ESTATUS:* ${le}
`+(pe>0?`📉 *Deuda Restante:* $${is(pe)}
`:`✨ *PROPIEDAD AL DÍA*
`)+`------------------------------------------
🌍 *SOLVENCIA GLOBAL:* ${Q.isFullySolvent?"✅ TOTALMENTE AL DÍA":`⚠️ DEUDA TOTAL: $${is(Q.totalDebt)}`}
------------------------------------------
Fecha de Emisión: ${new Date().toLocaleDateString()}

🔗 *ACCEDER AL PORTAL:* ${la}

¡Gracias por su compromiso!`},ae=async le=>{if(!L||!D||!R)return;const ge=J();if(le==="whatsapp"){const X=H(L.phone);if(!X)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${X}?text=${encodeURIComponent(ge)}`,"_blank");return}if(le==="share"){if(navigator.share)try{await navigator.share({title:`Acuse de Recibo - ${D.code}`,text:ge.replace(/\*/g,""),url:la})}catch(X){console.warn("Share failed",X)}else alert("La función de compartir no está disponible en este navegador.");return}k(le);try{const X=Number(R.paidAmount),pe=Number(R.amountUsd),be=pe-X,me={channel:le,messageType:"receipt",monthName:Ue[d],year:f,recipients:[{name:L.fullName,email:L.email,telegramChatId:L.telegramId,propName:`${D.code} (${D.type} ${D.number})`,amount:is(pe),paid:is(X),status:O?"Solvente":"Pendiente",balance:is(be)}]},Te=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(me)})).json();Te.status==="success"?alert(`¡Éxito! Recibo enviado por ${le}.`):alert("Error: "+Te.message)}catch{alert("Error de red al enviar.")}finally{k(null)}},oe=()=>{const le=J();navigator.clipboard.writeText(le),alert("Copiado al portapapeles")},ce=async()=>{if(M.current){C(!0);try{const ge=(await Hs(M.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),X=document.createElement("a");X.href=ge,X.download=`Recibo_${D==null?void 0:D.code}_${Ue[d]}.png`,X.click()}catch(le){console.error("Capture failed",le),alert("Error al capturar imagen.")}finally{C(!1)}}},ne=async()=>{if(M.current){C(!0);try{const le=await Hs(M.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),ge=await new Promise(be=>le.toBlob(be,"image/png"));if(!ge)throw new Error("Blob creation failed");const X=`Recibo_${D==null?void 0:D.code}_${Ue[d]}.png`,pe=new File([ge],X,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[pe]}))await navigator.share({files:[pe],title:`Acuse de Recibo - ${D==null?void 0:D.code}`,text:`Acuse de Recibo de ${Ue[d]} ${f} para la unidad ${D==null?void 0:D.code}`});else{const be=le.toDataURL("image/png"),me=document.createElement("a");me.href=be,me.download=X,me.click(),alert("La función de compartir archivos no es compatible con este navegador. La imagen se ha descargado.")}}catch(le){console.error("Share failed",le),alert("Error al compartir imagen.")}finally{C(!1)}}};if(b==="receipt"&&D&&L&&R){const le=Number(R.paidAmount),ge=Number(R.amountUsd),X=ge-le;return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsx("style",{children:`
                    @media print {
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .bg-emerald-600 { background-color: #059669 !important; -webkit-print-color-adjust: exact; }
                        .bg-emerald-50 { background-color: #ecfdf5 !important; -webkit-print-color-adjust: exact; }
                        .bg-blue-50 { background-color: #eff6ff !important; -webkit-print-color-adjust: exact; }
                        .bg-red-50 { background-color: #fef2f2 !important; -webkit-print-color-adjust: exact; }
                    }
                `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>v("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:ce,disabled:_,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:_?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Tp,{size:20})}),n.jsx("button",{onClick:ne,disabled:_,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen Directamente",children:_?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(_a,{size:20})}),n.jsx("button",{onClick:()=>ae("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"WhatsApp",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>ae("telegram"),disabled:!L.telegramId||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${L.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:y==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>ae("email"),disabled:!L.email||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${L.email?"bg-indigo-600":"bg-slate-200"}`,title:"Email",children:y==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>ae("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(_a,{size:20})}),n.jsx("button",{onClick:oe,className:"p-3 bg-slate-200 text-slate-600 rounded-xl shadow-lg active:scale-95 transition-all",title:"Copiar Formato",children:n.jsx(lb,{size:20})})]})]}),n.jsxs("div",{ref:M,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative overflow-hidden print-header",children:[n.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10 no-print",children:n.jsx(zt,{size:120})}),n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Acuse de Recibo de Pago"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4 print:flex",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[D.type," ",D.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[(Number(D.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad Inmobiliaria"}),n.jsx("p",{className:"text-xl font-black text-blue-600 uppercase",children:D.code}),n.jsxs("p",{className:"text-xs font-bold text-slate-500 uppercase",children:[D.type," ",D.number]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-xl font-black text-slate-900 uppercase",children:L.fullName}),n.jsxs("p",{className:"text-xs font-bold text-slate-500 uppercase",children:["Emisión: ",new Date().toLocaleDateString()]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100 text-center",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2",children:"Monto Cuota"}),n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$ ",is(ge)]})]}),n.jsxs("div",{className:"p-6 bg-emerald-50 rounded-3xl border border-emerald-100 text-center",children:[n.jsx("p",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-2",children:"Monto Pagado"}),n.jsxs("p",{className:"text-2xl font-black text-emerald-700",children:["$ ",is(le)]})]}),n.jsxs("div",{className:`p-6 rounded-3xl border text-center ${X<=0?"bg-blue-50 border-blue-100":"bg-red-50 border-red-100"}`,children:[n.jsx("p",{className:`text-[10px] font-black uppercase tracking-widest mb-2 ${X<=0?"text-blue-600":"text-red-600"}`,children:X<=0?"Saldo a Favor":"Deuda Pendiente"}),n.jsxs("p",{className:`text-2xl font-black ${X<=0?"text-blue-700":"text-red-700"}`,children:["$ ",is(Math.abs(X))]})]})]}),n.jsxs("div",{className:`rounded-[2.5rem] p-10 text-white shadow-xl flex flex-col md:flex-row justify-between items-center gap-6 ${O?"bg-emerald-600":"bg-slate-800"}`,children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-white/20 rounded-2xl flex items-center justify-center",children:O?n.jsx(zt,{size:40}):n.jsx(Cr,{size:40})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-white/60 uppercase tracking-[0.3em] mb-1",children:"Estatus del Periodo"}),n.jsx("h3",{className:"text-4xl font-black tracking-tighter uppercase",children:O?"Solvente":"Pendiente"})]})]}),n.jsxs("div",{className:"flex flex-col items-center md:items-end gap-4",children:[n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-white/60 uppercase tracking-widest mb-1",children:"Periodo Correspondiente"}),n.jsxs("p",{className:"text-2xl font-black text-white tracking-tight uppercase",children:[Ue[d]," ",f]})]}),O&&n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("button",{onClick:()=>{z(pe=>({...pe,mode:"html"})),K(!0)},className:"bg-blue-600 text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg hover:bg-blue-700 transition-all flex items-center gap-2 active:scale-95",children:[n.jsx(ja,{size:16}),"Solvencia HTML Pro"]}),n.jsxs("button",{onClick:()=>{z(pe=>({...pe,mode:"txt"})),K(!0)},className:"bg-white text-emerald-600 px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg hover:bg-emerald-50 transition-all flex items-center gap-2 active:scale-95",children:[n.jsx(gr,{size:16}),"Generar Solvencia .TXT"]})]})]})]}),n.jsxs("div",{className:"p-8 bg-slate-50 rounded-[2rem] border border-slate-100 flex flex-col md:flex-row justify-between items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center ${Q.isFullySolvent?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:n.jsx(Ea,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Solvencia Global de la Propiedad"}),n.jsx("p",{className:`text-sm font-black uppercase ${Q.isFullySolvent?"text-emerald-600":"text-red-600"}`,children:Q.isFullySolvent?"Completamente Solvente":`Deuda Total Acumulada: $ ${is(Q.totalDebt)}`}),te&&te.current_debt>0&&n.jsxs("div",{className:"mt-2 pt-2 border-t border-slate-200",children:[n.jsxs("p",{className:"text-[9px] font-bold text-rose-500 uppercase leading-tight",children:["Deuda Anterior (Convenio): ",n.jsxs("span",{className:"font-black",children:["$",is(te.current_debt)]})]}),n.jsx("button",{onClick:()=>r==null?void 0:r("individual-account-status"),className:"text-[8px] font-black text-blue-600 uppercase tracking-tighter hover:underline mt-1 block",children:"Ver en Estado de Cuenta Individual"})]})]})]}),!Q.isFullySolvent&&n.jsx("div",{className:"px-4 py-2 bg-red-600 text-white text-[9px] font-black uppercase tracking-widest rounded-lg",children:"Acción Requerida"})]}),R.payments&&R.payments.length>0&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-2",children:"Detalle de Pagos Registrados"}),n.jsx("div",{className:"space-y-3",children:R.payments.map((pe,be)=>n.jsxs("div",{className:"flex justify-between items-center p-4 bg-slate-50 border border-slate-100 rounded-2xl",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(xr,{size:18})}),n.jsxs("div",{children:[n.jsxs("p",{className:"text-xs font-black text-slate-900 uppercase",children:[pe.method," - Ref: ",pe.reference]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:[pe.date," • ",pe.slot]})]})]}),n.jsxs("p",{className:"text-sm font-black text-slate-900",children:["$ ",is(pe.amount)]})]},be))})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"SAC 2026 • Kernel V4.1.85 MC/MB • Certificación Digital"})})]})]}),G&&D&&n.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-900/60 backdrop-blur-sm animate-in fade-in duration-300",children:n.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-[3rem] shadow-2xl overflow-hidden border border-slate-200 animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 bg-slate-900 text-white flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center shadow-lg shadow-blue-500/20",children:n.jsx(gr,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black tracking-tight uppercase",children:"Generar Solvencia"}),n.jsx("p",{className:"text-slate-400 text-[10px] font-bold uppercase tracking-widest",children:"Complete los datos del documento"})]})]}),n.jsx("button",{onClick:()=>K(!1),className:"p-3 hover:bg-white/10 rounded-2xl transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Lr,{size:14})," Fecha del Documento"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:W.date,onChange:pe=>z({...W,date:pe.target.value}),placeholder:"Ej: 20 de Marzo de 2026"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(CM,{size:14})," Ciudad"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:W.city,onChange:pe=>z({...W,city:pe.target.value}),placeholder:"Ej: San Diego"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(eu,{size:14})," Dirigido a (Nombre)"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:W.recipientName,onChange:pe=>z({...W,recipientName:pe.target.value}),placeholder:"Nombre completo"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(_p,{size:14})," Cédula de Identidad"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:W.recipientId,onChange:pe=>z({...W,recipientId:pe.target.value}),placeholder:"V-00.000.000"})]})]}),n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-3xl space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Ea,{size:20,className:"text-blue-600"}),n.jsx("h4",{className:"text-xs font-black text-blue-900 uppercase tracking-widest",children:"Datos Automáticos del Sistema"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"bg-white/50 p-3 rounded-xl border border-blue-100",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase mb-1",children:"Inmueble"}),n.jsx("p",{className:"text-[10px] font-black text-blue-900",children:D.code})]}),n.jsxs("div",{className:"bg-white/50 p-3 rounded-xl border border-blue-100",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase mb-1",children:"Presidente"}),n.jsx("p",{className:"text-[10px] font-black text-blue-900",children:(Z==null?void 0:Z.board_president)||"No configurado"})]}),n.jsxs("div",{className:"bg-white/50 p-3 rounded-xl border border-blue-100",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase mb-1",children:"Secretario(a)"}),n.jsx("p",{className:"text-[10px] font-black text-blue-900",children:(Z==null?void 0:Z.board_secretary)||"No configurado"})]})]})]}),n.jsxs("div",{className:"flex gap-4",children:[n.jsx("button",{onClick:()=>K(!1),className:"flex-1 bg-slate-100 text-slate-500 py-5 rounded-2xl font-black text-xs uppercase tracking-widest hover:bg-slate-200 transition-all active:scale-95",children:"Cancelar"}),W.mode==="html"?n.jsxs("button",{onClick:()=>{P(),K(!1)},className:"flex-1 bg-blue-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 hover:bg-blue-700 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(ja,{size:18}),"GENERAR SOLVENCIA HTML"]}):n.jsxs("button",{onClick:()=>{q(),K(!1)},className:"flex-1 bg-emerald-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-emerald-100 hover:bg-emerald-700 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(Yi,{size:18}),"DESCARGAR SOLVENCIA .TXT"]})]})]})]})})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estatus de ",n.jsx("span",{className:"text-blue-600",children:"Pago y Solvencia"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Consulte la solvencia de cualquier unidad y genere acuses de recibo."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:le=>u(Number(le.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((le,ge)=>n.jsx("option",{value:ge,children:le},ge))}),n.jsx("input",{type:"number",value:f,onChange:le=>p(Number(le.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Ea,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Consultar Unidad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Seleccione la propiedad para verificar su estatus de pago."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:x||"",onChange:le=>m(Number(le.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),s.filter(le=>["admin","programmer"].includes(e.role)?!0:le.id===e.propertyId).sort((le,ge)=>le.code.localeCompare(ge.code,void 0,{numeric:!0})).map(le=>n.jsxs("option",{value:le.id,children:[le.code," - ",le.type," ",le.number]},le.id))]})]}),x&&te&&te.current_debt>0&&n.jsxs("div",{className:"p-6 bg-rose-50 border border-rose-100 rounded-3xl animate-in zoom-in",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600 mb-2",children:[n.jsx(Cr,{size:18}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Atención: Deuda Anterior Detectada"})]}),n.jsxs("p",{className:"text-sm font-black text-rose-700 uppercase tracking-tight",children:["Esta unidad presenta un convenio de pago activo por: ",n.jsxs("span",{className:"text-lg tracking-tighter",children:["$",is(te.current_debt)]})]}),n.jsxs("button",{onClick:()=>r==null?void 0:r("individual-account-status"),className:"mt-3 text-[9px] font-black text-blue-600 uppercase tracking-widest hover:underline flex items-center gap-2",children:[n.jsx(fs,{size:12,className:"rotate-180"}),' Diríjase al menú "Estado de Cuenta Individual" para más detalles']})]}),n.jsxs("button",{disabled:!x||!U,onClick:()=>v("receipt"),className:"w-full bg-slate-900 hover:bg-slate-800 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-slate-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:["VER ESTATUS Y RECIBO ",n.jsx(Os,{size:18})]}),!U&&x&&n.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-100 rounded-2xl flex items-center gap-3 text-amber-600 animate-in fade-in",children:[n.jsx(Cr,{size:18,className:"shrink-0"}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"No se encontraron cuotas generadas para este periodo."})]})]})})]})},wm=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},Nm=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},HFe=({user:e})=>{const{properties:t,latestRate:r}=ht(),[a,s]=j.useState(!1),[i,l]=j.useState([]),[o,d]=j.useState(""),[u,f]=j.useState(null),p=async()=>{s(!0);try{const k=await we.getCreditBalances();l(k)}catch(k){console.error("Error fetching credit balances",k)}finally{s(!1)}};j.useEffect(()=>{p()},[]);const x=j.useMemo(()=>i.filter(k=>k.propertyCode.toLowerCase().includes(o.toLowerCase())||k.ownerName.toLowerCase().includes(o.toLowerCase())),[i,o]),m=j.useMemo(()=>u?i.find(k=>k.propertyId===u):null,[i,u]),b=()=>{const k=i.map(E=>({Código:E.propertyCode,Propietario:E.ownerName,"Saldo Favor (USD)":E.amountUsd,"Saldo Favor (Bs)":E.amountBs,"Última Actualización":E.lastUpdate,Observaciones:E.observations||""})),_=pi.json_to_sheet(k),C=pi.book_new();pi.book_append_sheet(C,_,"Saldos a Favor"),ME(C,`Saldos_a_Favor_${new Date().toISOString().split("T")[0]}.xlsx`)},v=()=>{const k=window.open("","","width=900,height=900");if(!k)return;const _=x.map(C=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.propertyCode}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.ownerName}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${wm(C.amountUsd)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">Bs. ${Nm(C.amountBs)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.lastUpdate}</td>
            </tr>
        `).join("");k.document.write(`
            <html>
            <head>
                <title>Saldos a Favor - Reporte</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #10b981; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #065f46; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #065f46; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>SALDOS A FAVOR / EXCEDENTES</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Monto USD</th>
                            <th>Monto Bs</th>
                            <th>Actualización</th>
                        </tr>
                    </thead>
                    <tbody>${_}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.19</div>
            </body>
            </html>
        `),k.document.close(),k.print()},y=()=>{const k=x.map(B=>`
            <tr>
                <td>${B.propertyCode}</td>
                <td>${B.ownerName}</td>
                <td>$${wm(B.amountUsd)}</td>
                <td>Bs. ${Nm(B.amountBs)}</td>
                <td>${B.lastUpdate}</td>
                <td>${B.observations||""}</td>
            </tr>
        `).join(""),_=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Saldos a Favor - Exportación</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #065f46; border-bottom: 2px solid #10b981; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Listado de Saldos a Favor</h1>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Monto USD</th>
                            <th>Monto Bs</th>
                            <th>Última Actualización</th>
                            <th>Observaciones</th>
                        </tr>
                    </thead>
                    <tbody>${k}</tbody>
                </table>
            </body>
            </html>
        `,C=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(C),T=document.createElement("a");T.href=E,T.download=`Saldos_a_Favor_${new Date().toISOString().split("T")[0]}.html`,T.click(),URL.revokeObjectURL(E)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Saldos a ",n.jsx("span",{className:"text-emerald-600",children:"Favor"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Gestión de excedentes y pagos anticipados para el próximo mes."})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:v,className:"flex items-center gap-3 px-6 py-4 bg-slate-800 hover:bg-slate-900 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl active:scale-95",children:[n.jsx(yt,{size:18})," Imprimir"]}),n.jsxs("button",{onClick:y,className:"flex items-center gap-3 px-6 py-4 bg-blue-600 hover:bg-blue-700 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl shadow-blue-200 active:scale-95",children:[n.jsx(Jd,{size:18})," Exportar HTML"]}),n.jsxs("button",{onClick:b,className:"flex items-center gap-3 px-6 py-4 bg-emerald-600 hover:bg-emerald-700 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl shadow-emerald-200 active:scale-95",children:[n.jsx(gl,{size:18})," Exportar Excel"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm p-8",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 mb-6 flex items-center gap-2",children:[n.jsx(Gr,{size:14,className:"text-blue-600"})," Consultar Unidad"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("select",{value:u||"",onChange:k=>f(Number(k.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),t.sort((k,_)=>k.code.localeCompare(_.code,void 0,{numeric:!0})).map(k=>n.jsxs("option",{value:k.id,children:[k.code," - ",k.type," ",k.number]},k.id))]}),m?n.jsxs("div",{className:"p-6 bg-emerald-50 rounded-3xl border border-emerald-100 animate-in zoom-in",children:[n.jsx("p",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-4",children:"Estatus de Excedente"}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"text-3xl font-black text-emerald-700 tracking-tighter",children:["$ ",wm(m.amountUsd)]}),n.jsxs("p",{className:"text-sm font-bold text-emerald-600 uppercase",children:["Bs. ",Nm(m.amountBs)]})]}),n.jsxs("div",{className:"pt-4 border-t border-emerald-200/50",children:[n.jsx("p",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-widest",children:"Última Actualización"}),n.jsx("p",{className:"text-xs font-black text-emerald-800",children:m.lastUpdate})]})]})]}):u?n.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-dashed border-slate-200 text-center",children:[n.jsx(zt,{size:24,className:"text-slate-300 mx-auto mb-2"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Sin saldo a favor registrado"})]}):null]})]}),n.jsxs("div",{className:"bg-blue-600 rounded-[2.5rem] p-8 text-white shadow-xl shadow-blue-200",children:[n.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-2xl flex items-center justify-center mb-6",children:n.jsx(Cr,{size:24})}),n.jsx("h4",{className:"text-lg font-black tracking-tight mb-2 uppercase",children:"Nota Importante"}),n.jsx("p",{className:"text-blue-100 text-xs font-medium leading-relaxed",children:"Los saldos a favor se aplican automáticamente en la siguiente facturación. Si el monto no se refleja, debe cargarse manualmente en el módulo de cuotas."})]})]}),n.jsxs("div",{className:"lg:col-span-2 bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden flex flex-col",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center gap-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(Ba,{size:14,className:"text-blue-600"})," Listado de Excedentes"]}),n.jsxs("div",{className:"relative w-full md:w-64",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{type:"text",placeholder:"Buscar unidad o nombre...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-11 pr-4 py-3 text-xs font-bold outline-none focus:ring-2 focus:ring-blue-500/20",value:o,onChange:k=>d(k.target.value)})]})]}),n.jsx("div",{className:"flex-1 overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"Unidad"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"Propietario"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 text-right",children:"Monto (USD)"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 text-right",children:"Monto (Bs)"})]})}),n.jsx("tbody",{children:a?n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"px-8 py-20 text-center",children:[n.jsx(Qt,{className:"animate-spin text-blue-600 mx-auto mb-4",size:32}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"Cargando saldos..."})]})}):x.length>0?x.map(k=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 border-b border-slate-50",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-50 text-blue-600 rounded-lg flex items-center justify-center font-black text-[10px]",children:k.propertyCode}),n.jsxs("span",{className:"text-xs font-black text-slate-900 uppercase tracking-tighter",children:["Unidad ",k.propertyCode]})]})}),n.jsxs("td",{className:"px-8 py-6 border-b border-slate-50",children:[n.jsx("p",{className:"text-xs font-bold text-slate-700 uppercase",children:k.ownerName}),n.jsxs("p",{className:"text-[9px] font-medium text-slate-400 uppercase tracking-widest",children:["Act: ",k.lastUpdate]})]}),n.jsx("td",{className:"px-8 py-6 border-b border-slate-50 text-right",children:n.jsxs("span",{className:"text-sm font-black text-emerald-600",children:["$ ",wm(k.amountUsd)]})}),n.jsx("td",{className:"px-8 py-6 border-b border-slate-50 text-right",children:n.jsxs("span",{className:"text-xs font-bold text-slate-400",children:["Bs. ",Nm(k.amountBs)]})})]},k.id)):n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"px-8 py-20 text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-2xl flex items-center justify-center mx-auto mb-4 text-slate-200",children:n.jsx(Xt,{size:32})}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"No se encontraron saldos a favor"})]})})})]})})]})]})]})},zFe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(!1),[o,d]=j.useState(null),u=async()=>{s(!0);try{const m=await we.getMonthlyCollectionHistory();r(m)}catch(m){console.error("Fetch Monthly Collection Error",m)}finally{s(!1)}};j.useEffect(()=>{u()},[]);const f=async()=>{l(!0);try{const m=await we.syncMonthlyCollection();m.success?u():alert(m.message||"Error al sincronizar")}catch(m){console.error("Sync Error",m),alert("Error de conexión al sincronizar")}finally{l(!1)}},p=async m=>{try{(await we.deleteMonthlyCollection(m)).success&&(r(v=>v.filter(y=>y.id!==m)),d(null))}catch(b){console.error("Delete Error",b)}},x=async()=>{if(navigator.share)try{await navigator.share({title:"Recaudación Mensual - SAC 2026",text:"Consulta el histórico de recaudación mensual del condominio.",url:window.location.href})}catch(m){console.log("Error sharing",m)}else alert("La función de compartir no está disponible en este navegador.")};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(ha,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Histórico de Gestión Financiera"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Recaudación ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Mensual"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Registro histórico comparativo entre lo facturado y lo efectivamente recaudado mes a mes."'})]}),n.jsxs("div",{className:"bg-white/5 backdrop-blur-xl p-8 rounded-[3rem] border border-white/10 flex flex-col items-center text-center min-w-[280px]",children:[n.jsx(xr,{size:48,className:"text-blue-400 mb-4"}),n.jsx("p",{className:"text-[10px] font-black text-blue-300 uppercase tracking-widest mb-1",children:"Transparencia Total"}),n.jsx("p",{className:"text-sm text-slate-300 font-medium leading-relaxed",children:"Visualización de eficiencia en la cobranza para la junta de condominio y propietarios."})]})]}),n.jsx(po,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"flex justify-end gap-4",children:[["admin","programmer"].includes(e.role)&&n.jsxs("button",{onClick:f,disabled:i,className:"px-6 py-4 bg-blue-600 text-white rounded-2xl hover:bg-blue-700 transition-all border border-blue-500 shadow-lg flex items-center gap-3 font-black text-[10px] uppercase tracking-widest disabled:opacity-50",children:[n.jsx(sa,{size:18,className:i?"animate-pulse":""}),i?"Sincronizando...":"Sincronizar Histórico"]}),n.jsx("button",{onClick:u,className:"p-4 bg-white rounded-2xl text-slate-400 hover:text-blue-600 transition-all border border-slate-200 shadow-sm",children:n.jsx(ot,{size:20,className:a?"animate-spin":""})})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Mes / Año"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Facturado ($)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Recaudado ($)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Eficiencia"}),["admin","programmer"].includes(e.role)&&n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsx("td",{colSpan:4,className:"py-32 text-center",children:n.jsx(ot,{className:"animate-spin text-blue-600 mx-auto",size:40})})}):t.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"py-32 text-center",children:[n.jsx(Lr,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-300 font-black uppercase tracking-widest text-xs italic",children:"No hay registros históricos de recaudación aún"})]})}):t.map((m,b)=>{const v=m.amountBilled>0?m.amountCollected/m.amountBilled*100:0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400 group-hover:bg-blue-50 group-hover:text-blue-600 transition-colors",children:n.jsx(Lr,{size:18})}),n.jsxs("span",{className:"font-black text-slate-900 text-lg uppercase",children:[Ue[m.month]," ",m.year]})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:"text-xl font-black tracking-tighter text-slate-700",children:["$ ",Number(m.amountBilled).toLocaleString("en-US",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:"text-xl font-black tracking-tighter text-emerald-600",children:["$ ",Number(m.amountCollected).toLocaleString("en-US",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-1",children:[n.jsxs("span",{className:`px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest border ${v>=90?"bg-emerald-50 text-emerald-600 border-emerald-100":v>=70?"bg-blue-50 text-blue-600 border-blue-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:[v.toFixed(1),"%"]}),n.jsx("div",{className:"w-24 h-1 bg-slate-100 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full transition-all duration-1000 ${v>=90?"bg-emerald-500":v>=70?"bg-blue-500":"bg-amber-500"}`,style:{width:`${Math.min(v,100)}%`}})})]})}),["admin","programmer"].includes(e.role)&&n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("button",{onClick:()=>d(m.id),className:"p-3 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded-xl transition-all",title:"Eliminar registro",children:n.jsx(Ta,{size:18})})})]},b)})})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-white rounded-2xl shadow-sm border border-slate-200",children:n.jsx(ha,{className:"text-blue-500",size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:"Reporte de Recaudación Mensual"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase tracking-widest",children:Ps})]})]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[n.jsxs("button",{onClick:()=>{const m=["Mes / Año","Monto Facturado ($)","Monto Recaudado ($)","Eficiencia (%)"],b=t.map(v=>[`${Ue[v.month]} ${v.year}`,`$ ${Number(v.amountBilled).toLocaleString("en-US",{minimumFractionDigits:2})}`,`$ ${Number(v.amountCollected).toLocaleString("en-US",{minimumFractionDigits:2})}`,`${(v.amountCollected/v.amountBilled*100).toFixed(1)}%`]);zc("Recaudación Mensual Histórica",m,b)},className:"px-8 py-3 bg-blue-600 text-white hover:bg-blue-700 transition-all border border-blue-500 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(gr,{size:16})," Exportar HTML"]}),n.jsxs("button",{onClick:x,className:"px-8 py-3 bg-white hover:bg-slate-100 text-slate-600 transition-all border border-slate-200 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(_a,{size:16})," Compartir"]}),n.jsxs("button",{onClick:()=>window.print(),className:"px-8 py-3 bg-white hover:bg-slate-900 hover:text-white transition-all border border-slate-200 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(yt,{size:16})," Imprimir"]})]})]})]}),o!==null&&n.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-6 backdrop-blur-md bg-slate-900/40 animate-in fade-in duration-300",children:n.jsx("div",{className:"bg-white rounded-[3rem] w-full max-w-md p-10 shadow-2xl border border-slate-100 animate-in zoom-in-95 duration-300",children:n.jsxs("div",{className:"flex flex-col items-center text-center",children:[n.jsx("div",{className:"w-20 h-20 bg-red-50 rounded-full flex items-center justify-center text-red-600 mb-6",children:n.jsx(na,{size:40})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tighter mb-2",children:"¿Eliminar Registro?"}),n.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed mb-8",children:"Esta acción eliminará el histórico de este mes. Podrás volver a generarlo usando el botón de sincronización."}),n.jsxs("div",{className:"flex w-full gap-4",children:[n.jsx("button",{onClick:()=>d(null),className:"flex-1 py-4 bg-slate-100 text-slate-600 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all",children:"Cancelar"}),n.jsx("button",{onClick:()=>p(o),className:"flex-1 py-4 bg-red-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-red-700 transition-all shadow-lg shadow-red-200",children:"Eliminar"})]})]})})})]})},ff=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},lN=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},$Fe=({user:e})=>{const{properties:t,residents:r,latestRate:a,fees:s}=ht(),[i,l]=j.useState([]),[o,d]=j.useState(!0),[u,f]=j.useState(!1),[p,x]=j.useState(null),[m,b]=j.useState(!1),v=async te=>{if(!(!te||te==="S/R"||te.length<3))try{const P=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${te}`,{credentials:"include"})).json();P.duplicate?x(P):x(null)}catch(O){console.error("Error checking duplicate",O)}},[y,k]=j.useState((e.role==="owner","list")),[_,C]=j.useState([]),[E,T]=j.useState({amountUsd:"",amountBs:"",paymentDate:new Date().toISOString().split("T")[0],reference:"",bankName:"",method:"Transferencia",observations:""}),[B,I]=j.useState(""),[M,U]=j.useState("Pendiente"),[D,L]=j.useState(null),[R,Q]=j.useState({status:"",observations:"",assignedTo:"",targetId:""}),G=["admin","programmer","board"].includes(e.role),K=async()=>{d(!0);try{const[te,O]=await Promise.all([we.getPaymentReports(e.role==="owner"?e.propertyId:void 0),we.getInitialDebtData()]);l(te),C(Array.isArray(O)?O:O.data||[])}catch(te){console.error("Error loading reports",te)}finally{d(!1)}};j.useEffect(()=>{K()},[e.propertyId,e.role]);const W=async te=>{if(te.preventDefault(),p&&!m)if(e.role==="owner"){alert("ATENCIÓN: Este número de transferencia ya existe en el sistema. Por favor, verifique nuevamente. Si el código es correcto y el problema persiste, debe enviar el pago directamente a la administración para su procesamiento manual.");return}else{alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}if(!e.propertyId)return;const O=t.find(q=>q.id===e.propertyId),P=r.find(q=>q.propertyId===e.propertyId&&q.isOwner);f(!0);try{const q={...E,propertyId:e.propertyId,propertyCode:(O==null?void 0:O.code)||"",ownerName:(P==null?void 0:P.fullName)||e.fullName,exchangeRate:a,amountUsd:Number(E.amountUsd)||Number(E.amountBs)/a,amountBs:Number(E.amountBs)||Number(E.amountUsd)*a};await we.savePaymentReport(q),alert("Reporte enviado exitosamente. Será revisado por la administración."),T({amountUsd:"",amountBs:"",paymentDate:new Date().toISOString().split("T")[0],reference:"",bankName:"",method:"Transferencia",observations:""}),k("list"),K()}catch{alert("Error al enviar el reporte.")}finally{f(!1)}},z=async()=>{if(D){f(!0);try{await we.updatePaymentReportStatus(D.id,R.status,R.observations,R.assignedTo,R.targetId),alert("Estatus actualizado."),L(null),K()}catch{alert("Error al actualizar.")}finally{f(!1)}}},Z=j.useMemo(()=>i.filter(te=>{const O=te.propertyCode.toLowerCase().includes(B.toLowerCase())||te.ownerName.toLowerCase().includes(B.toLowerCase()),P=M==="Todos"||te.status===M;return O&&P}),[i,B,M]),Y=j.useMemo(()=>{if(e.role!=="owner"||!e.propertyId)return null;let te=0;s.forEach(q=>{const H=q.debts.find(J=>J.propertyId===e.propertyId);H&&H.status!=="Pagado"&&(te+=Number(H.amountUsd)-Number(H.paidAmount||0))});const O=_.find(q=>q.id===e.propertyId),P=(O==null?void 0:O.current_debt)||0;return{totalFees:te,agreementDebt:P,total:te+P}},[e.propertyId,e.role,s,_]);return o?n.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-4",children:[n.jsx(Qt,{className:"animate-spin text-blue-600",size:40}),n.jsx("p",{className:"text-slate-400 font-black text-[10px] uppercase tracking-widest",children:"Cargando Reportes..."})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Reporte de ",n.jsx("span",{className:"text-blue-600",children:"Pago"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Almacén de información de pagos para revisión administrativa."})]}),e.role==="owner"&&y==="list"&&n.jsxs("button",{onClick:()=>k("form"),className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center gap-2",children:[n.jsx(Gi,{size:16})," Reportar Nuevo Pago"]}),e.role==="owner"&&y==="form"&&n.jsxs("button",{onClick:()=>k("list"),className:"bg-white border border-slate-200 text-slate-500 px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-sm hover:bg-slate-50 transition-all flex items-center gap-2",children:[n.jsx(Ba,{size:16})," Ver Mis Reportes"]})]}),e.role==="owner"&&y==="form"&&n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsx("div",{className:"lg:col-span-2",children:n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("form",{onSubmit:W,className:"space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Monto en Divisa ($)"}),n.jsxs("div",{className:"relative",children:[n.jsx(wn,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"number",step:"0.01",required:!0,placeholder:"0.00",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.amountUsd,onChange:te=>{const O=te.target.value;T({...E,amountUsd:O,amountBs:O?(Number(O)*a).toFixed(2):""})}})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Monto en Bolívares (Bs)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 font-bold text-xs",children:"Bs"}),n.jsx("input",{type:"number",step:"0.01",required:!0,placeholder:"0.00",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.amountBs,onChange:te=>{const O=te.target.value;T({...E,amountBs:O,amountUsd:O?(Number(O)/a).toFixed(2):""})}})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Fecha del Pago"}),n.jsxs("div",{className:"relative",children:[n.jsx(Lr,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"date",required:!0,className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.paymentDate,onChange:te=>T({...E,paymentDate:te.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Referencia / Comprobante"}),n.jsxs("div",{className:"relative",children:[n.jsx(aa,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",required:!0,placeholder:"Últimos 4-6 dígitos",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.reference,onChange:te=>{const O=te.target.value;T({...E,reference:O}),O.length>=3&&v(O)}})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Banco Emisor"}),n.jsxs("div",{className:"relative",children:[n.jsx(xr,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",required:!0,placeholder:"Ej: Banesco, Mercantil...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.bankName,onChange:te=>T({...E,bankName:te.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Método de Pago"}),n.jsxs("div",{className:"relative",children:[n.jsx(_p,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none",value:E.method,onChange:te=>T({...E,method:te.target.value}),children:[n.jsx("option",{value:"Transferencia",children:"Transferencia"}),n.jsx("option",{value:"Pago Móvil",children:"Pago Móvil"}),n.jsx("option",{value:"Zelle",children:"Zelle"}),n.jsx("option",{value:"Efectivo",children:"Efectivo"}),n.jsx("option",{value:"Depósito",children:"Depósito"})]})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Observaciones Adicionales"}),n.jsx("textarea",{rows:3,placeholder:"Indique cualquier detalle relevante...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-medium text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all resize-none",value:E.observations,onChange:te=>T({...E,observations:te.target.value})})]}),p&&n.jsx("div",{className:"p-6 bg-red-50 border-2 border-red-200 rounded-[2rem] animate-in slide-in-from-top duration-500",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx(Cr,{className:"text-red-600 shrink-0 mt-1",size:24}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-red-900 font-black text-sm uppercase tracking-tight",children:"¡ALERTA: REFERENCIA DUPLICADA!"}),n.jsx("p",{className:"text-red-700 text-[11px] font-bold mt-1 leading-relaxed",children:e.role==="owner"?"Este número de transferencia ya ha sido utilizado en el sistema. Por favor, verifique su comprobante. Si está seguro de que es correcto, contacte a la administración.":"Este código ya existe en los registros del sistema SAC 2026."}),e.role!=="owner"&&p.matches&&n.jsxs("div",{className:"mt-3 space-y-2",children:[n.jsx("p",{className:"text-[10px] font-black text-red-900 uppercase tracking-widest underline",children:"Rastro Encontrado:"}),p.matches.map((te,O)=>n.jsxs("div",{className:"bg-white/50 p-2 rounded-lg border border-red-100 text-[10px] font-mono",children:[n.jsxs("span",{className:"font-black text-red-600",children:["[",te.source,"]"]})," ",te.detail," - ",te.date]},O)),n.jsxs("div",{className:"mt-4 flex items-center gap-3 bg-red-600 text-white p-3 rounded-xl shadow-lg",children:[n.jsx("input",{type:"checkbox",id:"auth_dup",className:"w-5 h-5 accent-white cursor-pointer",checked:m,onChange:te=>b(te.target.checked)}),n.jsx("label",{htmlFor:"auth_dup",className:"text-[9px] font-black uppercase tracking-widest cursor-pointer",children:"AUTORIZAR CARGA DE REFERENCIA DUPLICADA"})]})]})]})]})}),n.jsxs("button",{disabled:u,type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[u?n.jsx(Qt,{className:"animate-spin",size:20}):n.jsx(Gi,{size:20}),"ENVIAR REPORTE A ADMINISTRACIÓN"]})]})})}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-8 text-white shadow-xl",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-4",children:"Estado de Cuenta"}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Cuotas Pendientes"}),n.jsxs("h3",{className:"text-2xl font-black tracking-tighter text-white",children:["$ ",ff((Y==null?void 0:Y.totalFees)||0)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Convenio de Pago"}),n.jsxs("h3",{className:"text-2xl font-black tracking-tighter text-white",children:["$ ",ff((Y==null?void 0:Y.agreementDebt)||0)]})]}),n.jsxs("div",{className:"pt-6 border-t border-white/10",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Total Pendiente"}),n.jsxs("h3",{className:"text-4xl font-black tracking-tighter text-white",children:["$ ",ff((Y==null?void 0:Y.total)||0)]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-2",children:["Bs. ",lN(((Y==null?void 0:Y.total)||0)*a)]})]})]}),n.jsxs("div",{className:"mt-8 p-4 bg-white/5 rounded-2xl border border-white/10 flex items-start gap-3",children:[n.jsx(Nn,{size:16,className:"text-blue-400 shrink-0 mt-0.5"}),n.jsx("p",{className:"text-[9px] font-medium text-slate-300 leading-relaxed",children:"Este reporte no se aplica automáticamente. La administración debe verificarlo y asignarlo a su cuenta."})]})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 p-8 shadow-sm",children:[n.jsxs("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(Cr,{size:14,className:"text-blue-600"})," Recordatorio"]}),n.jsxs("ul",{className:"space-y-4",children:[n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full mt-1.5 shrink-0"}),n.jsx("p",{className:"text-xs font-bold text-slate-600 leading-relaxed",children:"Use la tasa del día indicada en el sistema."})]}),n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full mt-1.5 shrink-0"}),n.jsx("p",{className:"text-xs font-bold text-slate-600 leading-relaxed",children:"Indique el número de referencia exacto."})]}),n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full mt-1.5 shrink-0"}),n.jsx("p",{className:"text-xs font-bold text-slate-600 leading-relaxed",children:"Conserve su comprobante físico o digital."})]})]})]})]})]}),y==="list"&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col md:flex-row gap-4 bg-white p-4 rounded-[2rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex-1 relative",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por propiedad o nombre...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-12 pr-4 py-3 text-sm font-bold text-slate-700 outline-none focus:ring-2 focus:ring-blue-500/20 transition-all",value:B,onChange:te=>I(te.target.value)})]}),n.jsx("div",{className:"flex gap-2",children:["Todos","Pendiente","Asignado","Rechazado"].map(te=>n.jsx("button",{onClick:()=>U(te),className:`px-6 py-3 rounded-xl font-black text-[9px] uppercase tracking-widest transition-all ${M===te?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:te},te))})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Propiedad"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Fecha / Ref"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest text-right",children:"Monto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest text-center",children:"Estatus"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:Z.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"px-8 py-20 text-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4 opacity-20",children:[n.jsx(aa,{size:64}),n.jsx("p",{className:"font-black text-xs uppercase tracking-widest",children:"No se encontraron reportes"})]})})}):Z.map(te=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-50 text-blue-600 rounded-xl flex items-center justify-center font-black text-xs",children:te.propertyCode}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:te.ownerName}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[te.bankName," • ",te.method]})]})]})}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-black text-slate-700",children:te.paymentDate}),n.jsxs("p",{className:"text-[10px] font-bold text-blue-600 uppercase tracking-widest",children:["REF: ",te.reference]})]}),n.jsxs("td",{className:"px-8 py-6 text-right",children:[n.jsxs("p",{className:"text-sm font-black text-slate-900",children:["$ ",ff(te.amountUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",lN(te.amountBs)]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("div",{className:"flex justify-center",children:n.jsxs("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest flex items-center gap-2 ${te.status==="Asignado"?"bg-emerald-50 text-emerald-600":te.status==="Rechazado"?"bg-red-50 text-red-600":"bg-amber-50 text-amber-600"}`,children:[te.status==="Asignado"?n.jsx(zt,{size:12}):te.status==="Rechazado"?n.jsx(vM,{size:12}):n.jsx(Oc,{size:12}),te.status]})})}),n.jsx("td",{className:"px-8 py-6 text-right",children:G?n.jsx("button",{onClick:()=>{L(te),Q({status:te.status,observations:te.observations||"",assignedTo:te.assignedTo||"",targetId:te.targetId||""})},className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg hover:bg-blue-600 transition-all active:scale-95",children:n.jsx(VFe,{size:18})}):n.jsx("button",{onClick:()=>L(te),className:"p-3 bg-slate-100 text-slate-400 rounded-xl hover:bg-slate-200 transition-all",children:n.jsx(gr,{size:18})})})]},te.id))})]})})})]}),D&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-sm z-[200] flex items-center justify-center p-4 animate-in fade-in duration-300",children:n.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-[3rem] shadow-2xl overflow-hidden animate-in zoom-in duration-300",children:[n.jsxs("div",{className:"p-8 bg-slate-900 text-white flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center font-black text-lg",children:D.propertyCode}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black uppercase tracking-tighter",children:"Detalle de Reporte"}),n.jsxs("p",{className:"text-blue-400 text-[10px] font-black uppercase tracking-widest",children:["ID: #",D.id]})]})]}),n.jsx("button",{onClick:()=>L(null),className:"p-2 hover:bg-white/10 rounded-xl transition-all",children:n.jsx(GFe,{size:24})})]}),n.jsxs("div",{className:"p-10 space-y-8 max-h-[70vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:D.ownerName})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Fecha de Pago"}),n.jsx("p",{className:"text-sm font-black text-slate-900",children:D.paymentDate})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Referencia"}),n.jsx("p",{className:"text-sm font-black text-blue-600 uppercase",children:D.reference})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Monto Reportado"}),n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",ff(D.amountUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",lN(D.amountBs)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Banco / Método"}),n.jsxs("p",{className:"text-sm font-black text-slate-700 uppercase",children:[D.bankName," • ",D.method]})]})]})]}),D.observations&&n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2 flex items-center gap-2",children:[n.jsx(Nn,{size:14})," Observaciones del Propietario"]}),n.jsxs("p",{className:"text-sm font-medium text-slate-600 italic",children:['"',D.observations,'"']})]}),G&&n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Ea,{size:16})," Acciones Administrativas"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Cambiar Estatus"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl p-4 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:R.status,onChange:te=>Q({...R,status:te.target.value}),children:[n.jsx("option",{value:"Pendiente",children:"Pendiente"}),n.jsx("option",{value:"Asignado",children:"Asignado (Ya usado)"}),n.jsx("option",{value:"Rechazado",children:"Rechazado"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Asignado a (Opcional)"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl p-4 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:R.assignedTo,onChange:te=>Q({...R,assignedTo:te.target.value}),children:[n.jsx("option",{value:"",children:"No Asignado"}),n.jsx("option",{value:"Cuota",children:"Cuota Mensual"}),n.jsx("option",{value:"Convenio",children:"Convenio de Pago"}),n.jsx("option",{value:"Otro",children:"Otro"})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Nota Administrativa / Motivo Rechazo"}),n.jsx("textarea",{rows:2,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl p-4 text-sm font-medium text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all resize-none",value:R.observations,onChange:te=>Q({...R,observations:te.target.value})})]}),n.jsxs("button",{disabled:u,onClick:z,className:"w-full bg-slate-900 hover:bg-blue-600 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[u?n.jsx(Qt,{className:"animate-spin",size:16}):n.jsx(zt,{size:16}),"GUARDAR CAMBIOS ADMINISTRATIVOS"]})]}),!G&&D.status!=="Pendiente"&&n.jsxs("div",{className:`p-6 rounded-3xl border ${D.status==="Asignado"?"bg-emerald-50 border-emerald-100 text-emerald-700":"bg-red-50 border-red-100 text-red-700"}`,children:[n.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest mb-2 flex items-center gap-2",children:[n.jsx(Cr,{size:14})," Respuesta Administrativa"]}),n.jsx("p",{className:"text-sm font-bold",children:D.observations||"Sin observaciones adicionales."})]})]})]})})]})},VFe=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M20 7h-9"}),n.jsx("path",{d:"M14 17H5"}),n.jsx("circle",{cx:"17",cy:"17",r:"3"}),n.jsx("circle",{cx:"7",cy:"7",r:"3"})]}),GFe=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]}),KFe=()=>{const[e,t]=j.useState(!1),[r,a]=j.useState([]),[s,i]=j.useState(""),[l,o]=j.useState(new Date().getMonth()+1),[d,u]=j.useState(new Date().getFullYear()),f=async()=>{t(!0);try{const y=await we.getDebtList(l,d);a(Array.isArray(y)?y:[])}catch(y){console.error("Error fetching debt list:",y)}finally{t(!1)}};j.useEffect(()=>{f()},[l,d]);const p=r.filter(y=>y.propertyNumber.toLowerCase().includes(s.toLowerCase())||y.ownerName.toLowerCase().includes(s.toLowerCase())),x=p.reduce((y,k)=>y+k.totalDebt,0),m=()=>{window.print()},b=()=>{const y=`*LISTADO DE DEUDORES - ${Ra}*
Corte: ${Ue[l-1]} ${d}

`+p.map(_=>`Prop: ${_.propertyNumber} - ${_.ownerName}
Deuda Mes: $${_.currentDebt.toFixed(2)}
Convenio/Anterior: $${_.agreementDebt.toFixed(2)}
*Total: $${_.totalDebt.toFixed(2)}*`).join(`

`)+`

*Total General: $${x.toFixed(2)}*`,k=`https://wa.me/?text=${encodeURIComponent(y)}`;window.open(k,"_blank")},v=()=>{const y=`
            <!DOCTYPE html>
            <html>
            <head>
                <title>Listado de Deudores - ${Ra}</title>
                <style>
                    body { font-family: sans-serif; padding: 20px; color: #333; }
                    h1 { color: #1e293b; text-align: center; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-weight: bold; }
                    .total { font-weight: bold; background-color: #f1f5f9; }
                    .footer { margin-top: 30px; font-size: 12px; color: #64748b; text-align: center; }
                </style>
            </head>
            <body>
                <h1>Listado de Propiedades con Deuda</h1>
                <p><strong>Condominio:</strong> ${Ra}</p>
                <p><strong>Corte:</strong> ${Ue[l-1]} ${d}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Propiedad</th>
                            <th>Propietario</th>
                            <th>Deuda ($)</th>
                            <th>WhatsApp</th>
                            <th>Correo</th>
                        </tr>
                    </thead>
                    <tbody>
                        ${p.map(E=>`
                            <tr>
                                <td>${E.propertyNumber}</td>
                                <td>${E.ownerName}</td>
                                <td>
                                    $${E.totalDebt.toFixed(2)}<br/>
                                    <small style="color: #64748b">Mes: $${E.currentDebt.toFixed(2)}</small><br/>
                                    <small style="color: #2563eb">Conv: $${E.agreementDebt.toFixed(2)}</small>
                                </td>
                                <td>${E.whatsapp}</td>
                                <td>${E.email}</td>
                            </tr>
                        `).join("")}
                    </tbody>
                    <tfoot>
                        <tr class="total">
                            <td colspan="2">TOTAL GENERAL</td>
                            <td colspan="3">$${x.toFixed(2)}</td>
                        </tr>
                    </tfoot>
                </table>
                <div class="footer">
                    Generado por SAC 2026 - ${Ps}
                </div>
            </body>
            </html>
        `,k=new Blob([y],{type:"text/html"}),_=URL.createObjectURL(k),C=document.createElement("a");C.href=_,C.download=`Deudores_${Ue[l-1]}_${d}.html`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(_)};return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20 no-print",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl border border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-red-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-lg shadow-red-200",children:n.jsx(gr,{size:32})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tighter",children:["Listado de ",n.jsx("span",{className:"text-red-600 italic",children:"Deudores"})]}),n.jsxs("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:["Corte: ",Ue[l-1]," ",d]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[n.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-6 py-3 bg-slate-900 text-white rounded-2xl font-bold text-xs uppercase tracking-widest hover:bg-slate-800 transition-all shadow-lg",children:[n.jsx(yt,{size:16})," Imprimir"]}),n.jsxs("button",{onClick:b,className:"flex items-center gap-2 px-6 py-3 bg-emerald-600 text-white rounded-2xl font-bold text-xs uppercase tracking-widest hover:bg-emerald-700 transition-all shadow-lg",children:[n.jsx(_a,{size:16})," Compartir"]}),n.jsxs("button",{onClick:v,className:"flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-2xl font-bold text-xs uppercase tracking-widest hover:bg-blue-700 transition-all shadow-lg",children:[n.jsx(Yi,{size:16})," Exportar HTML"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center gap-4",children:[n.jsx(Xt,{className:"text-slate-400",size:20}),n.jsx("input",{type:"text",placeholder:"Buscar por propiedad o propietario...",className:"w-full bg-transparent border-none focus:ring-0 font-medium text-slate-600",value:s,onChange:y=>i(y.target.value)})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Lr,{className:"text-slate-400",size:20}),n.jsx("select",{value:l,onChange:y=>o(parseInt(y.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm uppercase",children:Ue.map((y,k)=>n.jsx("option",{value:k+1,children:y},k))}),n.jsx("select",{value:d,onChange:y=>u(parseInt(y.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm",children:[2024,2025,2026].map(y=>n.jsx("option",{value:y,children:y},y))})]}),n.jsx("button",{onClick:f,className:`p-3 rounded-xl transition-all ${e?"bg-slate-100 text-slate-400":"bg-red-50 text-red-600 hover:bg-red-100"}`,disabled:e,children:n.jsx(ot,{size:18,className:e?"animate-spin":""})})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] shadow-2xl border border-slate-100 overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propiedad"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propietario"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Deuda Acumulada"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Contacto WhatsApp"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Correo Electrónico"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:e?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(ot,{className:"animate-spin mx-auto mb-4 text-slate-300",size:40}),n.jsx("p",{className:"text-slate-400 font-black uppercase tracking-widest text-[10px]",children:"Sincronizando con el Kernel..."})]})}):p.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(Cr,{className:"mx-auto mb-4 text-slate-200",size:48}),n.jsx("p",{className:"text-slate-400 font-bold",children:"No se encontraron deudas para el periodo seleccionado."})]})}):p.map((y,k)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-500 font-bold text-xs group-hover:bg-red-600 group-hover:text-white transition-all",children:y.propertyNumber}),n.jsx("span",{className:"font-black text-slate-900 tracking-tight uppercase",children:y.propertyCode})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-50 rounded-full flex items-center justify-center text-blue-600",children:n.jsx(eu,{size:14})}),n.jsx("span",{className:"font-bold text-slate-700",children:y.ownerName})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wn,{size:16,className:"text-red-600"}),n.jsx("span",{className:"text-xl font-black text-red-600 tracking-tighter",children:y.totalDebt.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})})]}),n.jsxs("div",{className:"flex flex-col mt-1 pl-6",children:[n.jsxs("span",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:["Mes Actual: $",y.currentDebt.toFixed(2)]}),y.agreementDebt>0&&n.jsxs("span",{className:"text-[9px] font-black text-blue-600 uppercase tracking-widest",children:["Convenio/Anterior: $",y.agreementDebt.toFixed(2)]})]})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-emerald-50 rounded-full flex items-center justify-center text-emerald-600",children:n.jsx(ik,{size:14})}),n.jsx("span",{className:"font-mono text-xs font-bold text-slate-500",children:y.whatsapp})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-indigo-50 rounded-full flex items-center justify-center text-indigo-600",children:n.jsx(Qr,{size:14})}),n.jsx("span",{className:"text-xs font-medium text-slate-500",children:y.email})]})})]},k))}),!e&&p.length>0&&n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:2,className:"p-8 font-black uppercase tracking-widest text-xs text-right",children:"Total General Adeudado:"}),n.jsx("td",{colSpan:3,className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wn,{size:20,className:"text-emerald-400"}),n.jsx("span",{className:"text-3xl font-black text-emerald-400 tracking-tighter",children:x.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})})]})})]})})]})})}),n.jsxs("div",{className:"hidden print:block bg-white p-10",children:[n.jsxs("div",{className:"text-center mb-10 border-b-4 border-slate-900 pb-8",children:[n.jsx("h1",{className:"text-4xl font-black uppercase tracking-tighter",children:Ra}),n.jsx("h2",{className:"text-2xl font-bold text-slate-600 uppercase tracking-widest mt-2",children:"Listado de Propiedades con Deuda"}),n.jsxs("p",{className:"text-slate-400 font-bold mt-4",children:["CORTE: ",Ue[l-1]," ",d]})]}),n.jsxs("table",{className:"w-full border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-100",children:[n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Propiedad"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Propietario"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Deuda ($)"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"WhatsApp"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Correo"})]})}),n.jsx("tbody",{children:p.map((y,k)=>n.jsxs("tr",{children:[n.jsxs("td",{className:"border p-4 text-sm font-bold",children:[y.propertyNumber," (",y.propertyCode,")"]}),n.jsx("td",{className:"border p-4 text-sm",children:y.ownerName}),n.jsxs("td",{className:"border p-4 text-sm",children:[n.jsxs("div",{className:"font-black text-red-600",children:["$",y.totalDebt.toFixed(2)]}),n.jsxs("div",{className:"text-[8px] text-slate-400 uppercase",children:["Mes: $",y.currentDebt.toFixed(2)]}),n.jsxs("div",{className:"text-[8px] text-blue-600 uppercase font-bold",children:["Conv: $",y.agreementDebt.toFixed(2)]})]}),n.jsx("td",{className:"border p-4 text-xs font-mono",children:y.whatsapp}),n.jsx("td",{className:"border p-4 text-xs",children:y.email})]},k))}),n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-50 font-black",children:[n.jsx("td",{colspan:"2",className:"border p-4 text-right uppercase",children:"Total General:"}),n.jsxs("td",{colspan:"3",className:"border p-4 text-xl",children:["$ ",x.toFixed(2)]})]})})]}),n.jsxs("div",{className:"mt-20 flex justify-between items-end border-t border-slate-200 pt-8",children:[n.jsxs("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest",children:["Generado por SAC 2026 - ",Ps]}),n.jsxs("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest",children:["Fecha de Impresión: ",new Date().toLocaleString()]})]})]})]})},qFe=()=>{const[e,t]=j.useState(!1),[r,a]=j.useState([]),[s,i]=j.useState(""),[l,o]=j.useState(new Date().getMonth()+1),[d,u]=j.useState(new Date().getFullYear()),f=j.useRef(null),p=async()=>{t(!0);try{const T=await we.getSolventList(l,d);a(Array.isArray(T)?T:[])}catch(T){console.error("Error fetching solvent list:",T)}finally{t(!1)}};j.useEffect(()=>{p()},[l,d]);const x=r.filter(T=>T.propertyNumber.toLowerCase().includes(s.toLowerCase())||T.ownerName.toLowerCase().includes(s.toLowerCase())),m=()=>{window.print()},b=async()=>{if(f.current){t(!0);try{const B=(await Hs(f.current,{backgroundColor:"#ffffff",scale:2,logging:!1,useCORS:!0})).toDataURL("image/png"),I=document.createElement("a");I.href=B,I.download=`Solventes_${Ue[l-1]}_${d}.png`,I.click()}catch(T){console.error("Capture failed:",T)}finally{t(!1)}}},v=()=>`*LISTADO DE SOLVENTES - ${Ra}*
Periodo: ${Ue[l-1]} ${d}

`+x.map(T=>`✅ Prop: ${T.propertyNumber} - ${T.ownerName}`).join(`
`)+`

*Total Solventes: ${x.length}*`,y=()=>{const T=`https://wa.me/?text=${encodeURIComponent(v())}`;window.open(T,"_blank")},k=()=>{const T=encodeURIComponent(`Listado de Solventes - ${Ra}`),B=encodeURIComponent(v());window.open(`mailto:?subject=${T}&body=${B}`)},_=()=>{navigator.clipboard.writeText(v()),alert("Formato copiado al portapapeles")},C=async()=>{if(navigator.share)try{await navigator.share({title:`Solventes ${Ra}`,text:v()})}catch{console.log("Share cancelled")}else _()},E=()=>{const T=`
            <!DOCTYPE html>
            <html>
            <head>
                <title>Listado de Solventes - ${Ra}</title>
                <style>
                    body { font-family: sans-serif; padding: 20px; color: #333; }
                    h1 { color: #1e293b; text-align: center; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-weight: bold; }
                    .solvent { color: #059669; font-weight: bold; }
                    .footer { margin-top: 30px; font-size: 12px; color: #64748b; text-align: center; }
                </style>
            </head>
            <body>
                <h1>Listado de Propiedades Solventes</h1>
                <p><strong>Condominio:</strong> ${Ra}</p>
                <p><strong>Periodo:</strong> ${Ue[l-1]} ${d}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Propiedad</th>
                            <th>Propietario</th>
                            <th>Estatus</th>
                            <th>WhatsApp</th>
                            <th>Correo</th>
                        </tr>
                    </thead>
                    <tbody>
                        ${x.map(U=>`
                            <tr>
                                <td>${U.propertyNumber}</td>
                                <td>${U.ownerName}</td>
                                <td class="solvent">SOLVENTE</td>
                                <td>${U.whatsapp}</td>
                                <td>${U.email}</td>
                            </tr>
                        `).join("")}
                    </tbody>
                </table>
                <p><strong>Total Solventes:</strong> ${x.length}</p>
                <div class="footer">
                    Generado por SAC 2026 - ${Ps}
                </div>
            </body>
            </html>
        `,B=new Blob([T],{type:"text/html"}),I=URL.createObjectURL(B),M=document.createElement("a");M.href=I,M.download=`Solventes_${Ue[l-1]}_${d}.html`,document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(I)};return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20 no-print",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl border border-slate-100 flex flex-col xl:flex-row xl:items-center justify-between gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-lg shadow-emerald-200",children:n.jsx(zt,{size:32})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tighter",children:["Listado de ",n.jsx("span",{className:"text-emerald-600 italic",children:"Solventes"})]}),n.jsxs("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:["Periodo: ",Ue[l-1]," ",d]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-4 py-2.5 bg-slate-900 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-slate-800 transition-all",children:[n.jsx(yt,{size:14})," Imprimir"]}),n.jsxs("button",{onClick:b,className:"flex items-center gap-2 px-4 py-2.5 bg-indigo-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-indigo-700 transition-all",children:[n.jsx(Tp,{size:14})," Capturar"]}),n.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2.5 bg-blue-500 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-blue-600 transition-all",children:[n.jsx(_a,{size:14})," Compartir"]}),n.jsxs("button",{onClick:y,className:"flex items-center gap-2 px-4 py-2.5 bg-emerald-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-emerald-700 transition-all",children:[n.jsx(Gi,{size:14})," WhatsApp"]}),n.jsxs("button",{onClick:k,className:"flex items-center gap-2 px-4 py-2.5 bg-orange-500 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-orange-600 transition-all",children:[n.jsx(Qr,{size:14})," Email"]}),n.jsxs("button",{onClick:_,className:"flex items-center gap-2 px-4 py-2.5 bg-slate-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-slate-700 transition-all",children:[n.jsx(lb,{size:14})," Copiar"]}),n.jsxs("button",{onClick:E,className:"flex items-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-blue-700 transition-all",children:[n.jsx(ja,{size:14})," HTML"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center gap-4",children:[n.jsx(Xt,{className:"text-slate-400",size:20}),n.jsx("input",{type:"text",placeholder:"Buscar por propiedad o propietario...",className:"w-full bg-transparent border-none focus:ring-0 font-medium text-slate-600",value:s,onChange:T=>i(T.target.value)})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Lr,{className:"text-slate-400",size:20}),n.jsx("select",{value:l,onChange:T=>o(parseInt(T.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm uppercase",children:Ue.map((T,B)=>n.jsx("option",{value:B+1,children:T},B))}),n.jsx("select",{value:d,onChange:T=>u(parseInt(T.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm",children:[2024,2025,2026].map(T=>n.jsx("option",{value:T,children:T},T))})]}),n.jsx("button",{onClick:p,className:`p-3 rounded-xl transition-all ${e?"bg-slate-100 text-slate-400":"bg-emerald-50 text-emerald-600 hover:bg-emerald-100"}`,disabled:e,children:n.jsx(ot,{size:18,className:e?"animate-spin":""})})]})]}),n.jsxs("div",{ref:f,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-100 overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 hidden print:block",children:[n.jsx("h2",{className:"text-2xl font-black text-slate-900 uppercase tracking-tighter",children:Ra}),n.jsxs("p",{className:"text-slate-500 font-bold text-xs uppercase tracking-widest",children:["Listado de Solventes - ",Ue[l-1]," ",d]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propiedad"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propietario"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Estatus"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Contacto WhatsApp"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Correo Electrónico"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:e?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(ot,{className:"animate-spin mx-auto mb-4 text-slate-300",size:40}),n.jsx("p",{className:"text-slate-400 font-black uppercase tracking-widest text-[10px]",children:"Sincronizando con el Kernel..."})]})}):x.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(zt,{className:"mx-auto mb-4 text-slate-200",size:48}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"No se encontraron registros solventes."})]})}):x.map((T,B)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-500 font-bold text-xs group-hover:bg-emerald-600 group-hover:text-white transition-all",children:T.propertyNumber}),n.jsx("span",{className:"font-black text-slate-900 tracking-tight uppercase",children:T.propertyCode})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-50 rounded-full flex items-center justify-center text-blue-600",children:n.jsx(eu,{size:14})}),n.jsx("span",{className:"font-bold text-slate-700",children:T.ownerName})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-2 text-emerald-600",children:[n.jsx(zt,{size:16}),n.jsx("span",{className:"font-black text-xs uppercase tracking-widest",children:"Solvente"})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-emerald-50 rounded-full flex items-center justify-center text-emerald-600",children:n.jsx(ik,{size:14})}),n.jsx("span",{className:"font-mono text-xs font-bold text-slate-500",children:T.whatsapp})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-indigo-50 rounded-full flex items-center justify-center text-indigo-600",children:n.jsx(Qr,{size:14})}),n.jsx("span",{className:"text-xs font-medium text-slate-500",children:T.email})]})})]},B))}),!e&&x.length>0&&n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:2,className:"p-8 font-black uppercase tracking-widest text-xs text-right",children:"Total Propiedades Solventes:"}),n.jsx("td",{colSpan:3,className:"p-8",children:n.jsx("span",{className:"text-3xl font-black text-emerald-400 tracking-tighter",children:x.length})})]})})]})}),n.jsxs("div",{className:"p-8 bg-slate-50 border-t border-slate-100 hidden print:flex justify-between items-center",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:["Generado por SAC 2026 - ",Ps]}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:new Date().toLocaleString()})]})]})]})},pf=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},WFe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,latestRate:i}=ht(),[l,o]=j.useState(new Date().getMonth()),[d,u]=j.useState(new Date().getFullYear()),[f,p]=j.useState(null),[x,m]=j.useState("selection"),[b,v]=j.useState(!1),[y,k]=j.useState(null),[_,C]=j.useState(null),E=j.useRef(null);j.useEffect(()=>{(async()=>{try{const Z=await we.getSystemSettings();C(Z)}catch(Z){console.error("Error fetching settings",Z)}})()},[]),j.useEffect(()=>{e.role==="owner"&&e.propertyId&&p(e.propertyId)},[e]);const T=j.useMemo(()=>t.find(z=>z.month===l&&z.year===d),[t,l,d]),B=j.useMemo(()=>r.find(z=>z.id===f),[r,f]),I=j.useMemo(()=>{if(!B)return null;const z=a.find(Y=>Y.propertyId===B.id&&Y.isOwner),Z=s.find(Y=>Y.cedula===(z==null?void 0:z.cedula));return{fullName:(z==null?void 0:z.fullName)||"Propietario",email:(Z==null?void 0:Z.email)||"",phone:(z==null?void 0:z.phone)||(Z==null?void 0:Z.phone)||"",telegramId:(Z==null?void 0:Z.telegramChatId)||"",propertyCode:B.code}},[B,a,s]),M=j.useMemo(()=>!T||!f?null:T.debts.find(z=>z.propertyId===f),[T,f]),U=j.useMemo(()=>M?Number(M.paidAmount)>=Number(M.amountUsd):!1,[M]),D=()=>{window.print()},L=async()=>{if(E.current){v(!0);try{const Z=(await Hs(E.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),Y=document.createElement("a");Y.href=Z,Y.download=`Recibo_Pago_${B==null?void 0:B.code}_${Ue[l]}.png`,Y.click()}catch{alert("Error al capturar imagen.")}finally{v(!1)}}},R=async()=>{if(E.current){v(!0);try{const z=await Hs(E.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),Z=await new Promise(O=>z.toBlob(O,"image/png"));if(!Z)throw new Error("Blob creation failed");const Y=`Recibo_Pago_${B==null?void 0:B.code}_${Ue[l]}.png`,te=new File([Z],Y,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[te]}))await navigator.share({files:[te],title:`Recibo de Pago - ${B==null?void 0:B.code}`,text:`Recibo de Pago de ${Ue[l]} ${d} para la unidad ${B==null?void 0:B.code}`});else{const O=z.toDataURL("image/png"),P=document.createElement("a");P.href=O,P.download=Y,P.click(),alert("La función de compartir archivos no es compatible. La imagen se ha descargado.")}}catch{alert("Error al compartir imagen.")}finally{v(!1)}}},Q=z=>{if(!z)return"";let Z=z.trim();return Z.startsWith("+")?Z.replace(/\D/g,""):Z.startsWith("0")?"58"+Z.substring(1).replace(/\D/g,""):Z.length===10?"58"+Z.replace(/\D/g,""):Z.replace(/\D/g,"")},G=()=>!I||!B||!M?"":`📄 *RECIBO DE PAGO - SAC 2026*

Unidad: *${B.code}*
Propietario: *${I.fullName}*
------------------------------------------
📅 *Periodo:* ${Ue[l]} ${d}
💰 *Monto Pagado:* $${pf(M.paidAmount||0)}
------------------------------------------
✨ *ESTATUS: PAGADO / SOLVENTE*
------------------------------------------
Fecha: ${new Date().toLocaleDateString()}

🔗 *Portal:* ${la}`,K=async z=>{if(!I||!B||!M)return;const Z=G();if(z==="whatsapp"){const Y=Q(I.phone);if(!Y)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${Y}?text=${encodeURIComponent(Z)}`,"_blank");return}if(z==="share"){if(navigator.share)try{await navigator.share({title:`Recibo de Pago - ${B.code}`,text:Z.replace(/\*/g,""),url:la})}catch{}else alert("Compartir no disponible.");return}k(z);try{const Y={channel:z,messageType:"receipt",monthName:Ue[l],year:d,recipients:[{name:I.fullName,email:I.email,telegramChatId:I.telegramId,propName:`${B.code}`,amount:pf(M.amountUsd),paid:pf(M.paidAmount||0),status:"Pagado",balance:"0.00"}]},O=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})).json();O.status==="success"?alert(`Enviado por ${z}.`):alert("Error: "+O.message)}catch{alert("Error de red.")}finally{k(null)}},W=()=>{const z=G();navigator.clipboard.writeText(z),alert("Copiado al portapapeles")};return x==="receipt"&&B&&I&&M?n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>m("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:D,className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:L,disabled:b,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:b?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Tp,{size:20})}),n.jsx("button",{onClick:R,disabled:b,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen",children:b?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(_a,{size:20})}),n.jsx("button",{onClick:()=>K("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"WhatsApp",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>K("telegram"),disabled:!I.telegramId||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${I.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:y==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>K("email"),disabled:!I.email||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${I.email?"bg-indigo-600":"bg-slate-200"}`,title:"Email",children:y==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>K("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(_a,{size:20})}),n.jsx("button",{onClick:W,className:"p-3 bg-slate-200 text-slate-600 rounded-xl shadow-lg active:scale-95 transition-all",title:"Copiar Formato",children:n.jsx(lb,{size:20})})]})]}),n.jsxs("div",{ref:E,className:"bg-white border border-slate-300 shadow-xl mx-auto print:shadow-none print:border-slate-400 print:w-full print:max-w-none print:m-0",style:{width:"100%",maxWidth:"21.59cm",minHeight:"27.94cm",padding:"2cm"},children:[n.jsxs("div",{className:"flex justify-between items-start border-b-2 border-slate-900 pb-6 mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-900 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx(ha,{size:32})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black tracking-tighter text-slate-900",children:["SAC ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.4em] text-slate-400",children:"Conjunto Residencial El Tejar"})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("h2",{className:"text-xl font-black uppercase tracking-widest text-slate-900",children:"Recibo de Pago"}),n.jsxs("p",{className:"text-xs font-bold text-slate-500 uppercase mt-1",children:["N° REC-",B.code,"-",d,l+1]}),n.jsx("p",{className:"text-[10px] font-black text-blue-600 uppercase mt-1",children:Ps})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-12 mb-10",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario / Unidad"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:I.fullName}),n.jsxs("p",{className:"text-sm font-bold text-slate-600 uppercase",children:[B.code," - ",B.type," ",B.number]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Periodo Cancelado"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[Ue[l]," ",d]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100 flex flex-col justify-center items-center",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2",children:"Monto Total Pagado"}),n.jsxs("p",{className:"text-4xl font-black text-slate-900",children:["$ ",pf(M.paidAmount||0)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-500 mt-2 uppercase",children:["Equivalente en Bs: ",pf((M.paidAmount||0)*i)]})]})]}),n.jsxs("div",{className:"bg-emerald-50 border-2 border-emerald-500/20 rounded-[2.5rem] p-10 mb-12 relative overflow-hidden",children:[n.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-5",children:n.jsx(zt,{size:150})}),n.jsxs("div",{className:"flex items-center gap-8",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-600 text-white rounded-3xl flex items-center justify-center shadow-lg shadow-emerald-200",children:n.jsx(Ea,{size:48})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-5xl font-black text-emerald-700 tracking-tighter uppercase mb-1",children:"Pagado"}),n.jsx("p",{className:"text-emerald-600 font-black uppercase tracking-[0.3em] text-xs",children:"Estatus: Solvente con el periodo"})]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-12 mt-24",children:[n.jsx("div",{className:"text-center space-y-2",children:n.jsxs("div",{className:"border-t-2 border-slate-900 pt-4",children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:(_==null?void 0:_.board_president)||"Presidente"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Presidente de la Junta"})]})}),n.jsx("div",{className:"text-center space-y-2",children:n.jsxs("div",{className:"border-t-2 border-slate-900 pt-4",children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:(_==null?void 0:_.board_secretary)||"Secretario(a)"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Secretario(a) de la Junta"})]})})]}),n.jsx("div",{className:"mt-20 flex justify-center",children:n.jsxs("div",{className:"w-48 h-48 border-4 border-blue-600/20 rounded-full flex flex-col items-center justify-center text-center p-4 rotate-[-15deg] transform",children:[n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase leading-tight",children:["Conj. Resid.",n.jsx("br",{}),"El Tejar"]}),n.jsx("div",{className:"w-full h-px bg-blue-600/20 my-2"}),n.jsx("p",{className:"text-[12px] font-black text-blue-700 uppercase tracking-widest",children:"Mes Solvente"}),n.jsx("p",{className:"text-[8px] font-bold text-blue-400 mt-1 uppercase tracking-tighter",children:"Certificación SAC 2026"})]})}),n.jsx("div",{className:"mt-auto pt-12 text-center border-t border-slate-100",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"Este documento es un comprobante digital generado por el sistema administrativo SAC 2026"})})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Recibo de ",n.jsx("span",{className:"text-blue-600",children:"Pago Cancelado"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Genere el recibo oficial de los meses solventes."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:l,onChange:z=>o(Number(z.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Ue.map((z,Z)=>n.jsx("option",{value:Z,children:z},Z))}),n.jsx("input",{type:"number",value:d,onChange:z=>u(Number(z.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(aa,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Selección de Propiedad"}),n.jsx("p",{className:"text-slate-500 font-medium",children:"Seleccione la unidad para generar su recibo de pago del mes."})]}),n.jsxs("div",{className:"space-y-4",children:[["admin","programmer","board"].includes(e.role)?n.jsxs("div",{className:"relative group",children:[n.jsx(Xt,{className:"absolute left-6 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-blue-600 transition-colors",size:20}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] pl-16 pr-8 py-6 font-black text-slate-900 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",value:f||"",onChange:z=>p(Number(z.target.value)),children:[n.jsx("option",{value:"",children:"Seleccione una propiedad..."}),r.sort((z,Z)=>z.code.localeCompare(Z.code)).map(z=>n.jsxs("option",{value:z.id,children:[z.code," - ",z.type," ",z.number]},z.id))]}),n.jsx(Os,{className:"absolute right-6 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none",size:20})]}):n.jsxs("div",{className:"p-8 bg-blue-50 border border-blue-100 rounded-[2.5rem] flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-14 h-14 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(Gr,{size:28})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"Su Propiedad"}),n.jsx("p",{className:"text-xl font-black text-blue-900 uppercase",children:(B==null?void 0:B.code)||"Cargando..."})]})]}),n.jsx(Ea,{className:"text-blue-600/20",size:40})]}),n.jsxs("button",{disabled:!f||!T,onClick:()=>{U?m("receipt"):alert("Esta propiedad no se encuentra solvente en el mes seleccionado.")},className:"w-full bg-slate-900 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] shadow-xl shadow-slate-200 hover:bg-slate-800 transition-all active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3",children:[T?"Generar Recibo de Pago":"Mes no generado",n.jsx(Bc,{size:18})]})]}),!U&&f&&T&&n.jsxs("div",{className:"p-6 bg-amber-50 border border-amber-100 rounded-3xl flex items-center gap-4 animate-in slide-in-from-top-4",children:[n.jsx(Cr,{className:"text-amber-600 shrink-0",size:24}),n.jsx("p",{className:"text-[10px] font-black text-amber-700 uppercase tracking-widest leading-relaxed",children:"La propiedad seleccionada tiene una deuda pendiente para este periodo. El recibo solo puede generarse para meses solventes."})]})]})})]})},YFe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!1),[i,l]=j.useState(""),o=j.useRef(null),d=m=>{var y;const b=(y=m.target.files)==null?void 0:y[0];if(!b)return;s(!0);const v=new FormData;v.append("file",b),fetch(`${ye}/process_banplus_commissions.php`,{method:"POST",body:v,credentials:"include"}).then(async k=>{if(!k.ok){const _=await k.text();throw new Error(`Error ${k.status}: ${_.substring(0,100)}`)}return k.json()}).then(k=>{k.success?r(k):alert(k.error||"Error al procesar el estado de cuenta.")}).catch(k=>alert("Error crítico en el servidor: "+k.message)).finally(()=>s(!1))},u=j.useMemo(()=>t?t.commissions.filter(m=>m.desc.toUpperCase().includes(i.toUpperCase())||m.ref.includes(i)||m.reason.toUpperCase().includes(i.toUpperCase())):[],[t,i]),f=j.useMemo(()=>u.reduce((m,b)=>m+b.amount,0),[u]),p=()=>{if(!t)return;const m=window.open("","_blank");if(!m)return;const b=`
      <html>
        <head>
          <title>Reporte de Comisiones Banplus</title>
          <style>
            body { font-family: sans-serif; padding: 40px; color: #333; }
            table { width: 100%; border-collapse: collapse; margin-top: 20px; }
            th, td { border: 1px solid #ddd; padding: 12px; text-align: left; font-size: 12px; }
            th { background-color: #f8f9fa; font-weight: bold; text-transform: uppercase; }
            .header { text-align: center; margin-bottom: 30px; }
            .total { margin-top: 30px; text-align: right; font-size: 18px; font-weight: bold; }
            .footer { margin-top: 50px; font-size: 10px; color: #999; text-align: center; }
          </style>
        </head>
        <body>
          <div class="header">
            <h1>Reporte de Comisiones Bancarias</h1>
            <p>Banplus - Estado de Cuenta</p>
            <p>Generado el: ${new Date().toLocaleString()}</p>
          </div>
          <table>
            <thead>
              <tr>
                <th>Fecha</th>
                <th>Referencia</th>
                <th>Descripción</th>
                <th>Motivo</th>
                <th>Monto Bs.</th>
              </tr>
            </thead>
            <tbody>
              ${u.map(v=>`
                <tr>
                  <td>${v.date}</td>
                  <td>${v.ref}</td>
                  <td>${v.desc}</td>
                  <td>${v.reason}</td>
                  <td>${v.amount.toLocaleString("es-VE",{minimumFractionDigits:2})}</td>
                </tr>
              `).join("")}
            </tbody>
          </table>
          <div class="total">
            Total Comisiones: Bs. ${f.toLocaleString("es-VE",{minimumFractionDigits:2})}
          </div>
          <div class="footer">
            SAC 2026 Kernel V4.1.94 MC/MB - Sistema Administrativo para Condominios
          </div>
        </body>
      </html>
    `;m.document.write(b),m.document.close()},x=()=>{navigator.share?navigator.share({title:"Reporte de Comisiones Banplus",text:`Total Comisiones: Bs. ${f.toLocaleString("es-VE",{minimumFractionDigits:2})}`,url:window.location.href}).catch(console.error):alert("La función de compartir no está disponible en este navegador.")};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(ps,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Protocolo Kernel V4.1.94 MC/MB"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Comisiones ",n.jsx("br",{}),n.jsx("span",{className:"text-indigo-500 italic",children:"Banplus Extracto"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Detección automática de cargos bancarios, servicios y comisiones desde el estado de cuenta CSV."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".csv",ref:o,onChange:d,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-indigo-100 shadow-inner",children:a?n.jsx(ot,{className:"animate-spin",size:40}):n.jsx(xr,{size:40})}),n.jsx("button",{onClick:()=>{var m;return(m=o.current)==null?void 0:m.click()},disabled:a,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:a?"PROCESANDO...":"CARGAR ESTADO CUENTA"})]})]}),n.jsx(ps,{size:220,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),t&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(Xt,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por descripción, referencia o motivo...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-indigo-500",value:i,onChange:m=>l(m.target.value)})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsxs("button",{onClick:p,className:"flex-1 lg:flex-none p-4 bg-white border border-slate-200 rounded-2xl text-slate-600 hover:bg-slate-50 transition-all flex items-center justify-center gap-2 shadow-sm",children:[n.jsx(Yi,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Exportar"})]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 lg:flex-none p-4 bg-white border border-slate-200 rounded-2xl text-slate-600 hover:bg-slate-50 transition-all flex items-center justify-center gap-2 shadow-sm",children:[n.jsx(yt,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Imprimir"})]}),n.jsxs("button",{onClick:x,className:"flex-1 lg:flex-none p-4 bg-indigo-600 text-white rounded-2xl hover:bg-indigo-700 transition-all flex items-center justify-center gap-2 shadow-lg",children:[n.jsx(_a,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Compartir"})]})]})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 bg-slate-50/30 flex justify-between items-center",children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Detalle de Comisiones Detectadas"}),n.jsxs("div",{className:"flex items-center gap-2 bg-indigo-100 px-4 py-2 rounded-full border border-indigo-200",children:[n.jsx(mi,{size:14,className:"text-indigo-600"}),n.jsxs("span",{className:"text-[10px] font-black text-indigo-600 uppercase tracking-widest",children:[u.length," Registros"]})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Motivo"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:u.map((m,b)=>n.jsxs("tr",{className:"hover:bg-slate-50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6 text-[11px] font-black text-slate-500",children:m.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-indigo-600",children:["#",m.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight",children:m.desc}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-tighter mt-1",children:m.reason})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:"text-sm font-black text-rose-600",children:["- ",m.amount.toLocaleString("es-VE",{minimumFractionDigits:2})]})})]},b))}),n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:3,className:"px-10 py-8 text-right",children:n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em] opacity-60",children:"Totalización Mensual"})}),n.jsx("td",{className:"px-10 py-8 text-right",children:n.jsxs("span",{className:"text-2xl font-black tracking-tighter",children:["Bs. ",f.toLocaleString("es-VE",{minimumFractionDigits:2})]})})]})})]})})]})]})]})},XFe=({user:e})=>{const{exchangeRateHistory:t,loading:r,financialTotals:a,properties:s}=ht(),[i,l]=j.useState(new Date().getMonth()),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState(""),[p,x]=j.useState([]),[m,b]=j.useState(!1),[v,y]=j.useState(!1),[k,_]=j.useState(null),[C,E]=j.useState({type:"Ingreso",category:"Ingresos",date:new Date().toISOString().split("T")[0],amountBs:0,description:"",reference:""}),T=async()=>{b(!0);try{const L=await we.getBankPreciseTransactions(i+1,o);x(L)}catch(L){console.error("Error al cargar banco preciso",L)}finally{b(!1)}};j.useEffect(()=>{T()},[i,o]);const B=j.useMemo(()=>{if(!t||t.length===0)return 45;const L=t[0],R=Number(L.pmValue)>0?Number(L.pmValue):Number(L.amValue)>0?Number(L.amValue):45;return Number(R)},[t]),I=j.useMemo(()=>p.reduce((L,R)=>{if(R.category==="Cierre/Apertura")return L;const Q=Number(R.amountBs)||0;return R.type==="Ingreso"?L+Q:L-Q},0),[p]),M=j.useMemo(()=>p.filter(L=>{var Q;return!u||L.description.toLowerCase().includes(u.toLowerCase())||((Q=L.reference)==null?void 0:Q.toLowerCase().includes(u.toLowerCase()))}),[p,u]),U=async L=>{L.preventDefault(),b(!0);try{const R=await fetch(`${ye}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)});if(R.ok)await T(),y(!1),E({type:"Ingreso",category:"Ingresos",date:new Date().toISOString().split("T")[0],amountBs:0,description:"",reference:""});else{const Q=await R.json();alert(`Error: ${Q.error||"No se pudo guardar"}`)}}catch{alert("Error de conexión al registrar movimiento.")}finally{b(!1)}},D=async()=>{const L=`Estado de Cuenta Bancario Preciso - ${Ue[i]} ${o}
Saldo: Bs. ${I.toLocaleString("es-VE")}
Generado por SAC 2026 ${Ps}`;if(navigator.share)try{await navigator.share({title:"Banco Preciso V4",text:L,url:window.location.href})}catch(R){console.log("Share failed",R)}else alert("Compartir no soportado en este navegador. Use Imprimir para generar PDF.")};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-24 no-print",children:[n.jsxs("div",{className:"bg-gradient-to-br from-indigo-900 via-slate-900 to-black text-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row justify-between items-start gap-10",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("div",{className:"w-10 h-10 bg-indigo-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-500/20",children:n.jsx(Wi,{size:22,className:"animate-pulse"})}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.4em] text-indigo-400",children:"Banco Preciso V4.0 - Conciliación Real"})]}),n.jsxs("h3",{className:"text-6xl lg:text-7xl font-black tracking-tighter",children:["Bs. ",Number(I).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 animate-pulse"}),n.jsxs("p",{className:"text-sm font-bold text-slate-400 uppercase tracking-widest",children:["Ref USD: ",n.jsxs("span",{className:"text-blue-400 font-black",children:["$",(Number(I)/B).toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),n.jsx("div",{className:"px-4 py-1.5 bg-slate-800/50 rounded-full border border-slate-700/50",children:n.jsxs("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:["Registros Consolidados: ",p.length," movimientos"]})})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 w-full md:w-auto self-center md:self-auto",children:[n.jsxs("button",{onClick:D,className:"flex-1 bg-indigo-600 hover:bg-indigo-500 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl flex items-center justify-center gap-2",children:[n.jsx(_a,{size:16})," Compartir"]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 bg-white text-slate-900 px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:scale-105 transition-all shadow-xl flex items-center justify-center gap-2",children:[n.jsx(yt,{size:16})," Imprimir"]})]})]}),n.jsx(xr,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/[0.02] pointer-events-none group-hover:rotate-12 transition-transform duration-[20s]"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-end gap-6 bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"w-full lg:w-auto space-y-4",children:[n.jsxs("h2",{className:"text-2xl font-black text-slate-900 tracking-tight flex items-center gap-3",children:[n.jsx(La,{className:"text-indigo-600"})," Movimientos Consolidados (Sin División)"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"bg-slate-100 p-1.5 rounded-xl flex gap-1 border border-slate-200",children:[n.jsx("select",{value:i,onChange:L=>l(Number(L.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-3 py-1 cursor-pointer",children:Ue.map((L,R)=>n.jsx("option",{value:R,children:L},R))}),n.jsx("div",{className:"w-px h-4 bg-slate-300 self-center"}),n.jsx("input",{type:"number",value:o,onChange:L=>d(Number(L.target.value)),className:"bg-transparent border-none text-[10px] font-black text-indigo-600 outline-none w-16 text-center"})]}),n.jsxs("div",{className:"relative flex-1 sm:w-64",children:[n.jsx(Xt,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:14}),n.jsx("input",{type:"text",placeholder:"Buscar referencia o concepto...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-9 pr-4 py-2 text-xs font-bold text-slate-800 focus:ring-2 focus:ring-indigo-100 transition-all",value:u,onChange:L=>f(L.target.value)})]})]})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsxs("button",{onClick:()=>{const L=["Fecha","Ref","Descripción Consolidada","Tipo","Bs Total","USD Total"],R=M.map(Q=>[Q.date,Q.reference||"S/R",Q.description,Q.type,`Bs. ${Number(Q.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})}`,`$${Number(Q.amount).toFixed(2)}`]);zc("AUDITORÍA BANCO PRECISO V4",L,R)},className:"flex-1 lg:flex-none bg-slate-100 text-slate-500 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all flex items-center justify-center gap-2 text-center",children:[n.jsx(gr,{size:18})," Exportar HTML"]}),n.jsxs("button",{onClick:()=>y(!0),className:"flex-[2] lg:flex-none bg-slate-900 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl transition-all active:scale-95 flex items-center justify-center gap-2",children:[n.jsx(Cn,{size:18})," Nuevo Asiento"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden min-h-[400px]",children:m?n.jsxs("div",{className:"flex flex-col items-center justify-center py-32 gap-4",children:[n.jsx(ot,{className:"animate-spin text-indigo-600",size:40}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest animate-pulse",children:"Consolidando estados de cuenta..."})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Explicación Consolidada"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Bs. Estado Cuenta"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"USD Ref"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:M.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"py-24 text-center",children:[n.jsx(Tc,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"No se encontraron movimientos conciliados"})]})}):M.map(L=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-8 py-6 text-xs font-black text-slate-400",children:L.date}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:"font-mono text-xs font-black bg-indigo-50 text-indigo-600 px-3 py-1 rounded-lg border border-indigo-100",children:L.reference||"S/R"})}),n.jsx("td",{className:"px-8 py-6 max-w-md",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 ${L.type==="Ingreso"?"bg-emerald-50 text-emerald-600":"bg-red-50 text-red-600"}`,children:L.type==="Ingreso"?n.jsx(ha,{size:14}):n.jsx(db,{size:14})}),n.jsx("p",{className:"text-xs font-bold text-slate-700 leading-relaxed truncate group-hover:whitespace-normal group-hover:overflow-visible group-hover:z-50 transition-all",children:L.description})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:`font-black text-base tracking-tighter ${L.type==="Ingreso"?"text-emerald-600":"text-rose-600"}`,children:[L.type==="Ingreso"?"+":"-"," Bs. ",Number(L.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"font-black text-sm text-slate-400 tracking-tighter",children:["$ ",Number(L.amount).toLocaleString(void 0,{minimumFractionDigits:2})]})})]},L.id))})]})})}),n.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 p-8 rounded-[2.5rem] flex items-center gap-6",children:[n.jsx("div",{className:"bg-indigo-600 p-4 rounded-2xl text-white",children:n.jsx(Ea,{size:28})}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-black text-indigo-900 uppercase text-xs tracking-widest mb-1",children:"Cálculo de Banco Preciso V4"}),n.jsx("p",{className:"text-indigo-800/70 text-[10px] font-medium uppercase tracking-tighter leading-relaxed",children:"Este módulo ignora la distribución administrativa (cuota mes / deuda histórica) y muestra los montos agrupados por referencia bancaria exacta, facilitando el cotejo directo con el estado de cuenta físico."})]})]}),v&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Nuevo Movimiento"}),n.jsx("button",{onClick:()=>y(!1),className:"p-3 bg-slate-100 rounded-full text-slate-400 hover:text-red-500 transition-colors",children:n.jsx(ft,{size:24})})]}),n.jsxs("form",{onSubmit:U,className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Tipo de Operación"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{type:"button",onClick:()=>E({...C,type:"Ingreso",category:"Ingresos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${C.type==="Ingreso"?"bg-emerald-600 text-white border-emerald-600":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Ingreso"}),n.jsx("button",{type:"button",onClick:()=>E({...C,type:"Egreso",category:"Gastos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${C.type==="Egreso"?"bg-rose-600 text-white border-rose-600":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Egreso"})]})]}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none",value:C.description,onChange:L=>E({...C,description:L.target.value.toUpperCase()}),placeholder:"DESCRIPCIÓN"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx("input",{required:!0,type:"date",className:"bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:C.date,onChange:L=>E({...C,date:L.target.value})}),n.jsx("input",{required:!0,className:"bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:C.reference,onChange:L=>E({...C,reference:L.target.value}),placeholder:"REFERENCIA"})]}),n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-8 rounded-[2.5rem] space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-blue-600 tracking-widest text-center block",children:"Monto Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full bg-white rounded-2xl px-6 py-5 text-3xl font-black text-slate-900 outline-none text-center",value:C.amountBs||"",onChange:L=>E({...C,amountBs:parseFloat(L.target.value)}),placeholder:"0,00"})]}),n.jsxs("button",{disabled:m,type:"submit",className:"w-full bg-slate-900 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] active:scale-95 transition-all flex items-center justify-center gap-3",children:[m?n.jsx(ot,{className:"animate-spin"}):n.jsx(qn,{size:18}),"PROCESAR"]})]})]})})]})},ai=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},fM=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},JFe=({user:e})=>{const{properties:t,residents:r,users:a,latestRate:s}=ht(),[i,l]=j.useState(null),o=j.useMemo(()=>["admin","programmer"].includes(e.role)?t:t.filter(D=>D.id===e.propertyId),[t,e]);j.useEffect(()=>{!["admin","programmer"].includes(e.role)&&e.propertyId&&l(e.propertyId)},[e]);const[d,u]=j.useState("selection"),[f,p]=j.useState(!1),[x,m]=j.useState(null),[b,v]=j.useState(null),[y,k]=j.useState({}),_=j.useRef(null);j.useEffect(()=>{(async()=>{try{const L=await we.getSystemSettings();k(L||{})}catch(L){console.error("Error fetching settings",L)}})()},[]);const C=j.useMemo(()=>t.find(D=>D.id===i),[t,i]),E=j.useMemo(()=>{if(!C)return null;const D=r.find(R=>R.propertyId===C.id&&R.isOwner),L=a.find(R=>R.cedula===(D==null?void 0:D.cedula));return{fullName:(D==null?void 0:D.fullName)||"Propietario",email:(L==null?void 0:L.email)||"",phone:(D==null?void 0:D.phone)||(L==null?void 0:L.phone)||"",telegramId:(L==null?void 0:L.telegramChatId)||"",propertyCode:C.code,propertyId:C.id}},[C,r,a]),T=async()=>{if(i){p(!0);try{const L=await(await fetch(`${ye}/get_monthly_debt_status.php?propertyId=${i}`,{credentials:"include"})).json();L.success?(m(L),u("report")):alert("Error: "+L.error)}catch{alert("Error de red al obtener el reporte.")}finally{p(!1)}}},B=D=>{if(!D)return"";let L=D.trim();return L.startsWith("+")?L.replace(/\D/g,""):L.startsWith("0")?"58"+L.substring(1).replace(/\D/g,""):L.length===10?"58"+L.replace(/\D/g,""):L.replace(/\D/g,"")},I=async D=>{if(!E||!C||!x)return;let L=`🏢 *ESTADO DE CUENTA - DEUDA MESES*

Estimado(a) *${E.fullName}*,
Unidad: *${C.type} ${C.number}* (${C.code})

------------------------------------------
`;x.property.initialDebt>0&&(L+=`🤝 *Convenio de Pago:* $${ai(x.property.initialDebt)}
`),x.pendingMonths.length>0?(L+=`📅 *Meses Pendientes:*
`,x.pendingMonths.forEach(Q=>{L+=`• ${Ue[Q.month]} ${Q.year}: $${ai(Q.pending_amount)}
`})):L+=`✅ No tiene meses pendientes.
`,x.property.creditBalance>0&&(L+=`💰 *Saldo a Favor:* $${ai(x.property.creditBalance)}
`);const R=x.property.initialDebt+x.pendingMonths.reduce((Q,G)=>Q+Number(G.pending_amount),0)-x.property.creditBalance;if(L+=`------------------------------------------
🔥 *TOTAL DEUDA NETA:* $${ai(Math.max(0,R))}

Consulte más detalles en:
🌐 ${la}

¡Gracias!`,D==="whatsapp"){const Q=B(E.phone);if(!Q)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${Q}?text=${encodeURIComponent(L)}`,"_blank");return}if(D==="share"){if(navigator.share)try{await navigator.share({title:`Deuda Meses - ${C.code}`,text:L.replace(/\*/g,""),url:la})}catch(Q){console.warn("Share failed",Q)}else alert("La función de compartir no está disponible en este navegador.");return}v(D);try{const Q={channel:D,messageType:"custom",subject:`Deuda Meses SAC 2026 - ${C.code}`,recipients:[{name:E.fullName,email:E.email,telegramChatId:E.telegramId,customMessage:L.replace(/\*/g,"")}]},K=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)})).json();K.status==="success"?alert(`¡Éxito! Mensaje enviado por ${D}.`):alert("Error: "+K.message)}catch{alert("Error de red al enviar.")}finally{v(null)}},M=async()=>{if(_.current){p(!0);try{const L=(await Hs(_.current,{scale:2,useCORS:!0,backgroundColor:"#f8fafc"})).toDataURL("image/png"),R=document.createElement("a");R.href=L,R.download=`DeudaMeses_${C==null?void 0:C.code}.png`,R.click()}catch{alert("Error al capturar imagen.")}finally{p(!1)}}},U=()=>{if(!C||!E||!x)return;const D=x.property.initialDebt+x.pendingMonths.reduce((K,W)=>K+Number(W.pending_amount),0)-x.property.creditBalance,L=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Deuda Meses - ${C.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 800px; margin: 0 auto; background: white; padding: 50px; border-radius: 24px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 30px; }
        .title { font-size: 20px; font-weight: 900; text-transform: uppercase; color: #0f172a; letter-spacing: 2px; }
        .item-row { display: flex; justify-content: space-between; padding: 15px; border-bottom: 1px solid #f1f5f9; align-items: center; }
        .item-label { font-size: 13px; font-weight: 700; color: #475569; text-transform: uppercase; }
        .item-value { font-size: 15px; font-weight: 900; color: #0f172a; }
        .total-box { margin-top: 30px; padding: 25px; background: #0f172a; color: white; border-radius: 20px; display: flex; justify-content: space-between; align-items: center; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 30px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Estado de Cuenta - Deuda Meses</div>
            <div style="font-size: 11px; color: #64748b; font-weight: 700; margin-top: 4px;">SAC 2026 - ${C.code}</div>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 30px; font-size: 13px;">
            <div><strong>Propietario:</strong> ${E.fullName}</div>
            <div><strong>Unidad:</strong> ${C.type} ${C.number}</div>
        </div>
        
        <div style="border: 1px solid #f1f5f9; border-radius: 16px; overflow: hidden;">
            ${x.property.initialDebt>0?`
            <div class="item-row" style="background: #f8fafc;">
                <div class="item-label">Convenio de Pago</div>
                <div class="item-value">$ ${ai(x.property.initialDebt)}</div>
            </div>`:""}

            ${x.pendingMonths.map(K=>`
            <div class="item-row">
                <div class="item-label">${Ue[K.month]} ${K.year}</div>
                <div class="item-value">$ ${ai(K.pending_amount)}</div>
            </div>`).join("")}

            ${x.property.creditBalance>0?`
            <div class="item-row" style="background: #f0fdf4; border-bottom: none;">
                <div class="item-label" style="color: #166534;">Saldo a Favor</div>
                <div class="item-value" style="color: #166534;">- $ ${ai(x.property.creditBalance)}</div>
            </div>`:""}
        </div>

        <div class="total-box">
            <div>
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Total Deuda Neta</div>
                <div style="font-size: 28px; font-weight: 900;">$ ${ai(Math.max(0,D))}</div>
            </div>
            <div style="text-align: right;">
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Equivalente VES</div>
                <div style="font-size: 20px; font-weight: 700;">Bs. ${fM(Math.max(0,D)*s)}</div>
            </div>
        </div>
        
        <div class="footer">
            Generado por SAC 2026 • ${Ps} • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,R=new Blob([L],{type:"text/html"}),Q=URL.createObjectURL(R),G=document.createElement("a");G.href=Q,G.download=`DeudaMeses_${C.code}.html`,G.click(),URL.revokeObjectURL(Q)};if(d==="report"&&C&&E&&x){const D=x.property.initialDebt+x.pendingMonths.reduce((L,R)=>L+Number(R.pending_amount),0)-x.property.creditBalance;return n.jsxs("div",{className:"max-w-3xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>u("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(fs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:U,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(ja,{size:20})}),n.jsx("button",{onClick:M,className:"p-3 bg-orange-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar Imagen",children:n.jsx(ek,{size:20})}),n.jsx("button",{onClick:()=>I("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"WhatsApp",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>I("telegram"),disabled:!E.telegramId||!!b,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${E.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:b==="telegram"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>I("email"),disabled:!E.email||!!b,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${E.email?"bg-indigo-600":"bg-slate-200"}`,title:"Correo",children:b==="email"?n.jsx(Qt,{size:20,className:"animate-spin"}):n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>I("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(_a,{size:20})})]})]}),n.jsxs("div",{ref:_,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Estado de Cuenta"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"Deuda por Meses • SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Unidad"}),n.jsx("p",{className:"text-lg font-black text-blue-300",children:C.code})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400",children:[s.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:E.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[C.type," ",C.number]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(Xd,{size:14,className:"text-blue-600"})," Desglose de Deuda"]}),n.jsxs("div",{className:"border border-slate-100 rounded-[2rem] overflow-hidden shadow-sm",children:[x.property.initialDebt>0&&n.jsxs("div",{className:"p-6 bg-slate-50 border-b border-slate-100 flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(Zd,{size:20})}),n.jsx("p",{className:"text-sm font-black text-slate-700 uppercase tracking-tight",children:"Convenio de Pago"})]}),n.jsxs("p",{className:"text-lg font-black text-slate-900",children:["$ ",ai(x.property.initialDebt)]})]}),x.pendingMonths.map((L,R)=>n.jsxs("div",{className:"p-6 bg-white border-b border-slate-50 flex justify-between items-center last:border-b-0",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-50 rounded-xl flex items-center justify-center text-slate-400",children:n.jsx(Lr,{size:20})}),n.jsxs("p",{className:"text-sm font-black text-slate-700 uppercase tracking-tight",children:[Ue[L.month]," ",L.year]})]}),n.jsxs("p",{className:"text-lg font-black text-slate-900",children:["$ ",ai(L.pending_amount)]})]},R)),x.pendingMonths.length===0&&x.property.initialDebt<=0&&n.jsxs("div",{className:"p-12 text-center bg-slate-50",children:[n.jsx(zt,{size:40,className:"text-emerald-500 mx-auto mb-4"}),n.jsx("p",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"No hay meses pendientes"})]}),x.property.creditBalance>0&&n.jsxs("div",{className:"p-6 bg-emerald-50 flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center text-emerald-600 shadow-sm",children:n.jsx(wn,{size:20})}),n.jsx("p",{className:"text-sm font-black text-emerald-700 uppercase tracking-tight",children:"Saldo a Favor"})]}),n.jsxs("p",{className:"text-lg font-black text-emerald-700",children:["- $ ",ai(x.property.creditBalance)]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-xl flex flex-col md:flex-row justify-between items-center gap-8",children:[n.jsxs("div",{className:"text-center md:text-left",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Total Deuda Neta"}),n.jsx("div",{className:"flex items-center gap-3 justify-center md:justify-start",children:D<=0?n.jsx("div",{className:"px-4 py-2 bg-emerald-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"SOLVENTE"}):n.jsx("div",{className:"px-4 py-2 bg-red-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"PENDIENTE"})})]}),n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Monto a Cancelar"}),n.jsxs("h3",{className:"text-5xl font-black tracking-tighter",children:["$ ",ai(Math.max(0,D))]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-1",children:["Bs. ",fM(Math.max(0,D)*s)]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:[Ps," • Generado Digitalmente"]})})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsx("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado Cuenta - ",n.jsx("span",{className:"text-blue-600",children:"Deuda Meses"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Resumen simplificado de meses pendientes y convenios."})]})}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(aa,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Consulta de Deuda"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Seleccione la unidad para visualizar el resumen de deuda por meses."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:i||"",onChange:D=>l(Number(D.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),o.sort((D,L)=>D.code.localeCompare(L.code,void 0,{numeric:!0})).map(D=>n.jsxs("option",{value:D.id,children:[D.code," - ",D.type," ",D.number]},D.id))]})]}),n.jsxs("button",{disabled:!i||f,onClick:T,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[f?n.jsx(Qt,{className:"animate-spin",size:20}):n.jsx(Os,{size:18}),"CONSULTAR DEUDA POR MESES"]})]})})]})},hf=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},ZFe=({user:e})=>{const{properties:t,residents:r,users:a}=ht(),[s,i]=j.useState([]),[l,o]=j.useState(0),[d,u]=j.useState(!1),[f,p]=j.useState(null),[x,m]=j.useState(!1),v=(()=>{const T=[],B=[...t].sort((M,U)=>M.code.localeCompare(U.code,void 0,{numeric:!0})),I=["admin","programmer"].includes(e.role);return B.forEach(M=>{if(I){const U=r.filter(D=>D.propertyId===M.id);U.length===0?T.push({propertyId:M.id,propertyCode:M.code,propertyName:`${M.type} ${M.number}`,ownerName:"Propietario",phone:"",email:"",telegramId:""}):U.forEach(D=>{const L=a.find(Q=>Q.cedula===D.cedula),R=D.phone||(L==null?void 0:L.phone)||"";T.push({propertyId:M.id,propertyCode:M.code,propertyName:`${M.type} ${M.number}`,ownerName:D.fullName||"Propietario",phone:R,email:(L==null?void 0:L.email)||"",telegramId:(L==null?void 0:L.telegramChatId)||""})})}else{const U=r.find(R=>R.propertyId===M.id&&R.isOwner),D=a.find(R=>R.cedula===(U==null?void 0:U.cedula)),L=(U==null?void 0:U.phone)||(D==null?void 0:D.phone)||"";T.push({propertyId:M.id,propertyCode:M.code,propertyName:`${M.type} ${M.number}`,ownerName:(U==null?void 0:U.fullName)||"Propietario",phone:L,email:(D==null?void 0:D.email)||"",telegramId:(D==null?void 0:D.telegramChatId)||""})}}),T})(),y=()=>{const T=v.filter(B=>B.phone.replace(/\D/g,"").length>=7);if(T.length===0){alert("SISTEMA: No hay propietarios con números de teléfono válidos.");return}i(T),o(0),u(!0),k(T[0].propertyId)},k=async T=>{m(!0),p(null);try{const I=await(await fetch(`${ye}/get_monthly_debt_status.php?propertyId=${T}`,{credentials:"include"})).json();I.success?p(I):console.error("Error fetching debt",I.error)}catch(B){console.error("Network error fetching debt",B)}finally{m(!1)}},_=T=>{if(!T)return"";let B=T.trim();return B.startsWith("+")?B.replace(/\D/g,""):B.startsWith("0")?"58"+B.substring(1).replace(/\D/g,""):B.length===10?"58"+B.replace(/\D/g,""):B.replace(/\D/g,"")},C=()=>{if(!f)return alert("Cargando datos de deuda...");const T=s[l];let B=`🏢 *ESTADO DE CUENTA - DEUDA MESES*

Estimado(a) *${T.ownerName}*,
Unidad: *${T.propertyName}* (${T.propertyCode})

------------------------------------------
`;f.property.initialDebt>0&&(B+=`🤝 *Convenio de Pago:* $${hf(f.property.initialDebt)}
`),f.pendingMonths.length>0?(B+=`📅 *Meses Pendientes:*
`,f.pendingMonths.forEach(U=>{B+=`• ${Ue[U.month]} ${U.year}: $${hf(U.pending_amount)}
`})):B+=`✅ No tiene meses pendientes.
`,f.property.creditBalance>0&&(B+=`💰 *Saldo a Favor:* $${hf(f.property.creditBalance)}
`);const I=f.property.initialDebt+f.pendingMonths.reduce((U,D)=>U+Number(D.pending_amount),0)-f.property.creditBalance;B+=`------------------------------------------
🔥 *TOTAL DEUDA NETA:* $${hf(Math.max(0,I))}

Consulte más detalles en:
🌐 ${la}

¡Gracias!`;const M=_(T.phone);if(!M)return alert("No hay teléfono registrado.");if(window.open(`https://wa.me/${M}?text=${encodeURIComponent(B)}`,"_blank"),l<s.length-1){const U=l+1;o(U),k(s[U].propertyId)}else alert("¡Felicidades! Ha terminado de enviar toda la cola de WhatsApp."),u(!1)},E=()=>{if(l<s.length-1){const T=l+1;o(T),k(s[T].propertyId)}else u(!1)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado Cuenta - ",n.jsx("span",{className:"text-blue-600",children:"Deuda Meses Masivo"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Envío masivo de estados de cuenta vía WhatsApp."})]}),n.jsxs("div",{className:"bg-slate-900 text-white px-6 py-3 rounded-2xl flex items-center gap-4 shadow-xl",children:[n.jsx(Gr,{size:20,className:"text-blue-400"}),n.jsxs("span",{className:"text-sm font-black tracking-tight",children:[v.length," Unidades"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(vn,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Envío Automático"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Inicie la cola de envío para notificar a todos los propietarios sobre su deuda por meses."})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-2xl border border-slate-100",children:[n.jsxs("h3",{className:"text-xs font-black text-slate-400 uppercase tracking-widest mb-4 flex items-center gap-2",children:[n.jsx(Wi,{size:14,className:"text-emerald-500"})," Resumen de Alcance"]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-slate-100",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Con Teléfono"}),n.jsx("p",{className:"text-xl font-black text-slate-900",children:v.filter(T=>T.phone&&T.phone.length>=7).length})]}),n.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-slate-100",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Sin Teléfono"}),n.jsx("p",{className:"text-xl font-black text-red-500",children:v.filter(T=>!T.phone||T.phone.length<7).length})]})]})]}),n.jsxs("button",{onClick:y,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-emerald-200 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(vn,{size:20}),"INICIAR COLA DE WHATSAPP"]})]})}),d&&s.length>0&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/80 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("div",{className:"bg-emerald-100 text-emerald-600 p-3 rounded-2xl",children:n.jsx(vn,{size:24})}),n.jsx("button",{onClick:()=>u(!1),className:"text-slate-400 hover:text-red-500",children:n.jsx(ft,{size:24})})]}),n.jsxs("div",{className:"text-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Procesando Cola"}),n.jsxs("p",{className:"text-slate-400 text-sm font-medium",children:["Unidad ",l+1," de ",s.length]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2rem] border border-slate-100 mb-8 relative group",children:[n.jsx("div",{className:"absolute -top-3 left-8 bg-emerald-600 text-white px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest shadow-lg",children:"Siguiente Envío"}),n.jsx("p",{className:"text-xl font-black text-slate-800 mb-1 uppercase",children:s[l].ownerName}),n.jsxs("p",{className:"text-xs font-bold text-blue-600 flex items-center gap-2",children:[n.jsx(Bc,{size:12})," ",s[l].propertyCode," - ",s[l].phone]}),n.jsxs("div",{className:"mt-8 pt-6 border-t border-slate-200",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Estado de Deuda:"}),x?n.jsxs("div",{className:"flex items-center gap-2 text-blue-600 font-black text-sm",children:[n.jsx(Qt,{className:"animate-spin",size:14})," Cargando datos..."]}):f?n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$ ",hf(f.property.initialDebt+f.pendingMonths.reduce((T,B)=>T+Number(B.pending_amount),0)-f.property.creditBalance)]}):n.jsx("p",{className:"text-red-500 font-black text-sm",children:"Error al cargar datos"})]}),n.jsx("div",{className:"w-full bg-slate-200 h-1.5 rounded-full mt-8 overflow-hidden",children:n.jsx("div",{className:"bg-emerald-500 h-full transition-all duration-500",style:{width:`${(l+1)/s.length*100}%`}})})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("button",{onClick:C,disabled:x||!f,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-2xl font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-emerald-200 transition-all flex items-center justify-center gap-3 active:scale-95 disabled:opacity-50",children:["LANZAR WHATSAPP ",n.jsx(yM,{size:18})]}),n.jsx("button",{onClick:E,className:"w-full py-4 text-slate-400 hover:text-slate-600 font-bold text-xs uppercase tracking-widest transition-colors",children:"Omitir Destinatario"})]})]})})]})},ls=e=>Number(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),pM=e=>Number(e).toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2}),eIe=({user:e})=>{const{properties:t,moduleStatus:r,refreshData:a}=ht(),[s,i]=j.useState(new Date().getMonth()),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(null),[f,p]=j.useState("selection"),[x,m]=j.useState(!1),[b,v]=j.useState(null),[y,k]=j.useState(!1),_=j.useRef(null),C=j.useMemo(()=>{const U=r.find(D=>D.id==="saldo-desglosado");return U?U.isActive:!1},[r]);j.useEffect(()=>{e.role==="owner"&&(t.find(U=>!0),t.length===1&&u(t[0].id))},[e,t]);const E=async()=>{k(!0);try{await we.saveSaldoDesglosadoVisibility(!C),await a()}catch{alert("Error al cambiar visibilidad")}finally{k(!1)}},T=async()=>{if(d){m(!0);try{const U=await we.getSaldoDesglosado(d,s,l);if(U.success&&U.data){const D=U.data;(l<2026||l===2026&&s<2)&&(D.current_fee=0),v(D),p("report"),window.scrollTo({top:0,behavior:"smooth"})}else alert("Atención: "+(U.error||"No se encontraron datos para el periodo seleccionado"))}catch{alert("Error al obtener el reporte.")}finally{m(!1)}}},B=async()=>{if(!_.current)return;const D=(await Hs(_.current,{scale:2})).toDataURL("image/png"),L=document.createElement("a");L.href=D,L.download=`Saldo_Desglosado_${b.property.code}.png`,L.click()},I=async U=>{const D=`📊 *SALDO DESGLOSADO - ${Ra}*
Unidad: ${b.property.code}
Mes: ${Ue[s]} ${l}
Saldo Inicial: $${ls(b.initial_debt)}
Cuota Mes: $${ls(b.current_fee)}
Abonos: $${ls(b.payments.reduce((L,R)=>L+R.amount_usd,0))}
*SALDO FINAL: $${ls(b.final_balance)}*`;U==="whatsapp"?window.open(`https://wa.me/?text=${encodeURIComponent(D)}`,"_blank"):U==="telegram"?window.open(`https://t.me/share/url?url=${encodeURIComponent(D)}`,"_blank"):U==="email"?window.open(`mailto:?subject=Saldo Desglosado ${b.property.code}&body=${encodeURIComponent(D)}`,"_blank"):U==="share"&&navigator.share&&navigator.share({title:"Saldo Desglosado",text:D})},M=()=>{const U=`<html><head><title>Saldo Desglosado</title><style>body{font-family:sans-serif;padding:20px;}table{width:100%;border-collapse:collapse;}th,td{border:1px solid #ddd;padding:12px;text-align:left;}th{background:#f4f4f4;}</style></head><body><h1>Saldo Desglosado - ${b.property.code}</h1><p><b>Mes:</b> ${Ue[s]} ${l}</p><table><tr><th>Fecha</th><th>Ref</th><th>Bs.</th><th>Tasa</th><th>$.</th><th>Amort. Deuda</th><th>Amort. Mes</th></tr>`+b.payments.map(Q=>`<tr><td>${Q.date}</td><td>${Q.reference}</td><td>${pM(Q.amount_bs)}</td><td>${Q.rate}</td><td>${ls(Q.amount_usd)}</td><td>${ls(Q.applied_to_old)}</td><td>${ls(Q.applied_to_current)}</td></tr>`).join("")+"</table></body></html>",D=new Blob([U],{type:"text/html"}),L=URL.createObjectURL(D),R=document.createElement("a");R.href=L,R.download=`Saldo_Desglosado_${b.property.code}.html`,R.click()};return f==="report"&&b?n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>p("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(Os,{className:"rotate-180",size:16})," Volver"]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg hover:bg-slate-800 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:M,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg hover:bg-blue-500 transition-all",title:"Exportar HTML",children:n.jsx(ja,{size:20})}),n.jsx("button",{onClick:B,className:"p-3 bg-purple-600 text-white rounded-xl shadow-lg hover:bg-purple-500 transition-all",title:"Capturar Imagen",children:n.jsx(ek,{size:20})}),n.jsx("button",{onClick:()=>I("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg hover:bg-emerald-400 transition-all",title:"WhatsApp",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>I("telegram"),className:"p-3 bg-sky-500 text-white rounded-xl shadow-lg hover:bg-sky-400 transition-all",title:"Telegram",children:n.jsx(Gi,{size:20})}),n.jsx("button",{onClick:()=>I("share"),className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg hover:bg-indigo-500 transition-all",title:"Compatir",children:n.jsx(_a,{size:20})})]})]}),n.jsxs("div",{ref:_,className:"bg-white rounded-[2.5rem] shadow-2xl border border-slate-200 overflow-hidden bg-white",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Saldo Desglosado Mensual"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px]",children:"Gestión Transparente • Kernel V4.2.04"}),n.jsxs("div",{className:"mt-8 grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-white/10 p-5 rounded-3xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Propiedad"}),n.jsx("p",{className:"text-xl font-black text-blue-300",children:b.property.code}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:[b.property.type," ",b.property.number]})]}),n.jsxs("div",{className:"bg-white/10 p-5 rounded-3xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Periodo Revisado"}),n.jsx("p",{className:"text-xl font-black text-emerald-400 uppercase",children:Ue[s]}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:l})]}),n.jsxs("div",{className:"bg-white/10 p-5 rounded-3xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Pagos en el Mes"}),n.jsx("p",{className:"text-2xl font-black text-amber-400",children:b.payments_count}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:"Transacciones registradas"})]})]})]}),n.jsxs("div",{className:"p-8 lg:p-12 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[n.jsxs("div",{className:"p-6 bg-slate-50 border border-slate-100 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest mb-2",children:"Saldo Inicial ($)"}),n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$ ",ls(b.initial_debt)]})]}),n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-blue-400 tracking-widest mb-2",children:"Convenio Activo ($)"}),n.jsxs("p",{className:"text-2xl font-black text-blue-600",children:["$ ",ls(b.agreement_balance)]})]}),n.jsxs("div",{className:"p-6 bg-slate-900 border border-slate-800 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-slate-500 tracking-widest mb-2 text-white/50",children:"Cuota Mes Actual ($)"}),n.jsxs("p",{className:"text-2xl font-black text-white",children:["$ ",ls(b.current_fee)]})]}),n.jsxs("div",{className:"p-6 bg-emerald-50 border border-emerald-100 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-emerald-600 tracking-widest mb-2",children:"Saldo Final ($)"}),n.jsxs("p",{className:"text-2xl font-black text-emerald-600 font-bold",children:["$ ",ls(b.final_balance)]})]})]}),n.jsx("div",{className:"overflow-x-auto rounded-3xl border border-slate-100 shadow-sm",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{className:"bg-slate-50",children:n.jsxs("tr",{className:"border-b border-slate-100 text-[9px] font-black uppercase text-slate-400 tracking-widest",children:[n.jsx("th",{className:"px-6 py-5",children:"Fecha Contable"}),n.jsx("th",{className:"px-6 py-5",children:"Referencia"}),n.jsx("th",{className:"px-6 py-5 text-right",children:"Depósito Bs."}),n.jsx("th",{className:"px-6 py-5 text-center",children:"Tasa $"}),n.jsx("th",{className:"px-6 py-5 text-right",children:"Equivalente $"}),n.jsx("th",{className:"px-6 py-5 text-right text-blue-600",children:"Amort. Deuda"}),n.jsx("th",{className:"px-6 py-5 text-right text-emerald-600",children:"Amort. Mes"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:b.payments.length>0?b.payments.map((U,D)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[n.jsx("td",{className:"px-6 py-4 font-bold text-slate-600 text-xs",children:U.date}),n.jsx("td",{className:"px-6 py-4 font-mono text-[10px] text-slate-400",children:U.reference}),n.jsx("td",{className:"px-6 py-4 text-right font-black text-slate-900 text-xs underline decoration-slate-100 underline-offset-4",children:pM(U.amount_bs)}),n.jsx("td",{className:"px-6 py-4 text-center font-bold text-blue-500 text-xs",children:U.rate}),n.jsxs("td",{className:"px-6 py-4 text-right font-black text-slate-900 text-xs",children:["$ ",ls(U.amount_usd)]}),n.jsxs("td",{className:"px-6 py-4 text-right font-bold text-blue-600 text-xs",children:["$ ",ls(U.applied_to_old)]}),n.jsxs("td",{className:"px-6 py-4 text-right font-bold text-emerald-600 text-xs",children:["$ ",ls(U.applied_to_current)]})]},D)):n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"px-6 py-12 text-center text-slate-400 uppercase font-black text-[10px] tracking-widest",children:"No hay pagos registrados para este periodo"})})})]})}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center bg-slate-50 p-8 rounded-[2rem] gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(ho,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-black text-slate-900 uppercase",children:"Certificación de Saldo"}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:"Información validada por el sistema central"})]})]}),n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Última Actualización"}),n.jsx("p",{className:"text-xs font-black text-slate-600",children:new Date().toLocaleString()})]})]})]})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Saldo ",n.jsx("span",{className:"text-blue-600",children:"Desglosado"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium italic",children:"Visión detallada y transparente de su cuenta mes a mes."})]}),["programmer","admin"].includes(e.role)&&n.jsxs("button",{onClick:E,disabled:y,className:`flex items-center gap-3 px-6 py-3 rounded-2xl border transition-all ${C?"bg-emerald-50 border-emerald-100 text-emerald-600":"bg-slate-100 border-slate-200 text-slate-400"}`,children:[y?n.jsx(Vi,{className:"animate-spin",size:18}):C?n.jsx(EM,{size:20}):n.jsx(jM,{size:20}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest",children:"Visibilidad Propietarios"}),n.jsx("p",{className:"text-[10px] font-black uppercase",children:C?"Activado (ON)":"Desactivado (OFF)"})]})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 overflow-hidden relative",children:[n.jsx(Om,{className:"absolute right-[-40px] top-[-40px] text-slate-50 w-80 h-80 pointer-events-none"}),n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8 relative z-10",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Ba,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Historial de Gestión"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Consulte el desglose de su cuenta seleccionando el periodo de interés."})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Mes"}),n.jsx("select",{value:s,onChange:U=>i(Number(U.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:Ue.map((U,D)=>n.jsx("option",{value:D,children:U},D))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Año"}),n.jsx("input",{type:"number",value:l,onChange:U=>o(Number(U.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all"})]})]}),["programmer","admin","board"].includes(e.role)&&n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Gr,{size:14})," Seleccionar Propiedad"]}),n.jsxs("select",{value:d||"",onChange:U=>u(Number(U.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),t.sort((U,D)=>U.code.localeCompare(D.code,void 0,{numeric:!0})).map(U=>n.jsxs("option",{value:U.id,children:[U.code," - ",U.type," ",U.number]},U.id))]})]}),n.jsxs("button",{disabled:!d||x,onClick:T,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[x?n.jsx(Vi,{className:"animate-spin",size:20}):n.jsx(Os,{size:18}),"CONSULTAR SALDO DETALLADO"]}),n.jsxs("div",{className:"flex items-center gap-4 py-4 px-6 bg-amber-50 rounded-2xl border border-amber-100",children:[n.jsx(ho,{className:"text-amber-600 shrink-0",size:18}),n.jsx("p",{className:"text-[10px] font-bold text-amber-800 uppercase tracking-tight",children:"Este reporte incluye amortización sobre deudas previas y cuotas actuales."})]})]})]})]})},Zr=e=>Number(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),tIe=({user:e})=>{const{properties:t,moduleStatus:r,refreshData:a}=ht(),[s,i]=j.useState(new Date().getMonth()),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(null),[f,p]=j.useState("selection"),[x,m]=j.useState(!1),[b,v]=j.useState(null),[y,k]=j.useState(!1),_=j.useRef(null),C=j.useMemo(()=>{const D=r.find(L=>L.id==="saldo-desglosado-avanzado");return D?D.isActive:!1},[r]),E=async()=>{k(!0);try{await we.saveModuleStatus("saldo-desglosado-avanzado",!C),await a()}catch{alert("Error al cambiar visibilidad")}finally{k(!1)}},T=async()=>{if(d){m(!0);try{const D=await we.getSaldoDesglosado(d,s,l);if(D.success&&D.data){const L=D.data;(l<2026||l===2026&&s<2)&&(L.current_fee=0),v(L),p("report"),window.scrollTo({top:0,behavior:"smooth"})}else alert("Atención: "+(D.error||"No se encontraron datos para el periodo seleccionado"))}catch{alert("Error al obtener el reporte.")}finally{m(!1)}}},B=async()=>{if(_.current)try{const L=(await Hs(_.current,{scale:2})).toDataURL("image/png"),R=document.createElement("a");R.href=L,R.download=`Amortizacion_${b.property.code}.png`,R.click();const Q=`*SALDO AVANZADO:* Adjunto imagen de amortización para la unidad ${b.property.code}.`;window.open(`https://wa.me/?text=${encodeURIComponent(Q)}`,"_blank")}catch{alert("Error al capturar imagen")}},I=async()=>{if(!_.current)return;const L=(await Hs(_.current,{scale:2})).toDataURL("image/png"),R=document.createElement("a");R.href=L,R.download=`Saldo_Avanzado_${b.property.code}.png`,R.click()},M=async D=>{const L=`📊 *TRAZABILIDAD CONTABLE AVANZADA - ${Ra}*
Unidad: ${b.property.code}
Balance: ${Ue[s]} ${l}
--------------------------
Deuda Inicial: $${Zr(b.initial_debt)}
Cuota mes: $${Zr(b.current_fee)}
Pagos: $${Zr(b.payments.reduce((R,Q)=>R+Q.amount_usd,0))}
*SALDO RESTANTE: $${Zr(b.final_balance)}*`;D==="whatsapp"?window.open(`https://wa.me/?text=${encodeURIComponent(L)}`,"_blank"):D==="telegram"?window.open(`https://t.me/share/url?url=${encodeURIComponent(L)}`,"_blank"):D==="email"?window.open(`mailto:?subject=Saldo Avanzado ${b.property.code}&body=${encodeURIComponent(L)}`,"_blank"):D==="share"&&navigator.share&&navigator.share({title:"Saldo Avanzado",text:L})},U=()=>{const D=`
        <html>
        <head>
            <title>Saldo Avanzado - ${b.property.code}</title>
            <style>
                body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; padding: 40px; color: #333; background: #f9f9f9; }
                .container { max-width: 1000px; margin: auto; background: white; padding: 40px; border: 1px solid #eee; box-shadow: 0 0 20px rgba(0,0,0,0.05); }
                h1 { color: #1e293b; border-bottom: 2px solid #3b82f6; padding-bottom: 10px; }
                .header-info { display: flex; justify-content: space-between; margin-bottom: 30px; }
                table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
                th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                th { background: #f8fafc; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
                .text-right { text-align: right; }
                .font-bold { font-weight: bold; }
                .bg-blue { background: #eff6ff; }
                .bg-green { background: #f0fdf4; }
                .footer { margin-top: 40px; font-size: 10px; color: #94a3b8; text-align: center; border-top: 1px solid #eee; padding-top: 20px; }
            </style>
        </head>
        <body>
            <div class="container">
                <h1>Reporte de Amortización Contable</h1>
                <div class="header-info">
                    <div>
                        <p><b>PROPIEDAD:</b> ${b.property.code}</p>
                        <p><b>PERIODO:</b> ${Ue[s]} ${l}</p>
                    </div>
                    <div>
                        <p><b>CONDOMINIO:</b> ${Ra}</p>
                        <p><b>SALDO FINAL:</b> $ ${Zr(b.final_balance)}</p>
                    </div>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Fecha</th>
                            <th>Descripción / Ref</th>
                            <th class="text-right">Debe ($)</th>
                            <th class="text-right">Haber ($)</th>
                            <th class="text-right">Saldo Amortizado ($)</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>--</td>
                            <td><b>SALDO INICIAL ACUMULADO</b></td>
                            <td class="text-right">${Zr(b.initial_debt)}</td>
                            <td class="text-right">0.00</td>
                            <td class="text-right font-bold">${Zr(b.initial_debt)}</td>
                        </tr>
                        ${b.payments.map(G=>`
                        <tr>
                            <td>${G.date}</td>
                            <td>PAGO RECIBIDO - REF: ${G.reference}</td>
                            <td class="text-right">0.00</td>
                            <td class="text-right">${Zr(G.amount_usd)}</td>
                            <td class="text-right italic font-bold" style="color: #059669">- ${Zr(G.amount_usd)}</td>
                        </tr>
                        `).join("")}
                        <tr class="bg-blue">
                            <td>${new Date().toLocaleDateString()}</td>
                            <td><b>CUOTA DEL MES</b></td>
                            <td class="text-right">${Zr(b.current_fee)}</td>
                            <td class="text-right">0.00</td>
                            <td class="text-right font-bold">+ ${Zr(b.current_fee)}</td>
                        </tr>
                        <tr class="bg-green">
                            <td colspan="4" class="text-right font-black"><b>TOTAL SALDO PENDIENTE A LA FECHA</b></td>
                            <td class="text-right font-black" style="font-size: 16px;"><b>$ ${Zr(b.final_balance)}</b></td>
                        </tr>
                    </tbody>
                </table>
                <div class="footer">
                    SAC 2026 Kernel V4.2.04 MC/MB • TecnoMath Solutions
                </div>
            </div>
        </body>
        </html>`,L=new Blob([D],{type:"text/html"}),R=URL.createObjectURL(L),Q=document.createElement("a");Q.href=R,Q.download=`Amortizacion_${b.property.code}.html`,Q.click()};if(f==="report"&&b){let D=Number(b.initial_debt);return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>p("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(Os,{className:"rotate-180",size:16})," Volver a Selección"]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg hover:bg-slate-800 transition-all",title:"Imprimir",children:n.jsx(yt,{size:20})}),n.jsx("button",{onClick:U,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg hover:bg-blue-500 transition-all",title:"Exportar HTML",children:n.jsx(ja,{size:20})}),n.jsx("button",{onClick:I,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg hover:bg-indigo-500 transition-all",title:"Capturar Imagen",children:n.jsx(Yi,{size:20})}),n.jsx("button",{onClick:B,className:"p-3 bg-emerald-600 text-white rounded-xl shadow-lg hover:bg-emerald-500 transition-all",title:"WhatsApp imagen",children:n.jsx(ek,{size:20})}),n.jsx("button",{onClick:()=>M("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg hover:bg-emerald-400 transition-all",title:"WhatsApp",children:n.jsx(vn,{size:20})}),n.jsx("button",{onClick:()=>M("telegram"),className:"p-3 bg-sky-500 text-white rounded-xl shadow-lg hover:bg-sky-400 transition-all",title:"Telegram",children:n.jsx(Gi,{size:20})}),n.jsx("button",{onClick:()=>M("email"),className:"p-3 bg-slate-500 text-white rounded-xl shadow-lg hover:bg-slate-400 transition-all",title:"Email",children:n.jsx(Qr,{size:20})}),n.jsx("button",{onClick:()=>M("share"),className:"p-3 bg-violet-600 text-white rounded-xl shadow-lg hover:bg-violet-500 transition-all",title:"Compatir",children:n.jsx(_a,{size:20})})]})]}),n.jsxs("div",{ref:_,className:"bg-white rounded-[1rem] border-2 border-slate-900 overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"p-8 bg-slate-900 text-white border-b-4 border-blue-600",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h1",{className:"text-3xl font-black tracking-tighter uppercase italic leading-none",children:"Hoja de Amortización"}),n.jsx("p",{className:"text-blue-400 font-bold text-[10px] tracking-[0.3em] uppercase",children:"Trazabilidad Contable Avanzada"})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-slate-400",children:Ra}),n.jsx("p",{className:"text-xs font-bold text-slate-300 tracking-widest mt-1",children:"Kernel V4.2.04 MC/MB"})]})]}),n.jsxs("div",{className:"mt-8 grid grid-cols-2 md:grid-cols-4 gap-4",children:[n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Propiedad"}),n.jsx("p",{className:"text-xl font-black text-white",children:b.property.code})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Mes Auditoría"}),n.jsx("p",{className:"text-xl font-black text-blue-400 uppercase",children:Ue[s]})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Déficit Inicial ($)"}),n.jsxs("p",{className:"text-xl font-black text-red-400 italic underline",children:["$ ",Zr(b.initial_debt)]})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Balance Actual ($)"}),n.jsxs("p",{className:"text-xl font-black text-emerald-400",children:["$ ",Zr(b.final_balance)]})]})]})]}),n.jsxs("div",{className:"p-4 sm:p-8",children:[n.jsx("div",{className:"overflow-x-auto border-2 border-slate-200 rounded-xl",children:n.jsxs("table",{className:"w-full border-collapse",children:[n.jsx("thead",{className:"bg-slate-100 divide-x-2 divide-slate-200",children:n.jsxs("tr",{className:"text-[10px] font-black uppercase text-slate-600 tracking-widest",children:[n.jsx("th",{className:"px-4 py-4 text-center border-r-2 border-slate-200 w-16",children:"Item"}),n.jsx("th",{className:"px-4 py-4 border-r-2 border-slate-200",children:"Fecha"}),n.jsx("th",{className:"px-4 py-4 border-r-2 border-slate-200",children:"Descripción del Movimiento"}),n.jsx("th",{className:"px-4 py-4 text-right border-r-2 border-slate-200",children:"Cargo (+)"}),n.jsx("th",{className:"px-4 py-4 text-right border-r-2 border-slate-200",children:"Abono (-)"}),n.jsx("th",{className:"px-4 py-4 text-right bg-blue-50 text-blue-800",children:"Saldo Restante ($)"})]})}),n.jsxs("tbody",{className:"divide-y-2 divide-slate-100 font-mono text-[11px] sm:text-xs",children:[n.jsxs("tr",{className:"bg-slate-50 divide-x-2 divide-slate-100",children:[n.jsx("td",{className:"px-4 py-4 text-center font-bold",children:"001"}),n.jsx("td",{className:"px-4 py-4 text-slate-400 italic",children:"Pre-gestión"}),n.jsx("td",{className:"px-4 py-4 font-black uppercase tracking-tight",children:"SALDO INICIAL / CARGO ACUMULADO"}),n.jsx("td",{className:"px-4 py-4 text-right font-black text-red-600 underline underline-offset-4 decoration-red-200",children:Zr(b.initial_debt)}),n.jsx("td",{className:"px-4 py-4 text-right text-slate-300",children:"0.00"}),n.jsx("td",{className:"px-4 py-4 text-right font-black bg-blue-50/50",children:Zr(D)})]}),b.payments.map((L,R)=>(D-=Number(L.amount_usd),n.jsxs("tr",{className:"divide-x-2 divide-slate-100 hover:bg-slate-50 transition-colors",children:[n.jsx("td",{className:"px-4 py-4 text-center text-slate-300 font-bold",children:String(R+2).padStart(3,"0")}),n.jsx("td",{className:"px-4 py-4 font-bold text-slate-800",children:L.date}),n.jsx("td",{className:"px-4 py-4 uppercase",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wV,{size:12,className:"text-emerald-500"}),n.jsxs("span",{children:["ABONO RECIBIDO - REF: ",n.jsx("span",{className:"font-black text-blue-600",children:L.reference})]})]})}),n.jsx("td",{className:"px-4 py-4 text-right text-slate-300",children:"0.00"}),n.jsxs("td",{className:"px-4 py-4 text-right font-black text-emerald-600 italic",children:["-",Zr(L.amount_usd)]}),n.jsx("td",{className:"px-4 py-4 text-right font-black bg-blue-50/50",children:Zr(D)})]},R))),(D+=Number(b.current_fee),n.jsxs("tr",{className:"bg-blue-600 text-white divide-x-2 divide-blue-500",children:[n.jsx("td",{className:"px-4 py-4 text-center font-bold",children:"---"}),n.jsx("td",{className:"px-4 py-4 font-bold",children:new Date().toLocaleDateString()}),n.jsx("td",{className:"px-4 py-4 uppercase font-black",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(CV,{size:12,className:"text-blue-200"}),n.jsxs("span",{children:["CUOTA MES ACTUAL - GESTIÓN ",Ue[s]]})]})}),n.jsxs("td",{className:"px-4 py-4 text-right font-black italic",children:["+",Zr(b.current_fee)]}),n.jsx("td",{className:"px-4 py-4 text-right text-blue-400",children:"0.00"}),n.jsx("td",{className:"px-4 py-4 text-right font-black bg-slate-900 border-l-4 border-l-blue-400",style:{fontSize:"14px"},children:Zr(D)})]}))]})]})}),n.jsxs("div",{className:"mt-10 grid grid-cols-1 md:grid-cols-2 gap-8 items-end border-t-2 border-slate-900 pt-8 no-break",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-900 text-white rounded-lg flex items-center justify-center shadow-lg",children:n.jsx(mi,{size:20})}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest text-slate-900",children:"Resumen de Amortización"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-200 rounded-xl",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Total Abonos ($)"}),n.jsxs("p",{className:"text-sm font-black text-emerald-600",children:["-$ ",Zr(b.payments.reduce((L,R)=>L+Number(R.amount_usd),0))]})]}),n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-200 rounded-xl",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Total Cargos ($)"}),n.jsxs("p",{className:"text-sm font-black text-red-600",children:["+$ ",Zr(Number(b.initial_debt)+Number(b.current_fee))]})]})]})]}),n.jsxs("div",{className:"text-center p-6 border-2 border-dashed border-slate-200 rounded-2xl relative overflow-hidden",children:[n.jsx(ho,{className:"absolute left-[-20px] bottom-[-20px] w-24 h-24 text-slate-50 -rotate-12"}),n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Validación de Gestión Contable"}),n.jsx("div",{className:"w-32 h-32 border-4 border-blue-600/20 rounded-full flex items-center justify-center mx-auto mb-4",children:n.jsx(zt,{size:48,className:"text-blue-600"})}),n.jsx("p",{className:"text-[10px] font-black text-slate-900 uppercase",children:"Certificado por TecnoMath"}),n.jsxs("p",{className:"text-[8px] font-bold text-slate-400 mt-1 uppercase italic underline",children:[b.property.code," • ",new Date().toLocaleDateString()]})]})]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 p-6 bg-blue-600 text-white rounded-3xl shadow-xl shadow-blue-200 no-print",children:[n.jsx(Ba,{size:24}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Información de Auditoría"}),n.jsx("p",{className:"text-xs font-medium",children:"Este documento refleja la resta aritmética de abonos sobre cargos acumulados desde el inicio de la gestión administrativa."})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter leading-none uppercase italic",children:["Saldo ",n.jsx("span",{className:"text-blue-600 underline decoration-blue-200 underline-offset-8",children:"Avanzado"})]}),n.jsx("p",{className:"text-slate-400 mt-4 font-bold text-[11px] uppercase tracking-[0.2em]",children:"Trazabilidad Contable & Amortización • V4.2.04"})]}),["programmer","admin"].includes(e.role)&&n.jsxs("button",{onClick:E,disabled:y,className:`flex items-center gap-3 px-8 py-4 rounded-[2rem] border-2 transition-all shadow-lg ${C?"bg-emerald-50 border-emerald-500 text-emerald-600 shadow-emerald-100":"bg-white border-slate-200 text-slate-400 shadow-slate-100"}`,children:[y?n.jsx(Vi,{className:"animate-spin",size:20}):C?n.jsx(EM,{size:24}):n.jsx(jM,{size:24}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest",children:"Estado para Propietarios"}),n.jsx("p",{className:"text-xs font-black uppercase",children:C?"VISIBLE (ON)":"OCULTO (OFF)"})]})]})]}),n.jsxs("div",{className:"bg-white rounded-[4rem] border-2 border-slate-900 shadow-2xl p-10 lg:p-16 overflow-hidden relative",children:[n.jsx(yl,{className:"absolute right-[-60px] top-[-60px] text-slate-50 w-96 h-96 pointer-events-none -rotate-12"}),n.jsxs("div",{className:"max-w-2xl mx-auto space-y-12 relative z-10",children:[n.jsxs("div",{className:"text-center space-y-6",children:[n.jsxs("div",{className:"w-24 h-24 bg-slate-900 text-white rounded-[2.5rem] flex items-center justify-center mx-auto shadow-2xl relative",children:[n.jsx(Ba,{size:48,className:"animate-pulse"}),n.jsx("div",{className:"absolute -bottom-2 -right-2 w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center border-4 border-white",children:n.jsx(mi,{size:18})})]}),n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tighter uppercase italic leading-none",children:"Módulo de Amortización"}),n.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed",children:"Visualice el descuento progresivo de la deuda a medida que se procesan los abonos en la cuenta del inmueble."})]}),n.jsxs("div",{className:"p-8 bg-slate-50 rounded-[3rem] border border-slate-200 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-[0.2em] ml-2",children:"Auditado en el Mes"}),n.jsx("select",{value:s,onChange:D=>i(Number(D.target.value)),className:"w-full bg-white border-2 border-slate-200 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:border-blue-600 transition-all appearance-none cursor-pointer text-center",children:Ue.map((D,L)=>n.jsx("option",{value:L,children:D},L))})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-[0.2em] ml-2",children:"Año Fiscal"}),n.jsx("input",{type:"number",value:l,onChange:D=>o(Number(D.target.value)),className:"w-full bg-white border-2 border-slate-200 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:border-blue-600 text-center transition-all"})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-[0.2em] ml-2 flex items-center gap-2 italic",children:[n.jsx(Gr,{size:14,className:"text-blue-600"})," Unidad a Verificar"]}),n.jsxs("select",{value:d||"",onChange:D=>u(Number(D.target.value)),className:"w-full bg-white border-2 border-slate-200 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:border-blue-600 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Propiedad..."}),t.sort((D,L)=>D.code.localeCompare(L.code,void 0,{numeric:!0})).map(D=>n.jsxs("option",{value:D.id,children:[D.code," - ",D.type," ",D.number]},D.id))]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("button",{disabled:!d||x,onClick:T,className:"w-full bg-slate-900 border-b-4 border-slate-950 text-white py-8 rounded-[3rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl hover:bg-slate-800 active:scale-95 transition-all flex items-center justify-center gap-4 disabled:opacity-50 group",children:[x?n.jsx(Vi,{className:"animate-spin",size:24}):n.jsx(mi,{size:20,className:"group-hover:rotate-12 transition-transform"}),"GENERAR HOJA DE CÁLCULO"]}),n.jsxs("p",{className:"text-center text-[10px] font-black text-slate-400 uppercase tracking-widest italic flex items-center justify-center gap-2",children:[n.jsx(ho,{size:10})," Auditoría Contable Integrada • SAC Kernel V4"]})]})]})]})]})},rIe=()=>{const[e,t]=j.useState(null),[r,a]=j.useState(!0),[s,i]=j.useState("dashboard"),[l,o]=j.useState(!1),[d,u]=j.useState(null),[f,p]=j.useState(!1),[x,m]=j.useState(!1),[b,v]=j.useState(null),[y,k]=j.useState(null),_=j.useRef(!1),{refreshData:C,moduleStatus:E,financialTotals:T,latestRate:B,exchangeRateHistory:I,setUserRole:M}=ht(),U=j.useRef(!1);j.useEffect(()=>{U.current=!0},[]);const D=async()=>{try{const Z=await(await fetch(`${ye}/get_license_status.php`)).json();v(Z),Z.status==="locked"&&(e==null?void 0:e.role)!=="programmer"?p(!0):p(!1),(await we.getSystemSettings()).system_maintenance_mode==="true"?m(!0):m(!1)}catch{console.warn("License/Maintenance Check Failed")}},L=j.useCallback(async z=>{if(!["admin","programmer","board"].includes(z.role))try{const Y=await(await fetch(`${ye}/get_blocking_status.php`,{credentials:"include"})).json();Y.blocking&&Y.target_tab?(k(Y),(!_.current||y&&y.item_id!==Y.item_id)&&(i(Y.target_tab),_.current=!0)):k(null)}catch(Z){console.error("Blocking Engine Error",Z)}},[y]),R=()=>{k(null),_.current=!1};j.useEffect(()=>{(async()=>{try{const Z=await we.checkSession();Z&&(t(Z),M(Z.role),await D(),await L(Z),C(Z.role))}catch{console.warn("Sesión no iniciada.")}finally{a(!1)}})()},[C,L,M]),j.useEffect(()=>{e&&we.logNavigation(s)},[s,e]);const Q=async z=>{a(!0),u(null);try{const Z=await we.login(z);t(Z),M(Z.role),await D(),_.current=!1,await L(Z),await C(Z.role)}catch(Z){u(Z.message)}finally{a(!1)}},G=async()=>{await we.logout(),t(null),M(null),i("dashboard"),k(null),p(!1),_.current=!1,U.current=!1};if(r)return n.jsxs("div",{className:"h-screen w-screen flex flex-col items-center justify-center bg-slate-50 gap-4",children:[n.jsx("div",{className:"w-12 h-12 border-4 border-blue-100 border-t-blue-600 rounded-full animate-spin"}),n.jsx("p",{className:"text-blue-600 font-bold tracking-widest text-xs uppercase",children:"Iniciando..."})]});if(!e)return n.jsx(nIe,{onLogin:Q,isLoading:r,error:d,latestRate:B});if(x&&e.role!=="programmer")return n.jsx(aIe,{logout:G});if(f)return n.jsx("div",{className:"h-screen w-screen bg-slate-900 flex items-center justify-center p-6",children:n.jsxs("div",{className:"bg-white rounded-[4rem] p-10 lg:p-16 max-w-2xl w-full shadow-2xl text-center relative overflow-hidden animate-in zoom-in duration-500",children:[n.jsx("div",{className:"w-24 h-24 bg-red-100 text-red-600 rounded-[2rem] flex items-center justify-center mx-auto mb-10 shadow-xl shadow-red-200",children:n.jsx(kM,{size:56})}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter leading-tight mb-6",children:["Servicio ",n.jsx("br",{}),n.jsx("span",{className:"text-red-600 italic",children:"Temporalmente Suspendido"})]}),n.jsxs("p",{className:"text-slate-500 font-medium text-lg leading-relaxed mb-10",children:["Detectamos una inconsistencia en el estatus de renta de este condominio. El acceso al sistema ha sido bloqueado preventivamente por el motor de licencias de ",n.jsx("b",{children:"TecnoMath"}),"."]}),n.jsxs("div",{className:"bg-slate-50 border border-slate-200 p-8 rounded-[2.5rem] mb-10",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"MOTIVO DETECTADO"}),n.jsxs("div",{className:"flex items-center justify-center gap-3 text-red-600 font-black text-xl uppercase tracking-tighter",children:[n.jsx(na,{size:24}),b!=null&&b.is_expired?"RENTA VENCIDA":"BLOQUEO ADMINISTRATIVO"]}),n.jsx("div",{className:"w-full h-px bg-slate-200 my-6"}),n.jsx("p",{className:"text-sm font-bold text-slate-700 uppercase",children:"Por favor contacte soporte para la reactivación inmediata:"}),n.jsx("a",{href:"https://tecnomath.com",target:"_blank",className:"text-blue-600 font-black text-2xl tracking-tight hover:underline block mt-2",children:"TecnoMath.com"})]}),n.jsx("div",{className:"flex justify-center gap-6",children:n.jsxs("button",{onClick:G,className:"text-slate-400 font-black text-xs uppercase tracking-widest hover:text-slate-600 flex items-center gap-2",children:[n.jsx(Pm,{size:16})," Salir del Portal"]})}),n.jsx(ja,{className:"absolute right-[-40px] bottom-[-40px] w-64 h-64 text-slate-100 pointer-events-none"})]})});const K=()=>{const z=["admin","programmer","board"].includes(e.role);switch(s){case"dashboard":return n.jsx(v5,{user:e,onNavigate:i});case"monthly-collection":return n.jsx(zFe,{user:e});case"debt-list":return n.jsx(KFe,{});case"solvent-list":return n.jsx(qFe,{});case"payment-report":return n.jsx($Fe,{user:e});case"properties":return z?n.jsx(xme,{user:e}):n.jsx(Mde,{user:e});case"bulk-load-properties":return n.jsx(XEe,{user:e});case"residents":return n.jsx(mme,{user:e});case"users":return n.jsx(gme,{user:e});case"bulk-load-users":return n.jsx(JEe,{user:e});case"providers":return n.jsx(zEe,{user:e});case"prefill-simulator":return n.jsx(ZEe,{user:e});case"recaudacion-detallada":return n.jsx(UFe,{user:e});case"generate-fees":return n.jsx(w5,{user:e,viewMode:"generate",onTabChange:i});case"view-fees":return n.jsx(w5,{user:e,viewMode:"list",onTabChange:i});case"balance":return n.jsx(bme,{user:e,onNavigate:i});case"historial-pagos-egresos":return n.jsx(MFe,{user:e});case"expediente-digital":return n.jsx(DFe,{user:e});case"payment-agreements":return n.jsx(FFe,{user:e});case"history-agreements":return n.jsx(IFe,{user:e});case"banks":return n.jsx(Rde,{user:e});case"bank-precise":return n.jsx(XFe,{user:e});case"bank-reconciliation":return n.jsx(qEe,{user:e});case"bank-reconciliation-bnc":return n.jsx(WEe,{user:e});case"statement-analyzer":return n.jsx(VEe,{user:e});case"statement-analyzer-bnc":return n.jsx(GEe,{user:e});case"statement-detailed":return n.jsx(KEe,{user:e});case"banplus-commissions":return n.jsx(YFe,{user:e});case"commissions":return n.jsx($Ee,{user:e});case"currency":return n.jsx(vEe,{});case"audit":return n.jsx(hme,{user:e});case"bulk-messages":return n.jsx(yEe,{user:e});case"messages":return n.jsx(wEe,{user:e});case"polls":return n.jsx(NEe,{user:e,onActionComplete:R});case"data-forms":return n.jsx(kEe,{user:e,onActionComplete:R});case"live-voting":return n.jsx(BEe,{user:e,onActionComplete:R});case"calculator":return n.jsx(FEe,{});case"statistics":return n.jsx(IEe,{});case"reservations":return n.jsx(DEe,{user:e});case"announcements":return n.jsx(UEe,{user:e});case"services":return n.jsx(MEe,{user:e});case"assemblies":return n.jsx(REe,{user:e});case"maintenance":return n.jsx(OEe,{user:e});case"license-control":return n.jsx(YEe,{user:e});case"menu-selection":return n.jsx(BFe,{user:e});case"system-audit":return n.jsx(PEe,{user:e});case"excel-reports":return n.jsx(RFe,{user:e});case"detailed-excel-reports":return n.jsx(OFe,{user:e});case"html-reports":return n.jsx(PFe,{user:e});case"individual-account-status":return n.jsx(LFe,{user:e});case"detailed-account-status":return n.jsx(QFe,{user:e});case"monthly-debt-status":return n.jsx(JFe,{user:e});case"monthly-debt-status-massive":return n.jsx(ZFe,{user:e});case"credit-balances":return n.jsx(HFe,{user:e});case"saldo-desglosado":return n.jsx(eIe,{user:e});case"saldo-desglosado-avanzado":return n.jsx(tIe,{user:e});case"payment-status":return n.jsx(iN,{user:e,onNavigate:i});case"payment-receipt":return n.jsx(WFe,{user:e});case"solvencia-html":return n.jsx(iN,{user:e,initialMode:"html",onNavigate:i});case"solvencia-txt":return n.jsx(iN,{user:e,initialMode:"txt",onNavigate:i});case"password-manager":return n.jsx(HEe,{user:e});case"individual-fee-view":return n.jsx(eSe,{user:e});case"individual-fee-html":return n.jsx(jFe,{user:e});case"individual-fee-html-large":return n.jsx(SFe,{user:e});default:return n.jsx(v5,{user:e,onNavigate:i})}},W=[{id:"dashboard",label:"DashBoard",icon:yG,roles:["admin","owner","manager","board","programmer"],core:!0},{id:"properties",label:["admin","board","programmer"].includes(e.role)?"Propiedades":"Mi Inmueble",icon:Gr,roles:["admin","owner","resident","board","programmer"],core:!0},{id:"bulk-load-properties",label:"Carga Excel Prop.",icon:gl,roles:["admin","programmer"],core:!0},{id:"residents",label:"Residentes",icon:Ea,roles:["admin","programmer","board"],core:!0},{id:"users",label:"Usuarios",icon:Oi,roles:["programmer"],core:!0},{id:"bulk-load-users",label:"Carga Excel Usua.",icon:ko,roles:["programmer"],core:!0},{id:"providers",label:"Proveedores",icon:ub,roles:["admin","programmer","board"],core:!0},{id:"prefill-simulator",label:"Pre-fill Cuota Mes",icon:sa,roles:["admin","board","programmer"]},{id:"generate-fees",label:"Generar Cuotas",icon:ak,roles:["admin","board","programmer"],core:!0},{id:"view-fees",label:"Ver Cuotas y Pagos",icon:gr,roles:["admin","owner","board","programmer"],core:!0},{id:"payment-report",label:"Reporte de Pago",icon:aa,roles:["admin","owner","board","programmer"],core:!1},{id:"monthly-collection",label:"Recaudación Mensual",icon:ha,roles:["admin","programmer"],core:!1},{id:"debt-list",label:"Listado de Deudores",icon:gr,roles:["admin","board","programmer"],core:!1},{id:"solvent-list",label:"Listado de Solventes",icon:zt,roles:["admin","programmer"],core:!1},{id:"recaudacion-detallada",label:"Recaudación Digital",icon:xr,roles:["admin","board","programmer"]},{id:"payment-status",label:"Estatus de Pago",icon:zt,roles:["admin","owner","board","programmer"]},{id:"payment-receipt",label:"Recibo de Pago",icon:aa,roles:["admin","owner","board","programmer"]},{id:"solvencia-html",label:"Solvencia HTML Pro",icon:ja,roles:["programmer"]},{id:"solvencia-txt",label:".TXT Solvencia",icon:gr,roles:["programmer"]},{id:"individual-fee-view",label:"Cuota por Usuario Individual",icon:PA,roles:["admin","board","programmer"]},{id:"individual-fee-html",label:"Cuota por Usuario Individual HTML",icon:ja,roles:["admin","board","programmer"],core:!0},{id:"individual-fee-html-large",label:"Cuota por Usuario Individual HTML Grande",icon:ja,roles:["admin","board","programmer"]},{id:"individual-account-status",label:"Estado de Cuenta Individual",icon:aa,roles:["admin","board","programmer","owner"]},{id:"detailed-account-status",label:"Estado de Cuenta Detallado",icon:Ba,roles:["admin","board","programmer"]},{id:"saldo-desglosado",label:"Saldo Desglosado",icon:aa,roles:["admin","board","programmer","owner"]},{id:"saldo-desglosado-avanzado",label:"Saldo Desglosado Avanzado",icon:yl,roles:["admin","programmer"]},{id:"monthly-debt-status",label:"Estado Cuenta - Deuda Meses",icon:aa,roles:["admin","board","programmer","owner"]},{id:"monthly-debt-status-massive",label:"Estado Cuenta - Deuda Meses Masivo",icon:Gi,roles:["admin","board","programmer"]},{id:"credit-balances",label:"Saldos a Favor",icon:wn,roles:["admin","board","programmer"],core:!0},{id:"balance",label:"Balance General",icon:Fp,roles:["admin","board","programmer"],core:!0},{id:"historial-pagos-egresos",label:"Auditoría Egresos",icon:aa,roles:["admin","board","programmer"]},{id:"expediente-digital",label:"Expediente Digital",icon:Rm,roles:["admin","owner","board","programmer"]},{id:"payment-agreements",label:"Convenios de Pago",icon:Zd,roles:["admin","board","programmer"]},{id:"history-agreements",label:"Histórico Convenios",icon:Ba,roles:["admin","board","programmer"]},{id:"banks",label:"Banco",icon:Tc,roles:["admin","board","programmer"],core:!0},{id:"bank-precise",label:"Banco Preciso (V4)",icon:zt,roles:["admin","board","programmer"],core:!1},{id:"bank-reconciliation",label:"Banco VS Banco BanPlus",icon:kA,roles:["admin","board","programmer"]},{id:"bank-reconciliation-bnc",label:"Banco VS Banco BNC",icon:kA,roles:["admin","board","programmer"]},{id:"statement-analyzer",label:"Analizador Estados BanPlus",icon:$f,roles:["admin","board","programmer"]},{id:"statement-analyzer-bnc",label:"Analizador Estados BNC",icon:xr,roles:["admin","board","programmer"]},{id:"statement-detailed",label:"Analizador Detallado BanPlus",icon:Pc,roles:["admin","board","programmer"]},{id:"banplus-commissions",label:"Comisiones Banplus desde Estado Cuenta",icon:ps,roles:["admin","board","programmer"]},{id:"commissions",label:"Cálculo Comisiones",icon:ps,roles:["admin","board","programmer"]},{id:"excel-reports",label:"Informes en Excel",icon:gl,roles:["admin","board","programmer"]},{id:"detailed-excel-reports",label:"Informes Detallados Excel",icon:gl,roles:["admin","board","programmer"]},{id:"html-reports",label:"Informes en HTML",icon:gr,roles:["admin","board","programmer"]},{id:"audit",label:"Informes y Auditoría",icon:po,roles:["admin","board","programmer"]},{id:"currency",label:"Tasas",icon:La,roles:["admin","board","programmer"]},{id:"bulk-messages",label:"Mensajería Masiva",icon:Qr,roles:["admin","board","programmer"],core:!0},{id:"messages",label:"Mensajería Individual",icon:Gi,roles:["admin","board","programmer"]},{id:"polls",label:"Carta Consulta",icon:Md,roles:["admin","owner","board","programmer","family"]},{id:"data-forms",label:"Censos",icon:Xd,roles:["admin","owner","board","programmer","family"]},{id:"live-voting",label:"Asamblea Live",icon:Kf,roles:["admin","owner","board","programmer","family","guest"]},{id:"calculator",label:"Calculadora Pro",icon:mi,roles:["admin","owner","board","programmer","family","guest"]},{id:"statistics",label:"Estadísticas Pro",icon:bM,roles:["admin","owner","board","programmer","family","guest"]},{id:"reservations",label:"Reservas",icon:gM,roles:["admin","owner","board","programmer","family"]},{id:"announcements",label:"Comunicados",icon:Gf,roles:["admin","owner","board","programmer","family"]},{id:"services",label:"Servicios",icon:qf,roles:["admin","owner","board","programmer","family"]},{id:"assemblies",label:"Asambleas",icon:mM,roles:["admin","owner","board","programmer","family"]},{id:"maintenance",label:"Mantenimiento",icon:ob,roles:["programmer"],core:!0},{id:"menu-selection",label:"Selección de Menú",icon:Om,roles:["programmer"],core:!0},{id:"license-control",label:"Control SaaS",icon:Rd,roles:["programmer"],core:!0},{id:"password-manager",label:"Password Usuarios",icon:jA,roles:["programmer"],core:!0},{id:"system-audit",label:"DataLogger (ip)",icon:hs,roles:["programmer"],core:!0}].filter(z=>{if(!z.roles.includes(e.role))return!1;if(z.core||["admin","programmer"].includes(e.role))return!0;const Y=E.find(te=>te.id===z.id);return Y?Y.isActive:!1});return n.jsxs("div",{className:"flex min-h-[100dvh] w-full bg-slate-50 text-slate-900 font-['Inter'] relative overflow-x-hidden",children:[n.jsx(QEe,{user:e}),l&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[100] lg:hidden",onClick:()=>o(!1)}),n.jsxs("aside",{className:`fixed inset-y-0 left-0 transform ${l?"translate-x-0":"-translate-x-full"} lg:relative lg:translate-x-0 transition-transform duration-300 ease-in-out w-64 sm:w-72 bg-slate-900 flex flex-col z-[110] shadow-2xl h-screen no-print`,children:[n.jsxs("div",{className:"p-6 sm:p-8 flex items-center justify-between shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-9 h-9 sm:w-10 sm:h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-500/30",children:n.jsx(ha,{className:"text-white",size:20})}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"font-black text-xl sm:text-2xl tracking-tighter text-white leading-none",children:["SAC ",n.jsx("span",{className:"text-blue-400",children:"2026"})]}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.5em] text-orange-600 mt-1",children:Ra.toLowerCase()}),n.jsx("span",{className:"text-[7px] font-black text-blue-400 uppercase tracking-[0.2em] mt-1",children:"Kernel V4.2.07 LOCAL MC/MB"})]})]}),n.jsx("button",{onClick:()=>o(!1),className:"lg:hidden p-2 text-slate-400 hover:text-white transition-colors",children:n.jsx(ft,{size:20})})]}),e.role==="programmer"&&T&&n.jsxs("div",{className:"px-6 py-4 mx-4 mb-2 bg-blue-600/10 border border-blue-500/20 rounded-2xl animate-in zoom-in",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"Fondo en Divisa"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wn,{size:14,className:"text-emerald-400"}),n.jsxs("span",{className:"text-base font-black text-white tracking-tighter",children:["$ ",Number(T.initialCashUsd).toLocaleString("en-US",{minimumFractionDigits:2})]})]})]}),n.jsx("nav",{className:"flex-1 overflow-y-auto px-3 sm:px-4 py-4 space-y-1.5 sm:space-y-2 custom-scrollbar",children:W.map(z=>{const Z=z.icon,Y=s===z.id;return n.jsxs("button",{onClick:()=>{i(z.id),o(!1),window.scrollTo(0,0)},className:`w-full flex items-center gap-3 sm:gap-4 px-4 sm:px-6 py-3.5 sm:py-4 rounded-xl sm:rounded-2xl font-black text-[10px] sm:text-xs uppercase tracking-widest transition-all ${Y?"bg-blue-600 text-white shadow-xl shadow-blue-500/20":"text-slate-400 hover:bg-slate-800 hover:text-white"}`,children:[n.jsx(Z,{size:18}),z.label]},z.id)})}),n.jsx("div",{className:"p-4 mt-auto border-t border-slate-800/50 shrink-0",children:n.jsxs("button",{onClick:G,className:"w-full flex items-center gap-4 px-6 py-4 rounded-2xl font-black text-[10px] sm:text-xs uppercase tracking-widest text-red-400 hover:bg-red-50/10 transition-all",children:[n.jsx(Pm,{size:20})," Cerrar Sesión"]})})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-[100dvh]",children:[n.jsxs("header",{className:"sticky top-0 h-16 sm:h-20 bg-white/80 backdrop-blur-md border-b border-slate-200 flex items-center justify-between px-4 sm:px-8 z-[30] shrink-0 no-print",children:[n.jsx("button",{onClick:()=>o(!0),className:"lg:hidden p-2 text-slate-500 hover:bg-slate-100 rounded-xl transition-all",children:n.jsx(MG,{size:24})}),n.jsx("div",{className:"flex-1 lg:flex items-center gap-3 px-2 sm:px-4",children:y?n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 sm:px-4 sm:py-2 bg-amber-50 text-amber-600 rounded-full border border-amber-100 scale-90 sm:scale-100",children:[n.jsx(na,{size:12,className:"shrink-0"}),n.jsx("span",{className:"text-[9px] sm:text-[10px] font-black uppercase tracking-widest truncate max-w-[140px] sm:max-w-none",children:"Consulta pendiente por su unidad"})]}):n.jsxs("div",{className:"hidden lg:flex items-center gap-3",children:[n.jsx("div",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Terminal Activa"})]})}),n.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[n.jsxs("div",{className:"text-right hidden sm:block",children:[n.jsx("p",{className:"text-xs font-black text-slate-900 leading-none",children:e==null?void 0:e.fullName}),n.jsx("p",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-widest mt-1",children:e==null?void 0:e.role})]}),n.jsx("div",{className:"w-9 h-9 sm:w-10 sm:h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400",children:n.jsx(eu,{size:18})})]})]}),n.jsx("main",{className:"flex-1 p-3 sm:p-6 lg:p-8 bg-slate-50",children:n.jsx("div",{className:"max-w-7xl mx-auto",children:K()})})]})]})},aIe=({logout:e})=>n.jsxs("div",{className:"h-screen w-screen bg-[#0f172a] flex items-center justify-center p-6 relative overflow-hidden font-['Inter']",children:[n.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",children:n.jsx("div",{className:"absolute top-0 left-0 w-full h-full",style:{backgroundImage:"radial-gradient(circle at 2px 2px, #3b82f6 1px, transparent 0)",backgroundSize:"40px 40px"}})}),n.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-blue-600/20 blur-[120px] rounded-full animate-pulse pointer-events-none"}),n.jsxs("div",{className:"bg-white rounded-[4rem] p-10 lg:p-16 max-w-3xl w-full shadow-2xl text-center relative z-10 border border-slate-800/10 animate-in zoom-in duration-700",children:[n.jsxs("div",{className:"relative mb-12",children:[n.jsx("div",{className:"w-24 h-24 bg-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-2xl shadow-blue-500/40 relative z-10 animate-flicker",children:n.jsx(ob,{className:"text-white animate-[spin_4s_linear_infinite]",size:48})}),n.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-24 h-24 bg-blue-400 blur-xl opacity-50 animate-pulse"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter leading-tight mb-6",children:["Sistema en ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-600 font-black italic uppercase",children:"Modo Mantenimiento"})]}),n.jsxs("div",{className:"bg-slate-50 border border-slate-200 p-8 rounded-[3rem] space-y-6 mb-10 group hover:border-blue-200 transition-colors",children:[n.jsx("p",{className:"text-slate-500 font-bold text-base leading-relaxed",children:"Estamos actualizando los núcleos del SAC 2026 para ofrecerte una experiencia superior. Los módulos de administración se encuentran en modo de solo lectura o suspendidos temporalmente."}),n.jsx("div",{className:"flex flex-col items-center gap-4 py-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(t=>n.jsx("div",{className:"w-1.5 h-6 bg-blue-600 rounded-full animate-bounce",style:{animationDelay:`${t*.1}s`}},t))}),n.jsx("span",{className:"text-[10px] font-black text-blue-600 uppercase tracking-[0.3em] ml-4",children:"Procesando Kernel V4.2.07"})]})}),n.jsxs("div",{className:"pt-6 border-t border-slate-200 flex flex-col sm:flex-row items-center justify-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-emerald-100 flex items-center justify-center text-emerald-600",children:n.jsx(La,{size:16})}),n.jsxs("span",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest text-left",children:["Integridad de Datos",n.jsx("br",{}),n.jsx("span",{className:"text-emerald-600",children:"Verificada OK"})]})]}),n.jsx("div",{className:"hidden sm:block w-px h-8 bg-slate-200"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center text-blue-600",children:n.jsx(ko,{size:16})}),n.jsxs("span",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest text-left",children:["Respaldo Automático",n.jsx("br",{}),n.jsx("span",{className:"text-blue-600",children:"Sincronizado"})]})]})]})]}),n.jsx("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-8",children:n.jsxs("button",{onClick:e,className:"text-slate-400 font-black text-xs uppercase tracking-widest hover:text-slate-900 transition-colors flex items-center gap-2",children:[n.jsx(Pm,{size:16})," Salir del Sistema"]})}),n.jsx(sa,{className:"absolute left-[-20px] top-[-20px] w-48 h-48 text-slate-100/50 pointer-events-none -rotate-12"}),n.jsxs("div",{className:"absolute bottom-6 right-10 flex items-center gap-2",children:[n.jsx("span",{className:"text-[8px] font-black text-slate-300 uppercase tracking-widest",children:"TecnoMath SAC Core"}),n.jsx("div",{className:"w-1 h-1 bg-blue-400 rounded-full animate-ping"})]})]})]}),nIe=({onLogin:e,isLoading:t,error:r,latestRate:a})=>{const[s,i]=j.useState(""),[l,o]=j.useState("");return n.jsx("div",{className:"min-h-[100dvh] w-full flex items-center justify-center bg-slate-50 p-4 font-['Inter']",children:n.jsxs("div",{className:"w-full max-w-md bg-white rounded-[2rem] sm:rounded-[3rem] shadow-2xl p-8 sm:p-12 border border-slate-100 animate-in fade-in zoom-in duration-500",children:[n.jsxs("div",{className:"flex flex-col items-center mb-8 sm:mb-10",children:[n.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 bg-blue-600 rounded-2xl flex items-center justify-center shadow-xl shadow-blue-200 mb-6",children:n.jsx(ha,{size:28,className:"text-white"})}),n.jsxs("div",{className:"text-center",children:[n.jsxs("h1",{className:"text-2xl sm:text-3xl font-black text-slate-900 tracking-tighter leading-none",children:["SAC ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-[9px] font-black uppercase tracking-[0.5em] text-orange-600 mt-2",children:Ra.toLowerCase()}),n.jsx("p",{className:"text-[7px] font-black text-blue-600 uppercase tracking-widest mt-1",children:"Kernel V4.2.07 LOCAL MC/MB"})]}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-[9px] sm:text-[10px] tracking-[0.2em] sm:tracking-[0.3em] mt-6 text-center leading-relaxed",children:"Gestión Integral"})]}),r&&n.jsxs("div",{className:"mb-6 sm:mb-8 bg-red-50 border border-red-100 p-4 rounded-2xl flex items-center gap-3 text-red-600 animate-in shake duration-300",children:[n.jsx(Cr,{size:18,className:"shrink-0"}),n.jsx("p",{className:"text-[9px] sm:text-[10px] font-black uppercase tracking-widest leading-relaxed",children:r})]}),n.jsxs("form",{onSubmit:d=>{d.preventDefault(),e({username:s,password:l})},className:"space-y-5 sm:space-y-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[9px] sm:text-[10px] font-black uppercase text-slate-400 tracking-widest block px-1",children:"Usuario / Teléfono"}),n.jsxs("div",{className:"relative",children:[n.jsx(eu,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{required:!0,autoFocus:!0,type:"text",placeholder:"Ej: 04121234567",className:"w-full bg-slate-50 border border-slate-200 rounded-xl sm:rounded-2xl pl-11 sm:pl-12 pr-4 py-3.5 sm:py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-black text-slate-800 tracking-widest",value:s,onChange:d=>i(d.target.value)})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[9px] sm:text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"Contraseña (Cédula)"}),n.jsxs("div",{className:"relative",children:[n.jsx(Rd,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{required:!0,type:"password",placeholder:"Mismo número de C.I.",className:"w-full bg-slate-50 border border-slate-100 rounded-xl sm:rounded-2xl pl-11 sm:pl-12 pr-4 py-3.5 sm:py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-bold text-slate-800",value:l,onChange:d=>o(d.target.value)})]})]}),n.jsxs("button",{disabled:t,type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-4.5 sm:py-5 rounded-2xl sm:rounded-[2rem] font-black text-[10px] sm:text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[t?n.jsx("div",{className:"w-4 h-4 sm:w-5 sm:h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}):n.jsx(Pm,{size:16,className:"rotate-180"}),"ACCESO SEGURO"]})]}),n.jsx("div",{className:"mt-10 sm:mt-12 pt-8 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-xs sm:text-sm text-slate-700 font-black uppercase tracking-[0.2em]",children:["Powered by TecnoMath • ",n.jsx("span",{className:"text-blue-600",children:"By Andres Mathison"})," © 2026"]})})]})})},Nz=document.getElementById("root");if(!Nz)throw new Error("Could not find root element to mount to");const sIe=$7.createRoot(Nz);sIe.render(n.jsx(Bp.StrictMode,{children:n.jsx(dq,{children:n.jsx(rIe,{})})}));
